first commit
37
滴滴淘/ddt_flutter/.gitignore
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
# Miscellaneous
|
||||
*.class
|
||||
*.log
|
||||
*.pyc
|
||||
*.swp
|
||||
.DS_Store
|
||||
.atom/
|
||||
.buildlog/
|
||||
.history
|
||||
.svn/
|
||||
|
||||
# IntelliJ related
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea/
|
||||
|
||||
# The .vscode folder contains launch configuration and tasks you configure in
|
||||
# VS Code which you may wish to be included in version control, so this line
|
||||
# is commented out by default.
|
||||
#.vscode/
|
||||
|
||||
# Flutter/Dart/Pub related
|
||||
**/doc/api/
|
||||
.dart_tool/
|
||||
.flutter-plugins
|
||||
.flutter-plugins-dependencies
|
||||
.packages
|
||||
.pub-cache/
|
||||
.pub/
|
||||
/build/
|
||||
|
||||
# Web related
|
||||
lib/generated_plugin_registrant.dart
|
||||
|
||||
# Exceptions to above rules.
|
||||
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
|
||||
10
滴滴淘/ddt_flutter/.metadata
Normal file
@@ -0,0 +1,10 @@
|
||||
# This file tracks properties of this Flutter project.
|
||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||
#
|
||||
# This file should be version controlled and should not be manually edited.
|
||||
|
||||
version:
|
||||
revision: 0b8abb4724aa590dd0f429683339b1e045a1594d
|
||||
channel: stable
|
||||
|
||||
project_type: app
|
||||
1
滴滴淘/ddt_flutter/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
43a636de-d1b6-4544-ab29-e4e89e7c9e7f
|
||||
18
滴滴淘/ddt_flutter/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# ddt_flutter
|
||||
|
||||
A new Flutter project.
|
||||
|
||||
## Getting Started
|
||||
|
||||
This project is a starting point for a Flutter application.
|
||||
|
||||
A few resources to get you started if this is your first Flutter project:
|
||||
|
||||
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
|
||||
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
|
||||
|
||||
For help getting started with Flutter, view our
|
||||
[online documentation](https://flutter.dev/docs), which offers tutorials,
|
||||
samples, guidance on mobile development, and a full API reference.
|
||||
|
||||
|
||||
7
滴滴淘/ddt_flutter/android/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
gradle-wrapper.jar
|
||||
/.gradle
|
||||
/captures/
|
||||
/gradlew
|
||||
/gradlew.bat
|
||||
/local.properties
|
||||
GeneratedPluginRegistrant.java
|
||||
1
滴滴淘/ddt_flutter/android/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
8e0252bb-af06-475e-8d0e-d28a3d3df17c
|
||||
1
滴滴淘/ddt_flutter/android/app/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
d882b3e0-9a44-4e7e-80ca-79d58dd0b3de
|
||||
61
滴滴淘/ddt_flutter/android/app/build.gradle
Normal file
@@ -0,0 +1,61 @@
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||
if (flutterRoot == null) {
|
||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion 28
|
||||
|
||||
lintOptions {
|
||||
disable 'InvalidPackage'
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "com.ddt.flutter.ddt_flutter"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 28
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test:runner:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
|
||||
}
|
||||
1
滴滴淘/ddt_flutter/android/app/src/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
22ff8037-0289-4c73-b821-c6950b257dd8
|
||||
1
滴滴淘/ddt_flutter/android/app/src/debug/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
6fe742bc-f23e-4a86-81b0-26d52ec4c53b
|
||||
@@ -0,0 +1,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.ddt.flutter.ddt_flutter">
|
||||
<!-- Flutter needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
||||
1
滴滴淘/ddt_flutter/android/app/src/main/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
dbe36970-b3ea-4892-a973-e0e41301a896
|
||||
30
滴滴淘/ddt_flutter/android/app/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.ddt.flutter.ddt_flutter">
|
||||
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
||||
calls FlutterMain.startInitialization(this); in its onCreate method.
|
||||
In most cases you can leave this as-is, but you if you want to provide
|
||||
additional functionality it is fine to subclass or reimplement
|
||||
FlutterApplication and put your custom class here. -->
|
||||
<application
|
||||
android:name="io.flutter.app.FlutterApplication"
|
||||
android:label="ddt_flutter"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||
<meta-data
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2" />
|
||||
</application>
|
||||
</manifest>
|
||||
1
滴滴淘/ddt_flutter/android/app/src/main/java/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
9ae182c1-5062-455b-aec9-c079210eae16
|
||||
1
滴滴淘/ddt_flutter/android/app/src/main/java/com/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
1eb87a8a-50dd-4fb3-af7f-b3291688424a
|
||||
1
滴滴淘/ddt_flutter/android/app/src/main/java/com/ddt/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
fafe6770-6654-419a-ac6a-b4e572fe0792
|
||||
@@ -0,0 +1 @@
|
||||
764cf3e5-c1ff-4463-930b-c2036f67ae65
|
||||
@@ -0,0 +1 @@
|
||||
e2970d34-fe99-4b38-919e-d3784e4e5ea1
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ddt.flutter.ddt_flutter;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import io.flutter.embedding.android.FlutterActivity;
|
||||
import io.flutter.embedding.engine.FlutterEngine;
|
||||
import io.flutter.plugins.GeneratedPluginRegistrant;
|
||||
|
||||
public class MainActivity extends FlutterActivity {
|
||||
@Override
|
||||
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
|
||||
GeneratedPluginRegistrant.registerWith(flutterEngine);
|
||||
}
|
||||
}
|
||||
1
滴滴淘/ddt_flutter/android/app/src/main/java/io/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
2b499589-2194-4819-a731-af9dc1bc4024
|
||||
@@ -0,0 +1 @@
|
||||
90c3d273-8d99-45de-a66e-b16c68a746d1
|
||||
@@ -0,0 +1 @@
|
||||
64b0e779-68ae-4f59-b599-93556a986223
|
||||
1
滴滴淘/ddt_flutter/android/app/src/main/res/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
526c70c0-9c64-4e01-b8f6-03288d5f1de4
|
||||
1
滴滴淘/ddt_flutter/android/app/src/main/res/drawable/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
b8d564fc-60cb-4838-a53e-902cbe1f656e
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Modify this file to customize your launch splash screen -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@android:color/white" />
|
||||
|
||||
<!-- You can insert your own image assets here -->
|
||||
<!-- <item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:src="@mipmap/launch_image" />
|
||||
</item> -->
|
||||
</layer-list>
|
||||
@@ -0,0 +1 @@
|
||||
6722e97c-8a3b-456f-92b4-90fc8102345c
|
||||
|
After Width: | Height: | Size: 544 B |
@@ -0,0 +1 @@
|
||||
43b34d00-37c4-4cf1-b01c-e50b5a60f509
|
||||
|
After Width: | Height: | Size: 442 B |
@@ -0,0 +1 @@
|
||||
07a1b96e-4bdd-4211-91f8-1d60ffc4547b
|
||||
|
After Width: | Height: | Size: 721 B |
@@ -0,0 +1 @@
|
||||
ec869fbc-555b-4c8f-bdf8-fdf2c4e31bec
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1 @@
|
||||
82f7656f-03a6-4988-ac0f-064f21f6747d
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
1
滴滴淘/ddt_flutter/android/app/src/main/res/values/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
d004aeec-679a-46dd-8e0d-992853530c6d
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
Flutter draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
</style>
|
||||
</resources>
|
||||
1
滴滴淘/ddt_flutter/android/app/src/profile/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
cef74f17-218d-4171-87d1-a5f9ef5ac7d5
|
||||
@@ -0,0 +1,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.ddt.flutter.ddt_flutter">
|
||||
<!-- Flutter needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
||||
29
滴滴淘/ddt_flutter/android/build.gradle
Normal file
@@ -0,0 +1,29 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.0'
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.buildDir = '../build'
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
4
滴滴淘/ddt_flutter/android/gradle.properties
Normal file
@@ -0,0 +1,4 @@
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
android.enableR8=true
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
1
滴滴淘/ddt_flutter/android/gradle/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
2ef68bab-61dd-4ffc-8d11-29a1e08e571b
|
||||
1
滴滴淘/ddt_flutter/android/gradle/wrapper/.pydio
vendored
Normal file
@@ -0,0 +1 @@
|
||||
62f8ba0c-39c2-4e18-a694-faf8dbda2422
|
||||
6
滴滴淘/ddt_flutter/android/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
#Fri Jun 23 08:50:38 CEST 2017
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
|
||||
15
滴滴淘/ddt_flutter/android/settings.gradle
Normal file
@@ -0,0 +1,15 @@
|
||||
include ':app'
|
||||
|
||||
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
|
||||
|
||||
def plugins = new Properties()
|
||||
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
|
||||
if (pluginsFile.exists()) {
|
||||
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
|
||||
}
|
||||
|
||||
plugins.each { name, path ->
|
||||
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
|
||||
include ":$name"
|
||||
project(":$name").projectDir = pluginDirectory
|
||||
}
|
||||
1
滴滴淘/ddt_flutter/gen/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
f8b4b6f0-acbc-43ec-8a5b-dae0e4469c79
|
||||
1
滴滴淘/ddt_flutter/lib/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
e7dc70dc-c800-458f-a262-fe87e1bcc3a0
|
||||
51
滴滴淘/ddt_flutter/lib/R.dart
Normal file
@@ -0,0 +1,51 @@
|
||||
class R {
|
||||
/// 静态资源配置,程序自动生成,请勿手动修改
|
||||
/// 
|
||||
static final String libStaticImgTsJpg = 'lib/static/img/ts.jpg';
|
||||
/// 
|
||||
static final String libStaticImgHotelPng = 'lib/static/img/hotel.png';
|
||||
/// 
|
||||
static final String libStaticImgTaxiPng = 'lib/static/img/taxi.png';
|
||||
/// 
|
||||
static final String libStaticImgMtJpg = 'lib/static/img/mt.jpg';
|
||||
/// 
|
||||
static final String libStaticImgMbJpg = 'lib/static/img/mb.jpg';
|
||||
/// 
|
||||
static final String libStaticImgWnJpg = 'lib/static/img/wn.jpg';
|
||||
/// 
|
||||
static final String libStaticImgPggJpg = 'lib/static/img/pgg.jpg';
|
||||
/// 
|
||||
static final String libStaticImgYacjPng = 'lib/static/img/yacj.png';
|
||||
/// 
|
||||
static final String libStaticImgSwJpg = 'lib/static/img/sw.jpg';
|
||||
/// 
|
||||
static final String libStaticImgMyjrPng = 'lib/static/img/myjr.png';
|
||||
/// 
|
||||
static final String libStaticImgSwzfPng = 'lib/static/img/swzf.png';
|
||||
/// 
|
||||
static final String libStaticImgShopJpg = 'lib/static/img/shop.jpg';
|
||||
/// 
|
||||
static final String libStaticImgAirplanePng = 'lib/static/img/airplane.png';
|
||||
/// 
|
||||
static final String libStaticImgRyJpg = 'lib/static/img/ry.jpg';
|
||||
/// 
|
||||
static final String libStaticImgHslJpg = 'lib/static/img/hsl.jpg';
|
||||
/// 
|
||||
static final String libStaticImgLogoPng = 'lib/static/img/logo.png';
|
||||
/// 
|
||||
static final String libStaticImgWmzxPng = 'lib/static/img/wmzx.png';
|
||||
/// 
|
||||
static final String libStaticImgSnrqPng = 'lib/static/img/snrq.png';
|
||||
/// 
|
||||
static final String libStaticImgYhJpg = 'lib/static/img/yh.jpg';
|
||||
/// 
|
||||
static final String libStaticImgXkaJpg = 'lib/static/img/xka.jpg';
|
||||
/// 
|
||||
static final String libStaticImgBusPng = 'lib/static/img/bus.png';
|
||||
/// 
|
||||
static final String libStaticImgClassallPng = 'lib/static/img/classall.png';
|
||||
/// 
|
||||
static final String libStaticImgYyJpg = 'lib/static/img/yy.jpg';
|
||||
/// 
|
||||
static final String libStaticImgLlJpg = 'lib/static/img/ll.jpg';
|
||||
}
|
||||
1
滴滴淘/ddt_flutter/lib/common/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
0b03739f-aaf6-4d6d-8363-6fa78ae45389
|
||||
5
滴滴淘/ddt_flutter/lib/common/Application.dart
Executable file
@@ -0,0 +1,5 @@
|
||||
import 'package:event_bus/event_bus.dart';
|
||||
|
||||
class Application {
|
||||
static EventBus eventBus;
|
||||
}
|
||||
1
滴滴淘/ddt_flutter/lib/common/help.md
Executable file
@@ -0,0 +1 @@
|
||||
# 全局公共函数和事件
|
||||
0
滴滴淘/ddt_flutter/lib/common/utils.dart
Normal file
1
滴滴淘/ddt_flutter/lib/config/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
9ed5090f-3c1a-46ba-b640-4cbc40d1dff0
|
||||
1
滴滴淘/ddt_flutter/lib/config/help.md
Executable file
@@ -0,0 +1 @@
|
||||
# App 全局的基本配置
|
||||
68
滴滴淘/ddt_flutter/lib/config/index.dart
Executable file
@@ -0,0 +1,68 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_app/view/components/WebViewWidget.dart';
|
||||
|
||||
class Config {
|
||||
|
||||
// default 默认布局,twoColumn 两栏布局
|
||||
static String indexLayout = "default";
|
||||
|
||||
// 未激活时候底部tabbar 样式
|
||||
static const List<Icon> tabImages = [
|
||||
Icon(Icons.home, size: 25.0, color: Colors.grey,),
|
||||
Icon(Icons.view_quilt, size: 25.0, color: Colors.grey,),
|
||||
Icon(Icons.favorite_border, size: 25.0, color: Colors.grey,),
|
||||
Icon(Icons.person_outline, size: 25.0, color: Colors.grey,),
|
||||
];
|
||||
|
||||
// 激活时候底部tabbar 样式
|
||||
static const List<Icon> tabSelectedImages = [
|
||||
Icon(Icons.home, size: 25.0, color: Colors.orange,),
|
||||
Icon(Icons.view_module, size: 25.0, color: Colors.orange,),
|
||||
Icon(Icons.favorite, size: 25.0, color: Colors.orange,),
|
||||
Icon(Icons.pperson, size: 25.0, color: Colors.orange,),
|
||||
];
|
||||
|
||||
// 默认 白天模式
|
||||
static bool dark = false;
|
||||
// 默认返回 白天模式
|
||||
static ThemeData themeData = getThemeData(dark);
|
||||
static ThemeData themeDataDark = new ThemeData.dark();
|
||||
|
||||
// 返回白天还是黑夜模式
|
||||
static getThemeData(bool dark){
|
||||
if(dark){
|
||||
return themeDataDark;
|
||||
}else{
|
||||
return themeDataLight;
|
||||
}
|
||||
}
|
||||
|
||||
// 默认白天模式的配置
|
||||
static ThemeData themeDataLight = new ThemeData(
|
||||
primarySwatch: Colors.orange,
|
||||
primaryColor: Colors.orange,
|
||||
accentColor: Colors.white,
|
||||
primaryColorBrightness: Brightness.light,
|
||||
);
|
||||
|
||||
// 启动页面配置
|
||||
static const Map Welcome = {
|
||||
"title": "夜色社区",
|
||||
"img": "lib/static/img/logo.png",
|
||||
"waitTime": 4,
|
||||
"loadingText": "Waiting"
|
||||
};
|
||||
|
||||
// 路由配置
|
||||
static final Map<String, WidgetBuilder> routers = {
|
||||
"/about": (_) => new WebViewWidget('https://github.com/helpcode', 'GitHub'),
|
||||
};
|
||||
|
||||
static final publivKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCzkEs/kJgaFGIAM/TQRjzUtJ9v"+
|
||||
"e9enk6heGj/JbcvHVOwFYw2qCNUhuaFE9rYDL+CzX3+cf7inRIJCvSnC0bdGCZ+i"+
|
||||
"943uSudTkqT+guv03jTzvLy2TD+Bp41/ToNiPWG56p1keHE0Gwsr7o0waIcWrLpF"+
|
||||
"JnzyW/fOYQjboRz7nwIDAQAB";
|
||||
|
||||
|
||||
|
||||
}
|
||||
15
滴滴淘/ddt_flutter/lib/config/rsa_private_key.pem
Executable file
@@ -0,0 +1,15 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXAIBAAKBgQCzkEs/kJgaFGIAM/TQRjzUtJ9ve9enk6heGj/JbcvHVOwFYw2q
|
||||
CNUhuaFE9rYDL+CzX3+cf7inRIJCvSnC0bdGCZ+i943uSudTkqT+guv03jTzvLy2
|
||||
TD+Bp41/ToNiPWG56p1keHE0Gwsr7o0waIcWrLpFJnzyW/fOYQjboRz7nwIDAQAB
|
||||
AoGADgMCfDFSTSauBwoG3oG8mXSGxHJLf74b80vlEljJAAL2b+0s0cnip8EOfo0p
|
||||
4tHHnPekw5eL1zGXYJHWQmeO/3ymZS/nnVq1K5YRM+AtYyUMAiChIt/zWOGXPN6k
|
||||
yUARaTK/cRZNY2XPPDK0H44eLF2RDE/SObPD0BZ0u9m92aECQQDYSIrYw0klyGJe
|
||||
ePaV0+2ZtVVhDYN+eYmWHu9/T+aOIPFS5ePUonBftSfcp7pTeJZ3O/eI/4W6pdzz
|
||||
13MRseUZAkEA1ImPvtbL39A8OtciY16LgDX5O5Vkm5p5+TKRhG5B38bgnOQQHu2d
|
||||
oJKvxjEJcWDfiJ6/ThHsFHqyvViJ+cIFdwJBAIWlpe62FdA8F9UK6EzDLXIq5DxZ
|
||||
rmSL06IpMZM5G12+K4EvP26YhdoORjiKiI+l10yMiLRmOQuSDIu9GYTYqZkCQEQ5
|
||||
/Ij4ju3D/PGuif14JjP8H4u/A1LoHeufDhODCWZ6gzQaCgrDoGwhaoemyi85N8i1
|
||||
nRfErRJN6P7bYz9nxzUCQDC8yEIcgKczxFIo20k4R+CINyJTB5S6dsVW6gmpiHZK
|
||||
6+MWkDut4o/Fibwp4jm5Fh9zau597aP5Xnt8mA2LRc8=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
6
滴滴淘/ddt_flutter/lib/config/rsa_public_key.pem
Executable file
@@ -0,0 +1,6 @@
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCzkEs/kJgaFGIAM/TQRjzUtJ9v
|
||||
e9enk6heGj/JbcvHVOwFYw2qCNUhuaFE9rYDL+CzX3+cf7inRIJCvSnC0bdGCZ+i
|
||||
943uSudTkqT+guv03jTzvLy2TD+Bp41/ToNiPWG56p1keHE0Gwsr7o0waIcWrLpF
|
||||
JnzyW/fOYQjboRz7nwIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
1
滴滴淘/ddt_flutter/lib/dev/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
942611d3-0164-477c-9494-5287a340012f
|
||||
91
滴滴淘/ddt_flutter/lib/dev/asset_generator.dart
Executable file
@@ -0,0 +1,91 @@
|
||||
import 'dart:io';
|
||||
|
||||
// ignore: non_constant_identifier_names
|
||||
var preview_server_port = 2227;
|
||||
|
||||
void main() async {
|
||||
bool working = false;
|
||||
var pubSpec = new File('pubspec.yaml');
|
||||
var pubLines = pubSpec.readAsLinesSync();
|
||||
var newLines = <String>[];
|
||||
var resource = <String>[];
|
||||
for (var line in pubLines) {
|
||||
if (line.contains('begin') && line.contains('#') && line.contains('assets')) {
|
||||
working = true;
|
||||
newLines.add(line);
|
||||
}
|
||||
if (line.contains('end') && line.contains('#') && line.contains('assets')) working = false;
|
||||
|
||||
if (working) {
|
||||
if (line.trim().startsWith('#') && line.trim().endsWith('*')) {
|
||||
newLines.add(line);
|
||||
var directory = new Directory(line.replaceAll('#', '').replaceAll('*', '').trim());
|
||||
if (directory.existsSync()) {
|
||||
var list = directory.listSync(recursive: true);
|
||||
resource.add("/// 静态资源配置,程序自动生成,请勿手动修改");
|
||||
for (var file in list) {
|
||||
if (new File(file.path)
|
||||
.statSync()
|
||||
.type == FileSystemEntityType.file) {
|
||||
var path = file.path.replaceAll('\\', '/');
|
||||
var varName = path.replaceAll('/', '_').replaceAll('.', '_').toLowerCase();
|
||||
var pos = 0;
|
||||
String char;
|
||||
while (true) {
|
||||
pos = varName.indexOf('_', pos);
|
||||
if (pos == -1) break;
|
||||
char = varName.substring(pos + 1, pos + 2);
|
||||
varName = varName.replaceFirst('_$char', '_${char.toUpperCase()}');
|
||||
pos++;
|
||||
}
|
||||
varName = varName.replaceAll('_', '');
|
||||
resource.add("/// ");
|
||||
resource.add("static final String $varName = '$path';");
|
||||
newLines.add(' - $path');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new FileSystemException('Directory wrong');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newLines.add(line);
|
||||
}
|
||||
}
|
||||
|
||||
var r = new File('lib/R.dart');
|
||||
if (r.existsSync()) {
|
||||
r.deleteSync();
|
||||
}
|
||||
r.createSync();
|
||||
var content = 'class R {\n';
|
||||
for (var line in resource) {
|
||||
content = '$content $line\n';
|
||||
}
|
||||
content = '$content}\n';
|
||||
r.writeAsStringSync(content);
|
||||
|
||||
var spec = '';
|
||||
for (var line in newLines) {
|
||||
spec = '$spec$line\n';
|
||||
}
|
||||
pubSpec.writeAsStringSync(spec);
|
||||
|
||||
var ser;
|
||||
try {
|
||||
ser = await HttpServer.bind('127.0.0.1', preview_server_port);
|
||||
print('成功启动图片预览服务器于本机<$preview_server_port>端口');
|
||||
ser.listen(
|
||||
(req) {
|
||||
var index = req.uri.path.lastIndexOf('.');
|
||||
var subType = req.uri.path.substring(index);
|
||||
req.response
|
||||
..headers.contentType = new ContentType('image', subType)
|
||||
..add(new File('.${req.uri.path}').readAsBytesSync())
|
||||
..close();
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
print('图片预览服务器已启动或端口被占用');
|
||||
}
|
||||
}
|
||||
1
滴滴淘/ddt_flutter/lib/dev/help.md
Executable file
@@ -0,0 +1 @@
|
||||
# App 开发环境下的一些代码
|
||||
1
滴滴淘/ddt_flutter/lib/event/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
0cbcbc38-50fe-4a58-aa48-e8d658c4fe89
|
||||
1
滴滴淘/ddt_flutter/lib/event/help.md
Executable file
@@ -0,0 +1 @@
|
||||
# 全局事件 事件总线控制,进行页面主体间通讯
|
||||
6
滴滴淘/ddt_flutter/lib/event/indexLayoutChangeEvent.dart
Executable file
@@ -0,0 +1,6 @@
|
||||
// ignore: camel_case_types
|
||||
class indexLayoutChangeEvent {
|
||||
// ignore: non_constant_identifier_names
|
||||
String LayoutStyle;
|
||||
indexLayoutChangeEvent(this.LayoutStyle);
|
||||
}
|
||||
5
滴滴淘/ddt_flutter/lib/event/themeChangeEvent.dart
Executable file
@@ -0,0 +1,5 @@
|
||||
// ignore: camel_case_types
|
||||
class themeChangeEvent {
|
||||
bool dark;
|
||||
themeChangeEvent(this.dark);
|
||||
}
|
||||
1
滴滴淘/ddt_flutter/lib/http/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
6237ef09-050e-435b-85f4-d9966c31c525
|
||||
6
滴滴淘/ddt_flutter/lib/http/config.dart
Executable file
@@ -0,0 +1,6 @@
|
||||
// ignore: camel_case_types
|
||||
class config {
|
||||
static const String BASE_URL = "http://192.168.0.104:3000";
|
||||
//static const String BASE_URL = "https://www.geekhelp.cn";
|
||||
static const String testUrl = "/index";
|
||||
}
|
||||
5
滴滴淘/ddt_flutter/lib/http/help.md
Executable file
@@ -0,0 +1,5 @@
|
||||
# 基于dio的HTTP请求封装
|
||||
|
||||
- 1: config.dart 网络请求的基本配置
|
||||
|
||||
- 2: dio的主体封装
|
||||
89
滴滴淘/ddt_flutter/lib/http/index.dart
Executable file
@@ -0,0 +1,89 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_app/http/config.dart';
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
|
||||
class Http {
|
||||
Dio _dio;
|
||||
|
||||
Http() {
|
||||
this._dio = new Dio(new BaseOptions(
|
||||
baseUrl: config.BASE_URL,
|
||||
connectTimeout: 3000,
|
||||
receiveTimeout: 3000,
|
||||
));
|
||||
|
||||
|
||||
this._dio.interceptors.add(InterceptorsWrapper(
|
||||
onRequest:(RequestOptions options){
|
||||
/// 请求发送前拦截,对 queryParameters 参数进行RSA公钥加密,放到token中发送给后端
|
||||
/// 后端私钥解密,查询数据,然后通过私钥加密数据再返回给前端
|
||||
///options.headers = options.queryParameters;
|
||||
///print(options.headers);
|
||||
return options;
|
||||
},
|
||||
onResponse:(Response response) {
|
||||
/// 响应拦截器,将数据返回给前端之前先使用公钥解密后端的数据,然后将解密后明文给前端
|
||||
// 在返回响应数据之前做一些预处理
|
||||
return response;
|
||||
},
|
||||
onError: (DioError e) {
|
||||
return e;
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
/***
|
||||
* get 请求
|
||||
* url 请求地址
|
||||
* params 请求参数
|
||||
*/
|
||||
get (String url, Object params) async {
|
||||
Response response;
|
||||
try {
|
||||
response = await this._dio.get(url, queryParameters: params);
|
||||
return response.data;
|
||||
} on DioError catch (e) {
|
||||
if (CancelToken.isCancel(e)) {
|
||||
BotToast.showSimpleNotification(
|
||||
title: 'GET请求取消',
|
||||
subTitle: e.message,
|
||||
hideCloseButton: true
|
||||
);
|
||||
}
|
||||
BotToast.showSimpleNotification(
|
||||
title: 'GET请求错误',
|
||||
subTitle: e.message,
|
||||
hideCloseButton: true
|
||||
);
|
||||
print(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
* post 请求
|
||||
* url 请求地址
|
||||
* params 请求参数
|
||||
*/
|
||||
post (String url, Object params) async {
|
||||
Response response;
|
||||
try {
|
||||
response = await this._dio.post(url, data: params);
|
||||
return response.data;
|
||||
} on DioError catch (e) {
|
||||
if (CancelToken.isCancel(e)) {
|
||||
BotToast.showSimpleNotification(
|
||||
title: 'POST请求取消',
|
||||
subTitle: e.message,
|
||||
hideCloseButton: true
|
||||
);
|
||||
}
|
||||
BotToast.showSimpleNotification(
|
||||
title: 'POST请求错误',
|
||||
subTitle: e.message,
|
||||
hideCloseButton: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
54
滴滴淘/ddt_flutter/lib/main.dart
Executable file
@@ -0,0 +1,54 @@
|
||||
import 'package:flutter/material.dart';
|
||||
// 事件总控
|
||||
import 'package:event_bus/event_bus.dart';
|
||||
// shared_preferences 离线数据存储
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
// 主题切换事件
|
||||
import 'package:flutter_app/event/themeChangeEvent.dart';
|
||||
// 全局 event_bus 事件
|
||||
import 'package:flutter_app/common/Application.dart';
|
||||
// 启动欢迎组件
|
||||
import 'package:flutter_app/view/components/WelcomeWidget.dart';
|
||||
// 全局配置类
|
||||
import 'package:flutter_app/config/index.dart';
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
|
||||
// 主入口
|
||||
void main () async {
|
||||
// 获取主题,传递给初 initApp 类
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
runApp(new initApp());
|
||||
}
|
||||
|
||||
// ignore: camel_case_types
|
||||
class initApp extends StatefulWidget {
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => StartApp();
|
||||
}
|
||||
|
||||
class StartApp extends State<initApp> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return new MaterialApp(
|
||||
title: "Flutter App",
|
||||
builder: BotToastInit(), //1. call BotToastInit
|
||||
navigatorObservers: [BotToastNavigatorObserver()],
|
||||
theme: Config.getThemeData(false),
|
||||
home: WelcomeWidget(true),
|
||||
routes: Config.routers,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
Application.eventBus.destroy();
|
||||
}
|
||||
}
|
||||
1
滴滴淘/ddt_flutter/lib/model/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
983f8dc4-232f-4709-9b17-c4279f8f0f14
|
||||
40
滴滴淘/ddt_flutter/lib/model/ImageModel.dart
Executable file
@@ -0,0 +1,40 @@
|
||||
class StyleModel {
|
||||
final int status;
|
||||
final int length;
|
||||
final String copyright;
|
||||
final List<Infos> data;
|
||||
|
||||
StyleModel({ this.status, this.length, this.copyright, this.data });
|
||||
|
||||
factory StyleModel.fromJson(Map<String, dynamic> parsedJson){
|
||||
var list = parsedJson['data'] as List;
|
||||
List<Infos> imageinfo = list.map((i) => Infos.fromJson(i)).toList();
|
||||
return StyleModel(
|
||||
status: parsedJson['status'],
|
||||
length: parsedJson['name'],
|
||||
copyright: parsedJson['copyright'],
|
||||
data: imageinfo,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Infos {
|
||||
final String title;
|
||||
final String imgurl;
|
||||
final String href;
|
||||
final String view;
|
||||
final String comments;
|
||||
|
||||
Infos({ this.title, this.imgurl, this.href, this.view, this.comments });
|
||||
|
||||
factory Infos.fromJson(Map<String, dynamic> parsedJson){
|
||||
return Infos(
|
||||
title: parsedJson['title'] as String,
|
||||
imgurl: parsedJson['imgurl'] as String,
|
||||
href: parsedJson['href'] as String,
|
||||
view: parsedJson['view'] as String,
|
||||
comments: parsedJson['comments'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
44
滴滴淘/ddt_flutter/lib/model/IndexModel.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
class Index {
|
||||
int status;
|
||||
List<Body> body;
|
||||
|
||||
Index({this.status, this.body});
|
||||
|
||||
Index.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
if (json['body'] != null) {
|
||||
body = new List<Body>();
|
||||
json['body'].forEach((v) {
|
||||
body.add(new Body.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['status'] = this.status;
|
||||
if (this.body != null) {
|
||||
data['body'] = this.body.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Body {
|
||||
int id;
|
||||
String text;
|
||||
|
||||
Body({this.id, this.text});
|
||||
|
||||
Body.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
text = json['text'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['text'] = this.text;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
3
滴滴淘/ddt_flutter/lib/model/help.md
Executable file
@@ -0,0 +1,3 @@
|
||||
# JSON数据序列化
|
||||
|
||||
序列化的数据和接口数据返回的格式进行对应
|
||||
1
滴滴淘/ddt_flutter/lib/service/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
f37eb8c2-4099-4d47-9831-8291d72c4472
|
||||
1
滴滴淘/ddt_flutter/lib/service/help.md
Executable file
@@ -0,0 +1 @@
|
||||
# 数据请求的具体方法,和view中页面分开,更好解耦
|
||||
16
滴滴淘/ddt_flutter/lib/service/service.dart
Executable file
@@ -0,0 +1,16 @@
|
||||
import 'package:flutter_app/http/config.dart';
|
||||
import 'package:flutter_app/http/index.dart';
|
||||
import 'package:flutter_app/model/IndexModel.dart';
|
||||
|
||||
class ServiceMethods {
|
||||
Http _http;
|
||||
ServiceMethods() {
|
||||
this._http = new Http();
|
||||
}
|
||||
|
||||
/// 获取视频数据
|
||||
Future getImageList(data) async {
|
||||
return new Index.fromJson(await this._http.get(config.testUrl, data));
|
||||
}
|
||||
|
||||
}
|
||||
1
滴滴淘/ddt_flutter/lib/static/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
3fd47dee-4bcb-496c-9bb9-035c127f379f
|
||||
1
滴滴淘/ddt_flutter/lib/static/Fonts/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
ad709ed6-6be2-4f94-9fe3-b24adc4cc9da
|
||||
BIN
滴滴淘/ddt_flutter/lib/static/Fonts/sspu.ttf
Executable file
1
滴滴淘/ddt_flutter/lib/static/help.md
Executable file
@@ -0,0 +1 @@
|
||||
# App的静态资源
|
||||
1
滴滴淘/ddt_flutter/lib/static/img/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
3dcd5737-edd8-4571-909d-79b89a930d9e
|
||||
BIN
滴滴淘/ddt_flutter/lib/static/img/airplane.png
Executable file
|
After Width: | Height: | Size: 17 KiB |
BIN
滴滴淘/ddt_flutter/lib/static/img/bus.png
Executable file
|
After Width: | Height: | Size: 9.5 KiB |
BIN
滴滴淘/ddt_flutter/lib/static/img/classall.png
Executable file
|
After Width: | Height: | Size: 264 KiB |
BIN
滴滴淘/ddt_flutter/lib/static/img/hotel.png
Executable file
|
After Width: | Height: | Size: 9.5 KiB |
BIN
滴滴淘/ddt_flutter/lib/static/img/hsl.jpg
Executable file
|
After Width: | Height: | Size: 9.3 KiB |
BIN
滴滴淘/ddt_flutter/lib/static/img/ll.jpg
Executable file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
滴滴淘/ddt_flutter/lib/static/img/logo.png
Executable file
|
After Width: | Height: | Size: 17 KiB |
BIN
滴滴淘/ddt_flutter/lib/static/img/mb.jpg
Executable file
|
After Width: | Height: | Size: 10 KiB |
BIN
滴滴淘/ddt_flutter/lib/static/img/mt.jpg
Executable file
|
After Width: | Height: | Size: 9.6 KiB |
BIN
滴滴淘/ddt_flutter/lib/static/img/myjr.png
Executable file
|
After Width: | Height: | Size: 84 KiB |
BIN
滴滴淘/ddt_flutter/lib/static/img/pgg.jpg
Executable file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
滴滴淘/ddt_flutter/lib/static/img/ry.jpg
Executable file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
滴滴淘/ddt_flutter/lib/static/img/shop.jpg
Executable file
|
After Width: | Height: | Size: 182 KiB |
BIN
滴滴淘/ddt_flutter/lib/static/img/snrq.png
Executable file
|
After Width: | Height: | Size: 61 KiB |
BIN
滴滴淘/ddt_flutter/lib/static/img/sw.jpg
Executable file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
滴滴淘/ddt_flutter/lib/static/img/swzf.png
Executable file
|
After Width: | Height: | Size: 66 KiB |
BIN
滴滴淘/ddt_flutter/lib/static/img/taxi.png
Executable file
|
After Width: | Height: | Size: 12 KiB |
BIN
滴滴淘/ddt_flutter/lib/static/img/ts.jpg
Executable file
|
After Width: | Height: | Size: 10 KiB |
BIN
滴滴淘/ddt_flutter/lib/static/img/wmzx.png
Executable file
|
After Width: | Height: | Size: 47 KiB |