├── .gitignore ├── .metadata ├── README.md ├── android ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── flutterdriverapplication │ │ │ │ └── MainActivity.java │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── key.properties └── settings.gradle ├── assets ├── examples │ ├── app-release.apk │ ├── example1.jpg │ ├── example2.jpg │ ├── example3.jpg │ ├── example4.jpg │ ├── example5.jpg │ ├── example6.jpg │ ├── example7.jpg │ └── example8.jpg └── images │ ├── arrow.png │ ├── bank_bg.png │ ├── bankcard.png │ ├── big_arrow.png │ ├── btn_delete_photo.png │ ├── cancle-waybill.jpg │ ├── carte.png │ ├── cashfailure.png │ ├── close.png │ ├── collection.png │ ├── ewm.png │ ├── f.png │ ├── finish.png │ ├── finished.png │ ├── going.png │ ├── join.png │ ├── logo.png │ ├── messages.png │ ├── mobile.png │ ├── oil_card.png │ ├── password.png │ ├── phone.png │ ├── pic.png │ ├── putforward.png │ ├── r.png │ ├── routeLine.png │ ├── safety.png │ ├── splash.png │ ├── trading_account.png │ ├── transaction-r.png │ ├── transaction.png │ ├── transportation.png │ ├── users.png │ ├── waitingLoading.png │ └── z.png ├── ios ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── Runner │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── main.m ├── lib ├── common │ ├── fullScreenWrapper.dart │ ├── service_method.dart │ ├── splash_screen.dart │ └── util.dart ├── components │ ├── city_picker.dart │ ├── date_picker.dart │ ├── progressDialog.dart │ ├── search_bar.dart │ ├── show_modal.dart │ ├── single_picker.dart │ └── toast.dart ├── config │ └── service_url.dart ├── main.dart ├── mode │ ├── bank_card_add_mode.dart │ ├── bank_card_mode.dart │ ├── join_company_list_mode.dart │ ├── main_truck_list_mode.dart │ ├── resource_detail_mode.dart │ ├── resource_list_model.dart │ ├── search_join_company_list.dart │ ├── self_info_mode.dart │ ├── subscribe_line_route_mode.dart │ ├── trailer_truck_mode.dart │ ├── waybill_detail_mode.dart │ └── waybill_list_mode.dart └── pages │ ├── add_bank_card_page.dart │ ├── all_waybill_page.dart │ ├── bank_card_list_page.dart │ ├── bank_card_page.dart │ ├── business_card.dart │ ├── change_password_page.dart │ ├── change_phone_page.dart │ ├── collection_and_delivery_page.dart │ ├── driver_info_page.dart │ ├── find_password.dart │ ├── index_page.dart │ ├── join_company.dart │ ├── login_page.dart │ ├── main_vehicle_page.dart │ ├── manage_bank_card_page.dart │ ├── mine_page.dart │ ├── my_account_page.dart │ ├── my_collect_recode_page.dart │ ├── my_oil_card_page.dart │ ├── raise_cash_page.dart │ ├── register_page.dart │ ├── resource_detail_page.dart │ ├── resource_page.dart │ ├── search_page.dart │ ├── security_setting_page.dart │ ├── subscribe_line_route_page.dart │ ├── trade_record_detail_page.dart │ ├── trade_record_page.dart │ ├── trailer_page.dart │ ├── waybill_detail_page.dart │ └── waybill_page.dart ├── pubspec.lock ├── pubspec.yaml └── test └── widget_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # Visual Studio Code related 19 | .vscode/ 20 | 21 | # Flutter/Dart/Pub related 22 | **/doc/api/ 23 | .dart_tool/ 24 | .flutter-plugins 25 | .packages 26 | .pub-cache/ 27 | .pub/ 28 | build/ 29 | 30 | # Android related 31 | **/android/**/gradle-wrapper.jar 32 | **/android/.gradle 33 | **/android/captures/ 34 | **/android/gradlew 35 | **/android/gradlew.bat 36 | **/android/local.properties 37 | **/android/**/GeneratedPluginRegistrant.java 38 | 39 | # iOS/XCode related 40 | **/ios/**/*.mode1v3 41 | **/ios/**/*.mode2v3 42 | **/ios/**/*.moved-aside 43 | **/ios/**/*.pbxuser 44 | **/ios/**/*.perspectivev3 45 | **/ios/**/*sync/ 46 | **/ios/**/.sconsign.dblite 47 | **/ios/**/.tags* 48 | **/ios/**/.vagrant/ 49 | **/ios/**/DerivedData/ 50 | **/ios/**/Icon? 51 | **/ios/**/Pods/ 52 | **/ios/**/.symlinks/ 53 | **/ios/**/profile 54 | **/ios/**/xcuserdata 55 | **/ios/.generated/ 56 | **/ios/Flutter/App.framework 57 | **/ios/Flutter/Flutter.framework 58 | **/ios/Flutter/Generated.xcconfig 59 | **/ios/Flutter/app.flx 60 | **/ios/Flutter/app.zip 61 | **/ios/Flutter/flutter_assets/ 62 | **/ios/ServiceDefinitions.json 63 | **/ios/Runner/GeneratedPluginRegistrant.* 64 | 65 | # Exceptions to above rules. 66 | !**/ios/**/default.mode1v3 67 | !**/ios/**/default.mode2v3 68 | !**/ios/**/default.pbxuser 69 | !**/ios/**/default.perspectivev3 70 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 71 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 06b979c4d5e1b499745422269f01a00341257058 8 | channel: dev 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flutter_driver_application 2 | 3 | 使用flutter 仿写司机端app项目 4 | 5 | ## 项目部分页面截图 6 |
7 | 8 |


9 |
10 | 11 |


12 |
13 | 14 |


15 |
16 | 17 |


18 |
19 | 20 |


21 |
22 | 23 |


24 |
25 | 26 |


27 |
28 | 29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | def keystorePropertiesFile = rootProject.file("key.properties") 27 | def keystoreProperties = new Properties() 28 | keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) 29 | 30 | android { 31 | compileSdkVersion 28 32 | 33 | lintOptions { 34 | disable 'InvalidPackage' 35 | } 36 | 37 | defaultConfig { 38 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 39 | applicationId "com.example.flutterdriverapplication" 40 | minSdkVersion 16 41 | targetSdkVersion 28 42 | versionCode flutterVersionCode.toInteger() 43 | versionName flutterVersionName 44 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 45 | manifestPlaceholders = [ 46 | AMAP_KEY : "1fec9b6d232479e4ab5a29725b7f52ae", /// 高德地图key 47 | ] 48 | } 49 | signingConfigs { 50 | release { 51 | keyAlias keystoreProperties['keyAlias'] 52 | keyPassword keystoreProperties['keyPassword'] 53 | storeFile file(keystoreProperties['storeFile']) 54 | storePassword keystoreProperties['storePassword'] 55 | } 56 | } 57 | buildTypes { 58 | release { 59 | signingConfig signingConfigs.release 60 | } 61 | } 62 | } 63 | 64 | flutter { 65 | source '../..' 66 | } 67 | 68 | dependencies { 69 | implementation 'com.amap.api:location:latest.integration' 70 | testImplementation 'junit:junit:4.12' 71 | androidTestImplementation 'androidx.test:runner:1.1.1' 72 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 73 | } 74 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 8 | 13 | 17 | 24 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/example/flutterdriverapplication/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.flutterdriverapplication; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.3.0' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableJetifier=true 3 | android.useAndroidX=true -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /android/key.properties: -------------------------------------------------------------------------------- 1 | storePassword=mayangyang 2 | keyPassword=mayangyang 3 | keyAlias=key 4 | storeFile=D:/key.jks -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /assets/examples/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/examples/app-release.apk -------------------------------------------------------------------------------- /assets/examples/example1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/examples/example1.jpg -------------------------------------------------------------------------------- /assets/examples/example2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/examples/example2.jpg -------------------------------------------------------------------------------- /assets/examples/example3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/examples/example3.jpg -------------------------------------------------------------------------------- /assets/examples/example4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/examples/example4.jpg -------------------------------------------------------------------------------- /assets/examples/example5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/examples/example5.jpg -------------------------------------------------------------------------------- /assets/examples/example6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/examples/example6.jpg -------------------------------------------------------------------------------- /assets/examples/example7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/examples/example7.jpg -------------------------------------------------------------------------------- /assets/examples/example8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/examples/example8.jpg -------------------------------------------------------------------------------- /assets/images/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/arrow.png -------------------------------------------------------------------------------- /assets/images/bank_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/bank_bg.png -------------------------------------------------------------------------------- /assets/images/bankcard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/bankcard.png -------------------------------------------------------------------------------- /assets/images/big_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/big_arrow.png -------------------------------------------------------------------------------- /assets/images/btn_delete_photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/btn_delete_photo.png -------------------------------------------------------------------------------- /assets/images/cancle-waybill.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/cancle-waybill.jpg -------------------------------------------------------------------------------- /assets/images/carte.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/carte.png -------------------------------------------------------------------------------- /assets/images/cashfailure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/cashfailure.png -------------------------------------------------------------------------------- /assets/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/close.png -------------------------------------------------------------------------------- /assets/images/collection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/collection.png -------------------------------------------------------------------------------- /assets/images/ewm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/ewm.png -------------------------------------------------------------------------------- /assets/images/f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/f.png -------------------------------------------------------------------------------- /assets/images/finish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/finish.png -------------------------------------------------------------------------------- /assets/images/finished.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/finished.png -------------------------------------------------------------------------------- /assets/images/going.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/going.png -------------------------------------------------------------------------------- /assets/images/join.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/join.png -------------------------------------------------------------------------------- /assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/logo.png -------------------------------------------------------------------------------- /assets/images/messages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/messages.png -------------------------------------------------------------------------------- /assets/images/mobile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/mobile.png -------------------------------------------------------------------------------- /assets/images/oil_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/oil_card.png -------------------------------------------------------------------------------- /assets/images/password.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/password.png -------------------------------------------------------------------------------- /assets/images/phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/phone.png -------------------------------------------------------------------------------- /assets/images/pic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/pic.png -------------------------------------------------------------------------------- /assets/images/putforward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/putforward.png -------------------------------------------------------------------------------- /assets/images/r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/r.png -------------------------------------------------------------------------------- /assets/images/routeLine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/routeLine.png -------------------------------------------------------------------------------- /assets/images/safety.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/safety.png -------------------------------------------------------------------------------- /assets/images/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/splash.png -------------------------------------------------------------------------------- /assets/images/trading_account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/trading_account.png -------------------------------------------------------------------------------- /assets/images/transaction-r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/transaction-r.png -------------------------------------------------------------------------------- /assets/images/transaction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/transaction.png -------------------------------------------------------------------------------- /assets/images/transportation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/transportation.png -------------------------------------------------------------------------------- /assets/images/users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/users.png -------------------------------------------------------------------------------- /assets/images/waitingLoading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/waitingLoading.png -------------------------------------------------------------------------------- /assets/images/z.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/assets/images/z.png -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayangyang1/flutter_driver_application/89f27f1ed8cd36dd185102c1156a640cfc87bab5/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutter_driver_application 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/common/fullScreenWrapper.dart: -------------------------------------------------------------------------------- 1 | import 'package:photo_view/photo_view.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class FullScreenWrapper extends StatelessWidget { 5 | const FullScreenWrapper( 6 | {this.imageProvider, 7 | this.loadingChild, 8 | this.backgroundDecoration, 9 | this.minScale, 10 | this.maxScale, 11 | this.initialScale, 12 | this.basePosition = Alignment.center}); 13 | 14 | final ImageProvider imageProvider; 15 | final Widget loadingChild; 16 | final Decoration backgroundDecoration; 17 | final dynamic minScale; 18 | final dynamic maxScale; 19 | final dynamic initialScale; 20 | final Alignment basePosition; 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return Container( 25 | constraints: BoxConstraints.expand( 26 | height: MediaQuery.of(context).size.height, 27 | ), 28 | child: PhotoView( 29 | imageProvider: imageProvider, 30 | loadingChild: loadingChild, 31 | backgroundDecoration: backgroundDecoration, 32 | minScale: minScale, 33 | maxScale: maxScale, 34 | initialScale: initialScale, 35 | basePosition: basePosition, 36 | )); 37 | } 38 | } -------------------------------------------------------------------------------- /lib/common/service_method.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'dart:async'; 3 | import 'dart:io'; 4 | import '../config/service_url.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:shared_preferences/shared_preferences.dart'; 7 | import '../components/toast.dart'; 8 | 9 | Future getAjax(url, stringParams, context) async{ 10 | SharedPreferences prefs = await SharedPreferences.getInstance(); 11 | String cookies = 'JSESSIONID=${prefs.get('cookies')}'; 12 | try { 13 | Response response; 14 | Dio dio = new Dio(); 15 | String reqUrl; 16 | dio.options.baseUrl = serviceUrl; 17 | dio.options.contentType = ContentType.parse("application/x-www-form-urlencoded"); 18 | dio.options.headers['Cookie'] = cookies; 19 | if(stringParams == ''){ 20 | reqUrl = servicePath[url]; 21 | }else{ 22 | reqUrl = servicePath[url] + stringParams; 23 | } 24 | print(reqUrl); 25 | response = await dio.get(reqUrl); 26 | print(response); 27 | if(response.data == null || response.data == ''){ 28 | return null; 29 | } 30 | if(response.data['code'] == 500) { 31 | Future.delayed(Duration(milliseconds: 10),(){ 32 | Toast.toast(context, response.data['content']); 33 | }); 34 | }else if(response.data['code'] == 401) { 35 | Navigator.pushNamedAndRemoveUntil(context, '/login', (route)=>false); 36 | }else { 37 | return response.data; 38 | } 39 | }on DioError catch (e) { 40 | if (e.response != null && e.response.data['code'] == 401) { 41 | Navigator.pushNamedAndRemoveUntil(context, '/login', (route)=>false); 42 | } 43 | } 44 | } 45 | 46 | Future postAjax(String url, Mapparams, BuildContext context) async { 47 | SharedPreferences prefs = await SharedPreferences.getInstance(); 48 | String cookies = 'JSESSIONID=' + prefs.get('cookies'); 49 | try { 50 | print('获取数据'); 51 | print(url); 52 | print(params); 53 | Response response; 54 | Dio dio = new Dio(); 55 | dio.options.baseUrl = serviceUrl; 56 | dio.options.contentType = ContentType.parse("application/x-www-form-urlencoded"); 57 | dio.options.headers['Cookie'] = cookies; 58 | response = await dio.post(servicePath[url], data:params); 59 | if(response.data == null || response.data == ''){ 60 | return null; 61 | } 62 | if(response.data['code'] == 500) { 63 | Future.delayed(Duration(milliseconds: 10),(){ 64 | Toast.toast(context, response.data['content']); 65 | }); 66 | }else if(response.data['code'] == 401) { 67 | Navigator.pushNamedAndRemoveUntil(context, '/login', (route)=>false); 68 | }else{ 69 | return response.data; 70 | } 71 | 72 | } on DioError catch (e) { 73 | if (e.response != null && e.response.data['code'] == 401) { 74 | Navigator.pushNamedAndRemoveUntil(context, '/login', (route)=>false); 75 | } 76 | } 77 | } 78 | 79 | Future getAjaxStr(url, stringParams, context) async{ 80 | SharedPreferences prefs = await SharedPreferences.getInstance(); 81 | String cookies = 'JSESSIONID=' + prefs.get('cookies'); 82 | try { 83 | Response response; 84 | Dio dio = new Dio(); 85 | String reqUrl; 86 | dio.options.baseUrl = serviceUrl; 87 | dio.options.contentType = ContentType.parse("application/x-www-form-urlencoded"); 88 | dio.options.headers['Cookie'] = cookies; 89 | if(stringParams == ''){ 90 | reqUrl = url; 91 | }else{ 92 | reqUrl = url + stringParams; 93 | } 94 | print(reqUrl); 95 | response = await dio.get(reqUrl); 96 | print(response.data); 97 | if(response.data == null || response.data == ''){ 98 | return null; 99 | } 100 | if(response.data['code'] == 500) { 101 | Future.delayed(Duration(milliseconds: 10),(){ 102 | Toast.toast(context, response.data['content']); 103 | }); 104 | }else if(response.data['code'] == 401) { 105 | Navigator.pushNamedAndRemoveUntil(context, '/login', (route)=>false); 106 | }else{ 107 | return response.data; 108 | } 109 | 110 | 111 | }on DioError catch (e) { 112 | if (e.response.data['code'] == 401) { 113 | Navigator.pushNamedAndRemoveUntil(context, '/login', (route)=>false); 114 | } 115 | } 116 | } 117 | 118 | Future postAjaxStr(url, params, context) async { 119 | SharedPreferences prefs = await SharedPreferences.getInstance(); 120 | String cookies = 'JSESSIONID=' + prefs.get('cookies'); 121 | try { 122 | Response response; 123 | Dio dio = new Dio(); 124 | dio.options.baseUrl = serviceUrl; 125 | dio.options.contentType = ContentType.parse("application/x-www-form-urlencoded"); 126 | dio.options.headers['Cookie'] = cookies; 127 | response = await dio.post(url, data:params); 128 | if(response.data == null || response.data == ''){ 129 | return null; 130 | } 131 | if(response.data['code'] == 500) { 132 | Future.delayed(Duration(milliseconds: 10),(){ 133 | Toast.toast(context, response.data['content']); 134 | }); 135 | }else if(response.data['code'] == 401) { 136 | Navigator.pushNamedAndRemoveUntil(context, '/login', (route)=>false); 137 | }else{ 138 | return response.data; 139 | } 140 | 141 | } on DioError catch (e) { 142 | if (e.response != null && e.response.data['code'] == 401) { 143 | Navigator.pushNamedAndRemoveUntil(context, '/login', (route)=>false); 144 | } 145 | } 146 | } 147 | 148 | Future uploaFile(url, FormData formData, context) async { 149 | SharedPreferences prefs = await SharedPreferences.getInstance(); 150 | String cookies = 'JSESSIONID=' + prefs.get('cookies'); 151 | try { 152 | Response response; 153 | Dio dio = new Dio(); 154 | dio.options.baseUrl = serviceUrl; 155 | dio.options.contentType = ContentType.parse("application/x-www-form-urlencoded"); 156 | dio.options.headers['Cookie'] = cookies; 157 | response = await dio.post(servicePath[url], data:formData); 158 | if(response.data == null || response.data == ''){ 159 | return null; 160 | } 161 | if(response.data['code'] == 500) { 162 | Future.delayed(Duration(milliseconds: 10),(){ 163 | Toast.toast(context, response.data['content']); 164 | }); 165 | }else if(response.data['code'] == 401) { 166 | Navigator.pushNamedAndRemoveUntil(context, '/login', (route)=>false); 167 | }else{ 168 | return response.data; 169 | } 170 | 171 | } on DioError catch (e) { 172 | if (e.response != null && e.response.data['code'] == 401) { 173 | Navigator.pushNamedAndRemoveUntil(context, '/login', (route)=>false); 174 | } 175 | } 176 | } 177 | 178 | -------------------------------------------------------------------------------- /lib/common/splash_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../pages/index_page.dart'; 3 | 4 | class SplashScreen extends StatefulWidget { 5 | _SplashScreenState createState() => _SplashScreenState(); 6 | } 7 | 8 | class _SplashScreenState extends State with SingleTickerProviderStateMixin { 9 | 10 | AnimationController _controller; 11 | Animation _animation; 12 | 13 | void initState() { 14 | super.initState(); 15 | _controller = AnimationController(vsync:this,duration:Duration(milliseconds:3000)); 16 | _animation = Tween(begin: 0.0,end:1.0).animate(_controller); 17 | 18 | 19 | 20 | //播放动画 21 | _controller.forward(); 22 | /*动画事件监听器, 23 | 它可以监听到动画的执行状态, 24 | 我们这里只监听动画是否结束, 25 | 如果结束则执行页面跳转动作。 */ 26 | _animation.addStatusListener((status){ 27 | if(status == AnimationStatus.completed){ 28 | Navigator.of(context).pushAndRemoveUntil( 29 | MaterialPageRoute(builder: (context)=>IndexPage()), 30 | (route)=> route==null); 31 | } 32 | }); 33 | 34 | } 35 | 36 | @override 37 | void dispose() { 38 | _controller.dispose(); 39 | super.dispose(); 40 | } 41 | 42 | 43 | @override 44 | Widget build(BuildContext context) { 45 | return FadeTransition( //透明度动画组件 46 | opacity: _animation, //执行动画 47 | child: Image.asset( //网络图片 48 | 'assets/images/splash.png', 49 | scale: 2.0, //进行缩放 50 | fit:BoxFit.cover // 充满父容器 51 | ), 52 | ); 53 | } 54 | } -------------------------------------------------------------------------------- /lib/common/util.dart: -------------------------------------------------------------------------------- 1 | 2 | getCookieAndSaveInStorage (res){ 3 | String cookies; 4 | var cookiestr = res.headers['set-cookie'][0]; 5 | List cookiesarr = cookiestr.split(';'); 6 | print('cookiestr'); 7 | print(cookiesarr); 8 | cookiesarr.forEach((item){ 9 | if(item.indexOf('JSESSIONID') != -1){ 10 | var itemar = item.split('='); 11 | cookies = itemar[itemar.length - 1]; 12 | 13 | } 14 | }); 15 | return cookies; 16 | } 17 | Map licensePlate = { 18 | '01': '大型汽车号牌', 19 | '02': '小型汽车号牌', 20 | '99': '其他号牌' 21 | }; 22 | Map truckModel = { 23 | 'H01': '普通货车', 24 | 'H02': '厢式货车', 25 | 'H04': '罐式货车', 26 | 'Q00': '牵引车', 27 | 'G01': '普通挂车', 28 | 'G03': '罐式挂车', 29 | 'G05': '集装箱挂车', 30 | 'H09': '仓栅式货车', 31 | 'H03': '封闭货车', 32 | 'H05': '平板货车', 33 | 'H06': '集装箱车', 34 | 'H07': '自卸货车', 35 | 'H08': '特殊结构货车', 36 | 'Z00': '专项作业车', 37 | 'G02': '厢式挂车', 38 | 'G07': '仓栅式挂车', 39 | 'G04': '平板挂车', 40 | 'G06': '自卸挂车', 41 | 'G09': '专项作业挂车', 42 | 'X91': '车辆运输车', 43 | 'X92': '车辆运输车(单排)' 44 | }; 45 | 46 | Map gender = { 47 | 'male': '男', 48 | 'female': '女' 49 | }; 50 | Map freightStatus = { 51 | 'pushling': '发布中', 52 | 'received': '已接单', 53 | 'finished': '已结束' 54 | }; 55 | Map driverAcceptStatus = { 56 | 'undispatched': '待派车', 57 | 'dispatched': '已派车', 58 | 'ignored': '已忽略' 59 | }; 60 | 61 | Map waybillStatus = { 62 | 'unloading': '待装货', 63 | 'going': '运输中', 64 | 'finish': '运输完成', 65 | 'cancel': '运单取消' 66 | }; 67 | Map powerTypeMap = { 68 | 'gas': '气车', 69 | 'oil': '油车' 70 | }; 71 | 72 | Map unit = { 73 | 'cube': { 74 | 'carrier.price': { 75 | 'yuanpersquare': '元/方', 76 | 'yuanpertruck': '元/车', 77 | }, 78 | 'driver.price': { 79 | 'yuanpercube': '元/方', 80 | 'yuanpertruck': '元/车', 81 | }, 82 | 'goods.loss': { 83 | 'cube': '方/车' 84 | }, 85 | 'goods.price': { 86 | 'yuanpercube': '元/方' 87 | }, 88 | 'goods.volume': { 89 | 'cube': '方' 90 | }, 91 | 'settle.volume.unit': { 92 | 'cube': '方' 93 | }, 94 | 'truck.cubage': { 95 | 'cube': '方' 96 | } 97 | }, 98 | 'day': { 99 | 'route.duration': { 100 | 'day': '天' 101 | } 102 | }, 103 | 'hour': { 104 | 'route.duration': { 105 | 'hour': '小时' 106 | } 107 | }, 108 | 'item': { 109 | 'carrier.price': { 110 | 'yuanperitem': '元/件', 111 | 'yuanpertruck': '元/车' 112 | }, 113 | 'driver.price': { 114 | 'yuanperitem': '元/件', 115 | 'yuanpertruck': '元/车' 116 | }, 117 | 'goods.loss': { 118 | 'item': '件/车' 119 | }, 120 | 'goods.number': { 121 | 'item': '件' 122 | }, 123 | 'goods.price': { 124 | 'yuanperitem': '元/件' 125 | }, 126 | 'settle.volume.unit': { 127 | 'item': '件' 128 | } 129 | }, 130 | 'km': { 131 | 'mileage.number': { 132 | 'km': '公里' 133 | }, 134 | 'standard.distance': { 135 | 'km': '公里' 136 | } 137 | }, 138 | 'liang': { 139 | 'truckqty.number': { 140 | 'liang': '辆' 141 | } 142 | }, 143 | 'meter': { 144 | 'truck.size': { 145 | 'meter': '米' 146 | } 147 | }, 148 | 'millimetre': { 149 | 'truck.size': { 150 | 'millimetre': '毫米' 151 | } 152 | }, 153 | 'mm': { 154 | 'tyrewrinkles.number': { 155 | 'mm': '毫米' 156 | } 157 | }, 158 | 'percent': { 159 | 'goods.loss.ration': { 160 | 'percent': '%' 161 | } 162 | }, 163 | 'ton': { 164 | 'carrier.price': { 165 | 'yuanperton': '元/吨', 166 | 'yuanpertruck': '元/车' 167 | }, 168 | 'driver.price': { 169 | 'yuanperton': '元/吨', 170 | 'yuanpertruck': '元/车' 171 | }, 172 | 'goods.loss': { 173 | 'ton': '吨/车' 174 | }, 175 | 'goods.price': { 176 | 'yuanperton': '元/吨' 177 | }, 178 | 'goods.weight': { 179 | 'ton': '吨' 180 | }, 181 | 'settle.volume.unit': { 182 | 'ton': '吨' 183 | }, 184 | 'truck.carry': { 185 | 'ton': '吨' 186 | }, 187 | }, 188 | 'yuan': { 189 | 'price.unit': { 190 | 'yuan': '元' 191 | } 192 | } 193 | }; 194 | 195 | List carTypes = ["请选择","A1", "A2", "A3", "B1", "B2", "C1", "C2"]; 196 | 197 | const List attachList = ['cardFront', 'cardAfter', 'driverOne', 'driverTwo', 'qualificationCertificateResourceCodeOne', 'qualificationCertificateResourceCodeTwo']; 198 | Map attachments = { 199 | 'cardFront': { 'name': '身份证正面', 'value': 'assets/images/pic.png', 'status': 'hidden', 'resourceCode': '' }, 200 | 'cardAfter': { 'name': '身份证反面', 'value': 'assets/images/pic.png', 'status': 'hidden', 'resourceCode': '' }, 201 | 'driverOne': { 'name': '驾驶证第一联照片', 'value': 'assets/images/pic.png', 'status': 'hidden', 'resourceCode': '' }, 202 | 'driverTwo': { 'name': '驾驶证第二联照片', 'value': 'assets/images/pic.png', 'status': 'hidden', 'resourceCode': '' }, 203 | 'qualificationCertificateResourceCodeOne': { 'name': '从业资格证照片一', 'value': 'assets/images/pic.png', 'status': 'hidden', 'resourceCode': '' }, 204 | 'qualificationCertificateResourceCodeTwo': { 'name': '从业资格证照片二', 'value': 'assets/images/pic.png', 'status': 'hidden', 'resourceCode': '' }, 205 | }; 206 | 207 | -------------------------------------------------------------------------------- /lib/components/progressDialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ProgressDialog extends StatelessWidget { 4 | //子布局 5 | final Widget child; 6 | 7 | //加载中是否显示 8 | final bool loading; 9 | 10 | //进度提醒内容 11 | final String msg; 12 | 13 | //加载中动画 14 | final Widget progress; 15 | 16 | //背景透明度 17 | final double alpha; 18 | 19 | //字体颜色 20 | final Color textColor; 21 | 22 | ProgressDialog( 23 | {Key key, 24 | @required this.loading, 25 | this.msg, 26 | this.progress = const CircularProgressIndicator(), 27 | this.alpha = 0.3, 28 | this.textColor = Colors.white, 29 | @required this.child}) 30 | : assert(child != null), 31 | assert(loading != null), 32 | super(key: key); 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | List widgetList = []; 37 | widgetList.add(child); 38 | if (loading) { 39 | Widget layoutProgress; 40 | if (msg == null) { 41 | layoutProgress = Center( 42 | child: progress, 43 | ); 44 | } else { 45 | layoutProgress = Center( 46 | child: Container( 47 | padding: const EdgeInsets.all(20.0), 48 | decoration: BoxDecoration( 49 | color: Colors.black87, 50 | borderRadius: BorderRadius.circular(4.0)), 51 | child: Column( 52 | mainAxisAlignment: MainAxisAlignment.center, 53 | crossAxisAlignment: CrossAxisAlignment.center, 54 | mainAxisSize: MainAxisSize.min, 55 | children: [ 56 | progress, 57 | Container( 58 | padding: const EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0), 59 | child: Text( 60 | msg, 61 | style: TextStyle(color: textColor, fontSize: 16.0), 62 | ), 63 | ) 64 | ], 65 | ), 66 | ), 67 | ); 68 | } 69 | widgetList.add(Opacity( 70 | opacity: alpha, 71 | child: new ModalBarrier(color: Colors.black87), 72 | )); 73 | widgetList.add(layoutProgress); 74 | } 75 | return Stack( 76 | children: widgetList, 77 | ); 78 | } 79 | } -------------------------------------------------------------------------------- /lib/components/search_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import './single_picker.dart'; 3 | import '../pages/search_page.dart'; 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 5 | 6 | Widget searchBar(BuildContext context, List singlePickerList, int index, Function searchChange, Function change) { 7 | return Container( 8 | height: ScreenUtil().setHeight(120), 9 | padding: EdgeInsets.all(10.0), 10 | decoration: BoxDecoration( 11 | border: Border(bottom: BorderSide(width: 1.0,color: Colors.black26)), 12 | color: Colors.black12, 13 | ), 14 | child: Row( 15 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 16 | children: [ 17 | Expanded( 18 | flex: 1, 19 | child: InkWell( 20 | child: Container( 21 | height: ScreenUtil().setHeight(75), 22 | padding: EdgeInsets.only(left: 10.0), 23 | decoration: BoxDecoration( 24 | borderRadius: BorderRadius.circular(5.0), 25 | color: Colors.white 26 | ), 27 | child: Row( 28 | mainAxisAlignment: MainAxisAlignment.start, 29 | crossAxisAlignment: CrossAxisAlignment.center, 30 | children: [ 31 | Icon(Icons.search), 32 | Text('搜索',style: TextStyle(fontSize: ScreenUtil().setSp(28)),) 33 | ], 34 | ), 35 | 36 | ), 37 | onTap: (){ 38 | Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){ 39 | return SearchMessage(success: (val){ 40 | searchChange(val); 41 | },); 42 | })); 43 | }, 44 | ) 45 | ), 46 | Container( 47 | margin:EdgeInsets.only(left: 10.0), 48 | width: ScreenUtil().setWidth(180), 49 | height: ScreenUtil().setHeight(75), 50 | decoration: BoxDecoration( 51 | color: Colors.white, 52 | borderRadius: BorderRadius.circular(5.0) 53 | ), 54 | child: InkWell( 55 | child: Row( 56 | mainAxisAlignment: MainAxisAlignment.spaceAround, 57 | children: [ 58 | Text(singlePickerList[index]['key'], style: TextStyle(fontSize: ScreenUtil().setSp(26)),), 59 | Icon(Icons.arrow_drop_down) 60 | ], 61 | ), 62 | onTap: (){ 63 | singlePicker(context, singlePickerList, index,(res){ 64 | if(res['key'] == 'confirm') { 65 | change(res); 66 | }else if(res['key'] == 'cancel') { 67 | change(res); 68 | } 69 | }); 70 | }, 71 | ) 72 | ) 73 | 74 | ], 75 | ), 76 | ); 77 | } 78 | -------------------------------------------------------------------------------- /lib/components/show_modal.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | showMyCupertinoDialog(BuildContext context, String title, String content, Function success) { 5 | showCupertinoDialog( 6 | context: context, 7 | builder: (context) { 8 | return new CupertinoAlertDialog( 9 | title: new Text(title), 10 | content: Padding(child: Text(content),padding: EdgeInsets.only(top: 10),), 11 | actions: [ 12 | new FlatButton( 13 | onPressed: () { 14 | Navigator.of(context).pop("点击了取消"); 15 | success('cancel'); 16 | }, 17 | child: new Text("取消"), 18 | ), 19 | new FlatButton( 20 | onPressed: () { 21 | Navigator.of(context).pop("点击了确定"); 22 | success('confirm'); 23 | }, 24 | child: new Text("确认"), 25 | ), 26 | ], 27 | ); 28 | }); 29 | } -------------------------------------------------------------------------------- /lib/components/single_picker.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 | 5 | singlePicker(BuildContext context, List singlePickerList, int _index, Function success) { 6 | return showCupertinoModalPopup( 7 | context: context, 8 | builder: (BuildContext context) { 9 | return CommonPicker(singlePickerList: singlePickerList, index:_index, success: success,); 10 | }, 11 | ); 12 | } 13 | 14 | class CommonPicker extends StatefulWidget { 15 | final List singlePickerList; 16 | final Function success; 17 | final int index; 18 | CommonPicker({Key key, this.singlePickerList, this.index, this.success}) : super(key: key); 19 | 20 | _CommonPickerState createState() => _CommonPickerState(); 21 | } 22 | 23 | class _CommonPickerState extends State { 24 | FixedExtentScrollController siglePickerController = FixedExtentScrollController(); //单选框控制器 25 | int value = 0; 26 | @override 27 | void initState() { 28 | value = widget.index; 29 | Future.delayed(Duration(milliseconds: 10), (){ 30 | siglePickerController.jumpToItem(widget.index); 31 | }); 32 | 33 | super.initState(); 34 | } 35 | @override 36 | Widget build(BuildContext context) { 37 | return Container( 38 | height: ScreenUtil().setHeight(640), 39 | child: DefaultTextStyle( 40 | style: TextStyle( 41 | fontSize: ScreenUtil().setSp(36), 42 | color: Color(0xFF454545) 43 | ), 44 | child: Column( 45 | children: [ 46 | Expanded( 47 | flex: 1, 48 | child: Container( 49 | color: Colors.white, 50 | padding: EdgeInsets.all(6.0), 51 | child: Row( 52 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 53 | children: [ 54 | FlatButton ( 55 | child: Text('取消',style: TextStyle(fontSize: ScreenUtil().setSp(36)),), 56 | onPressed: (){ 57 | Navigator.of(context).pop('取消'); 58 | Map res = {'key': 'cancel', 'value': value}; 59 | widget.success(res); 60 | }, 61 | ), 62 | FlatButton ( 63 | child: Text('确认',style: TextStyle(fontSize: ScreenUtil().setSp(36))), 64 | onPressed: (){ 65 | Navigator.of(context).pop('确认'); 66 | Map res = {'key': 'confirm', 'value': value}; 67 | widget.success(res); 68 | }, 69 | ) 70 | ], 71 | ), 72 | ) 73 | ), 74 | Expanded( 75 | flex:5, 76 | child: Row( 77 | children: [ 78 | Expanded( 79 | child: commonPicker(widget.singlePickerList), 80 | ), 81 | ], 82 | ) 83 | ) 84 | ], 85 | ) 86 | ) 87 | ); 88 | } 89 | 90 | Widget commonPicker(List singlePickerList) { 91 | return CupertinoPicker( 92 | children: singlePickerList.length > 0 93 | ? singlePickerList.map((v){ 94 | return Padding(child: Text(v['key']),padding: EdgeInsets.only(top: 6)); 95 | }).toList() 96 | : [Padding(child: Text('暂无数据',),padding: EdgeInsets.only(top: 6),)], 97 | itemExtent: 36.0, 98 | backgroundColor: Colors.white, 99 | diameterRatio: 40.0, 100 | offAxisFraction: 1.0, 101 | scrollController: siglePickerController, 102 | onSelectedItemChanged: (index){ 103 | setState(() { 104 | value = index; 105 | }); 106 | }, 107 | ); 108 | } 109 | } 110 | 111 | -------------------------------------------------------------------------------- /lib/components/toast.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class Toast { 4 | static OverlayEntry _overlayEntry; //toast靠它加到屏幕上 5 | static bool _showing = false; //toast是否正在showing 6 | static DateTime _startedTime; //开启一个新toast的当前时间,用于对比是否已经展示了足够时间 7 | static String _msg; 8 | static void toast( 9 | BuildContext context, 10 | String msg, 11 | ) async { 12 | assert(msg != null); 13 | _msg = msg; 14 | _startedTime = DateTime.now(); 15 | //获取OverlayState 16 | OverlayState overlayState = Overlay.of(context); 17 | _showing = true; 18 | if (_overlayEntry == null) { 19 | _overlayEntry = OverlayEntry( 20 | builder: (BuildContext context) => Positioned( 21 | //top值,可以改变这个值来改变toast在屏幕中的位置 22 | top: MediaQuery.of(context).size.height * 1 / 3, 23 | child: Container( 24 | alignment: Alignment.center, 25 | width: MediaQuery.of(context).size.width, 26 | child: Padding( 27 | padding: EdgeInsets.symmetric(horizontal: 80.0), 28 | child: AnimatedOpacity( 29 | opacity: _showing ? 1.0 : 0.0, //目标透明度 30 | duration: _showing 31 | ? Duration(milliseconds: 100) 32 | : Duration(milliseconds: 400), 33 | child: _buildToastWidget(), 34 | ), 35 | )), 36 | )); 37 | overlayState.insert(_overlayEntry); 38 | } else { 39 | //重新绘制UI,类似setState 40 | _overlayEntry.markNeedsBuild(); 41 | } 42 | await Future.delayed(Duration(milliseconds: 2000)); //等待两秒 43 | 44 | //2秒后 到底消失不消失 45 | if (DateTime.now().difference(_startedTime).inMilliseconds >= 2000) { 46 | _showing = false; 47 | _overlayEntry.remove(); 48 | _overlayEntry = null; 49 | } 50 | } 51 | 52 | //toast绘制 53 | static _buildToastWidget() { 54 | return Center( 55 | child: Card( 56 | color: Colors.black26, 57 | child: Padding( 58 | padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 16.0), 59 | child: Text( 60 | _msg, 61 | style: TextStyle( 62 | fontSize: 14.0, 63 | color: Colors.white, 64 | ), 65 | ), 66 | ), 67 | ), 68 | ); 69 | } 70 | } -------------------------------------------------------------------------------- /lib/config/service_url.dart: -------------------------------------------------------------------------------- 1 | const serviceUrl = 'https://rltx2-yfb-gateway.rltx.com'; 2 | 3 | const servicePath = { 4 | 'apiFreightlist' : '$serviceUrl/driver-api/driver-api/freight/list', //货源列表 5 | 'configOther' : '$serviceUrl/platform/platform/core/config/other', //other配置信息 6 | 'selfInfo' : '$serviceUrl/driver-api/driver-api/person/self/info', //司机信息 7 | 'accountLogin' : '$serviceUrl/account/driverLogin', //司机登录 8 | 'provinceList' : '$serviceUrl/org-config/org-config/province/list', //省列表 9 | 'cityList' : '$serviceUrl/org-config/org-config/city/list', //市列表 10 | 'countyList' : '$serviceUrl/org-config/org-config/county/list', //区列表 11 | 'loginOut' : '$serviceUrl/account/logout', //退出登录 12 | 'verifyCode' : '$serviceUrl/account/account/send/verify_code', //获取验证码 13 | 'resetVerifyCode' : '$serviceUrl/account/account/reset_password/send/verify_code', //获取验证码 忘记密码 14 | 'accountRegistry' : '$serviceUrl/account/account/mobile/registry', //注册 15 | 'resetPassword' : '$serviceUrl/account/account/reset_password', //重置密码 16 | 'waybillList' : '$serviceUrl/driver-api/driver-api/waybill/list', //运单列表数据 17 | 'waybillActionList' : '$serviceUrl/driver-api/driverApi/action/list', //运单业务动作列表 18 | 'mainTruckMessage' : '$serviceUrl/driver-api/driver-api/truck/list',// 获取主车信息 19 | 'trailerTruckMessage' : '$serviceUrl/driver-api/driver-api/trailer_truck/get', //获取挂车信息 20 | 'getEWMImage' : '$serviceUrl/driver-api/driver-api/generate_user_qr_code', //获取二维码 21 | 'myBankCardAccount' : '$serviceUrl/driver-api/driver-api/person/bank/account', //我的银行卡 22 | 'myBankCardAccountAdd' : '$serviceUrl/driver-api/driver-api/person/bank/account/add', //新增我的银行卡信息 23 | 'myBankCardAccountEdit' : '$serviceUrl/driver-api/driver-api/person/bank/account/edit', //编辑我的银行卡信息 24 | 'getPertainOrg' : '$serviceUrl/transport/transport/query/pertain/org', //获取已挂靠的公司列表 25 | 'addCompany' : '$serviceUrl/transport/transport/set/pertain/org/by/driver', //添加挂靠公司 26 | 'manageList' : '$serviceUrl/platform/org/manager/list', //查询伙伴列表 27 | 'editeFuelCard' : '$serviceUrl/driver-api/driver-api/person/edit/fuel_card_no', //修改油卡信息 28 | 'recodeList' : '$serviceUrl/driver-api/driver-api/freight_collect_record/list', //我的收藏列表 29 | 'resourceRouteSubscribe': '$serviceUrl/resource/resource/resource_route_subscribe/getList', //获取订阅线路列表 30 | 'addSubscribeRoure' : '$serviceUrl/resource/resource/resource_route_subscribe/add', //添加订阅线路 31 | 'modifyLoginAccount' : '$serviceUrl/account/account/modify_login_account', //修改手机号 32 | 'sendSelfVerifyCode' : '$serviceUrl/account/account/send/self/verify_code', //当前账户获取验证码 33 | 'updateImage' : '$serviceUrl/person/fw/image/update', //上传图片 34 | 'personalSelfEdit': '$serviceUrl/driver-api/driver-api/person/self/edit', //暂存司机信息 35 | 'newPersonalSelfCentry': '$serviceUrl/driver-api/driver-api/new/person/self/edit', //司机信息提交认证 36 | 'truckAdd': '$serviceUrl/driver-api/driver-api/truck/add',//新增主车 37 | 'truckEdite': '$serviceUrl/driver-api/driver-api/truck/edit',//更新主车 38 | 'trailerInfo': '$serviceUrl//driver-api/driver-api/trailer_truck/get', //查询挂车信息 39 | 'searchTruckInfo': '$serviceUrl/driver-api/driver-api/truck/all/list',//查询车牌号 40 | 'collectRecordAdd' : '$serviceUrl/driver-api/driver-api/driver_api_collect_record/add',//收藏货源 41 | 'waybillAccepy' : '$serviceUrl/driver-api/driver-api/waybill/accept', //确认运单 42 | 'waybillRefuse' : '$serviceUrl/driver-api/driver-api/waybill/reject', //拒绝运单 43 | 'waybillCancel' : '$serviceUrl/driver-api/driver-api/waybill/cancel',//取消运单 44 | 'actionList' : '$serviceUrl/driver-api/driverApi/action/list',//获取业务动作列表 45 | 'waybillLoading' : '$serviceUrl/driver-api/driver-api/waybill/loading',//装货 46 | 'waybillUnloading' : '$serviceUrl/driver-api/driver-api/waybill/unloading',//卸货 47 | 'mobileUserMoney' : '$serviceUrl/pay/mobile/userIndex',//查询账户余额 48 | 'mobileBankCardList' : '$serviceUrl/pay/mobile/bankCardList',//绑定的银行卡列表 49 | 'sendModifyCode' : '$serviceUrl/pay/mobile/sendModifyPayPasswordVerifyCode',//设置交易密码验证码 50 | 'modifyPassword' : '$serviceUrl/pay/mobile/modifyWithdrawPassword', //修改交易密码 51 | 'sendBankCardVerifyCode' : '$serviceUrl/pay/mobile/sendAddBankCardVerifyCode',//添加银行卡的发送验证码 52 | 'addBankCard' : '$serviceUrl/pay/mobile/addBankCard',//添加银行卡 53 | 'deleteBankCard' : '$serviceUrl/pay/mobile/deleteBankCard', //删除银行卡 54 | 'setDefaultBankCard' : '$serviceUrl/pay/mobile/setDefaultBankCard',//银行卡设置为默认银行卡 55 | 'caculateCharge' : '$serviceUrl/pay/mobile/withdrawCharge',//提现费用计算 56 | 'checkPassword' : '$serviceUrl/pay/mobile/checkWithdrawPassword', //校验提现密码是否存在 57 | 'doWithdraw' : '$serviceUrl/pay/mobile/doWithdraw', //提现 58 | 'tradeLog' : '$serviceUrl/pay/mobile/tradeLog', //获取交易记录 59 | 60 | }; -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import './pages/login_page.dart'; 3 | import './pages/register_page.dart'; 4 | import './common/splash_screen.dart'; 5 | import './pages/index_page.dart'; 6 | import './pages/my_account_page.dart'; 7 | 8 | void main() => runApp(MyApp()); 9 | 10 | class MyApp extends StatelessWidget { 11 | // This widget is the root of your application. 12 | @override 13 | Widget build(BuildContext context) { 14 | return MaterialApp( 15 | title: 'Flutter Demo', 16 | debugShowCheckedModeBanner: false, 17 | theme: ThemeData( 18 | // This is the theme of your application. 19 | // 20 | // Try running your application with "flutter run". You'll see the 21 | // application has a blue toolbar. Then, without quitting the app, try 22 | // changing the primarySwatch below to Colors.green and then invoke 23 | // "hot reload" (press "r" in the console where you ran "flutter run", 24 | // or simply save your changes to "hot reload" in a Flutter IDE). 25 | // Notice that the counter didn't reset back to zero; the application 26 | // is not restarted. 27 | primarySwatch: Colors.blueGrey, 28 | // primaryColor: Colors.orangeAccent[700] 29 | ), 30 | routes: { 31 | '/login': (BuildContext context) => LoginPage(), 32 | '/resource': (BuildContext context) => IndexPage(), 33 | '/register' : (BuildContext context) => RegisterPage(), 34 | '/account' : (BuildContext context) => MyAccountPage(), 35 | }, 36 | home: SplashScreen(), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/mode/bank_card_add_mode.dart: -------------------------------------------------------------------------------- 1 | class BankCardAddMode { 2 | num code; 3 | BankCardAddContent content; 4 | 5 | BankCardAddMode({this.code, this.content}); 6 | 7 | BankCardAddMode.fromJson(Map json) { 8 | code = json['code']; 9 | content = 10 | json['content'] != null ? new BankCardAddContent.fromJson(json['content']) : null; 11 | } 12 | 13 | Map toJson() { 14 | final Map data = new Map(); 15 | data['code'] = this.code; 16 | if (this.content != null) { 17 | data['content'] = this.content.toJson(); 18 | } 19 | return data; 20 | } 21 | } 22 | 23 | class BankCardAddContent { 24 | String bankAccountName; 25 | String bankAccountNo; 26 | String description; 27 | String bankName; 28 | 29 | BankCardAddContent( 30 | {this.bankAccountName, 31 | this.bankAccountNo, 32 | this.description, 33 | this.bankName}); 34 | 35 | BankCardAddContent.fromJson(Map json) { 36 | bankAccountName = json['bankAccountName']; 37 | bankAccountNo = json['bankAccountNo']; 38 | description = json['description']; 39 | bankName = json['bankName']; 40 | } 41 | 42 | Map toJson() { 43 | final Map data = new Map(); 44 | data['bankAccountName'] = this.bankAccountName; 45 | data['bankAccountNo'] = this.bankAccountNo; 46 | data['description'] = this.description; 47 | data['bankName'] = this.bankName; 48 | return data; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/mode/bank_card_mode.dart: -------------------------------------------------------------------------------- 1 | class BankCardMode { 2 | num code; 3 | BankCardContent content; 4 | 5 | BankCardMode({this.code, this.content}); 6 | 7 | BankCardMode.fromJson(Map json) { 8 | code = json['code']; 9 | content = 10 | json['content'] != null ? new BankCardContent.fromJson(json['content']) : null; 11 | } 12 | 13 | Map toJson() { 14 | final Map data = new Map(); 15 | data['code'] = this.code; 16 | if (this.content != null) { 17 | data['content'] = this.content.toJson(); 18 | } 19 | return data; 20 | } 21 | } 22 | 23 | class BankCardContent { 24 | String bankAccountName; 25 | String bankAccountNo; 26 | String description; 27 | String bankName; 28 | 29 | BankCardContent( 30 | {this.bankAccountName, 31 | this.bankAccountNo, 32 | this.description, 33 | this.bankName}); 34 | 35 | BankCardContent.fromJson(Map json) { 36 | bankAccountName = json['bankAccountName']; 37 | bankAccountNo = json['bankAccountNo']; 38 | description = json['description']; 39 | bankName = json['bankName']; 40 | } 41 | 42 | Map toJson() { 43 | final Map data = new Map(); 44 | data['bankAccountName'] = this.bankAccountName; 45 | data['bankAccountNo'] = this.bankAccountNo; 46 | data['description'] = this.description; 47 | data['bankName'] = this.bankName; 48 | return data; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/mode/join_company_list_mode.dart: -------------------------------------------------------------------------------- 1 | class JoinCompanyListMode { 2 | num code; 3 | List content; 4 | int total; 5 | 6 | JoinCompanyListMode({this.code, this.content, this.total}); 7 | 8 | JoinCompanyListMode.fromJson(Map json) { 9 | code = json['code']; 10 | if (json['content'] != null) { 11 | content = new List(); 12 | json['content'].forEach((v) { 13 | content.add(new CompanyListContent.fromJson(v)); 14 | }); 15 | } 16 | total = json['total']; 17 | } 18 | 19 | Map toJson() { 20 | final Map data = new Map(); 21 | data['code'] = this.code; 22 | if (this.content != null) { 23 | data['content'] = this.content.map((v) => v.toJson()).toList(); 24 | } 25 | data['total'] = this.total; 26 | return data; 27 | } 28 | } 29 | 30 | class CompanyListContent { 31 | String orgStatus; 32 | num orgType; 33 | String orgName; 34 | String code; 35 | String certStatus; 36 | String createTime; 37 | String creatorUsername; 38 | String updateUsername; 39 | String orgFullName; 40 | String updateTime; 41 | 42 | CompanyListContent( 43 | {this.orgStatus, 44 | this.orgType, 45 | this.orgName, 46 | this.code, 47 | this.certStatus, 48 | this.createTime, 49 | this.creatorUsername, 50 | this.updateUsername, 51 | this.orgFullName, 52 | this.updateTime}); 53 | 54 | CompanyListContent.fromJson(Map json) { 55 | orgStatus = json['orgStatus']; 56 | orgType = json['orgType']; 57 | orgName = json['orgName']; 58 | code = json['code']; 59 | certStatus = json['certStatus']; 60 | createTime = json['createTime']; 61 | creatorUsername = json['creatorUsername']; 62 | updateUsername = json['updateUsername']; 63 | orgFullName = json['orgFullName']; 64 | updateTime = json['updateTime']; 65 | } 66 | 67 | Map toJson() { 68 | final Map data = new Map(); 69 | data['orgStatus'] = this.orgStatus; 70 | data['orgType'] = this.orgType; 71 | data['orgName'] = this.orgName; 72 | data['code'] = this.code; 73 | data['certStatus'] = this.certStatus; 74 | data['createTime'] = this.createTime; 75 | data['creatorUsername'] = this.creatorUsername; 76 | data['updateUsername'] = this.updateUsername; 77 | data['orgFullName'] = this.orgFullName; 78 | data['updateTime'] = this.updateTime; 79 | return data; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /lib/mode/main_truck_list_mode.dart: -------------------------------------------------------------------------------- 1 | class MainTruckListMode { 2 | num code; 3 | List content; 4 | int total; 5 | 6 | MainTruckListMode({this.code, this.content, this.total}); 7 | 8 | MainTruckListMode.fromJson(Map json) { 9 | code = json['code']; 10 | if (json['content'] != null) { 11 | content = new List(); 12 | json['content'].forEach((v) { 13 | content.add(new TruckContent.fromJson(v)); 14 | }); 15 | } 16 | total = json['total']; 17 | } 18 | 19 | Map toJson() { 20 | final Map data = new Map(); 21 | data['code'] = this.code; 22 | if (this.content != null) { 23 | data['content'] = this.content.map((v) => v.toJson()).toList(); 24 | } 25 | data['total'] = this.total; 26 | return data; 27 | } 28 | } 29 | 30 | class TruckContent { 31 | String standard; 32 | String transportLicenseNo; 33 | String transportLicenseRecourseCode; 34 | String code; 35 | String certStatus; 36 | String description; 37 | String ownerOrgName; 38 | String truckLengthUnitCode; 39 | String truckCode; 40 | num truckTotalWeight; 41 | bool disabled; 42 | num id; 43 | String drivingLicenseRecourseCode; 44 | String moduleCode; 45 | String creatorUserCode; 46 | String ip; 47 | String ownerUserCode; 48 | String truckModelCode; 49 | String synchronousId; 50 | String regTonnageUnitCode; 51 | String updateTime; 52 | num truckTowWeight; 53 | String truckBodyImageResourceCode; 54 | String updateUserCode; 55 | bool deleted; 56 | String ownerOrgCode; 57 | num regTonnage; 58 | String createTime; 59 | String truckLicenseType; 60 | String truckModelName; 61 | String creatorUsername; 62 | String updateUsername; 63 | num truckLength; 64 | String truckLicenseNo; 65 | bool isTrailer; 66 | String powerType; 67 | 68 | TruckContent( 69 | {this.standard, 70 | this.transportLicenseNo, 71 | this.transportLicenseRecourseCode, 72 | this.code, 73 | this.certStatus, 74 | this.description, 75 | this.ownerOrgName, 76 | this.truckLengthUnitCode, 77 | this.truckCode, 78 | this.truckTotalWeight, 79 | this.disabled, 80 | this.id, 81 | this.drivingLicenseRecourseCode, 82 | this.moduleCode, 83 | this.creatorUserCode, 84 | this.ip, 85 | this.ownerUserCode, 86 | this.truckModelCode, 87 | this.synchronousId, 88 | this.regTonnageUnitCode, 89 | this.updateTime, 90 | this.truckTowWeight, 91 | this.truckBodyImageResourceCode, 92 | this.updateUserCode, 93 | this.deleted, 94 | this.ownerOrgCode, 95 | this.regTonnage, 96 | this.createTime, 97 | this.truckLicenseType, 98 | this.truckModelName, 99 | this.creatorUsername, 100 | this.updateUsername, 101 | this.truckLength, 102 | this.truckLicenseNo, 103 | this.isTrailer, 104 | this.powerType}); 105 | 106 | TruckContent.fromJson(Map json) { 107 | standard = json['standard']; 108 | transportLicenseNo = json['transportLicenseNo']; 109 | transportLicenseRecourseCode = json['transportLicenseRecourseCode']; 110 | code = json['code']; 111 | certStatus = json['certStatus']; 112 | description = json['description']; 113 | ownerOrgName = json['ownerOrgName']; 114 | truckLengthUnitCode = json['truckLengthUnitCode']; 115 | truckCode = json['truckCode']; 116 | truckTotalWeight = json['truckTotalWeight']; 117 | disabled = json['disabled']; 118 | id = json['id']; 119 | drivingLicenseRecourseCode = json['drivingLicenseRecourseCode']; 120 | moduleCode = json['moduleCode']; 121 | creatorUserCode = json['creatorUserCode']; 122 | ip = json['ip']; 123 | ownerUserCode = json['ownerUserCode']; 124 | truckModelCode = json['truckModelCode']; 125 | synchronousId = json['synchronousId']; 126 | regTonnageUnitCode = json['regTonnageUnitCode']; 127 | updateTime = json['updateTime']; 128 | truckTowWeight = json['truckTowWeight']; 129 | truckBodyImageResourceCode = json['truckBodyImageResourceCode']; 130 | updateUserCode = json['updateUserCode']; 131 | deleted = json['deleted']; 132 | ownerOrgCode = json['ownerOrgCode']; 133 | regTonnage = json['regTonnage']; 134 | createTime = json['createTime']; 135 | truckLicenseType = json['truckLicenseType']; 136 | truckModelName = json['truckModelName']; 137 | creatorUsername = json['creatorUsername']; 138 | updateUsername = json['updateUsername']; 139 | truckLength = json['truckLength']; 140 | truckLicenseNo = json['truckLicenseNo']; 141 | isTrailer = json['isTrailer']; 142 | powerType = json['powerType']; 143 | } 144 | 145 | Map toJson() { 146 | final Map data = new Map(); 147 | data['standard'] = this.standard; 148 | data['transportLicenseNo'] = this.transportLicenseNo; 149 | data['transportLicenseRecourseCode'] = this.transportLicenseRecourseCode; 150 | data['code'] = this.code; 151 | data['certStatus'] = this.certStatus; 152 | data['description'] = this.description; 153 | data['ownerOrgName'] = this.ownerOrgName; 154 | data['truckLengthUnitCode'] = this.truckLengthUnitCode; 155 | data['truckCode'] = this.truckCode; 156 | data['truckTotalWeight'] = this.truckTotalWeight; 157 | data['disabled'] = this.disabled; 158 | data['id'] = this.id; 159 | data['drivingLicenseRecourseCode'] = this.drivingLicenseRecourseCode; 160 | data['moduleCode'] = this.moduleCode; 161 | data['creatorUserCode'] = this.creatorUserCode; 162 | data['ip'] = this.ip; 163 | data['ownerUserCode'] = this.ownerUserCode; 164 | data['truckModelCode'] = this.truckModelCode; 165 | data['synchronousId'] = this.synchronousId; 166 | data['regTonnageUnitCode'] = this.regTonnageUnitCode; 167 | data['updateTime'] = this.updateTime; 168 | data['truckTowWeight'] = this.truckTowWeight; 169 | data['truckBodyImageResourceCode'] = this.truckBodyImageResourceCode; 170 | data['updateUserCode'] = this.updateUserCode; 171 | data['deleted'] = this.deleted; 172 | data['ownerOrgCode'] = this.ownerOrgCode; 173 | data['regTonnage'] = this.regTonnage; 174 | data['createTime'] = this.createTime; 175 | data['truckLicenseType'] = this.truckLicenseType; 176 | data['truckModelName'] = this.truckModelName; 177 | data['creatorUsername'] = this.creatorUsername; 178 | data['updateUsername'] = this.updateUsername; 179 | data['truckLength'] = this.truckLength; 180 | data['truckLicenseNo'] = this.truckLicenseNo; 181 | data['isTrailer'] = this.isTrailer; 182 | data['powerType'] = this.powerType; 183 | return data; 184 | } 185 | } 186 | -------------------------------------------------------------------------------- /lib/mode/search_join_company_list.dart: -------------------------------------------------------------------------------- 1 | class SearchJoinCampanyList { 2 | num code; 3 | List content; 4 | int total; 5 | 6 | SearchJoinCampanyList({this.code, this.content, this.total}); 7 | 8 | SearchJoinCampanyList.fromJson(Map json) { 9 | code = json['code']; 10 | if (json['content'] != null) { 11 | content = new List(); 12 | json['content'].forEach((v) { 13 | content.add(new SearchListContent.fromJson(v)); 14 | }); 15 | } 16 | total = json['total']; 17 | } 18 | 19 | Map toJson() { 20 | final Map data = new Map(); 21 | data['code'] = this.code; 22 | if (this.content != null) { 23 | data['content'] = this.content.map((v) => v.toJson()).toList(); 24 | } 25 | data['total'] = this.total; 26 | return data; 27 | } 28 | } 29 | 30 | class SearchListContent { 31 | String orgName; 32 | String code; 33 | String certStatus; 34 | String linkmanFullName; 35 | String city; 36 | String transportCertificate; 37 | String county; 38 | String orgFullName; 39 | String updateTime; 40 | String orgStatus; 41 | int orgType; 42 | bool isChoice; 43 | String province; 44 | String createTime; 45 | String creatorUsername; 46 | String updateUsername; 47 | String linkmanPhone; 48 | 49 | SearchListContent( 50 | {this.orgName, 51 | this.code, 52 | this.certStatus, 53 | this.linkmanFullName, 54 | this.city, 55 | this.transportCertificate, 56 | this.county, 57 | this.orgFullName, 58 | this.updateTime, 59 | this.orgStatus, 60 | this.orgType, 61 | this.province, 62 | this.isChoice, 63 | this.createTime, 64 | this.creatorUsername, 65 | this.updateUsername, 66 | this.linkmanPhone}); 67 | 68 | SearchListContent.fromJson(Map json) { 69 | orgName = json['orgName']; 70 | code = json['code']; 71 | certStatus = json['certStatus']; 72 | linkmanFullName = json['linkmanFullName']; 73 | city = json['city']; 74 | transportCertificate = json['transportCertificate']; 75 | county = json['county']; 76 | orgFullName = json['orgFullName']; 77 | updateTime = json['updateTime']; 78 | orgStatus = json['orgStatus']; 79 | orgType = json['orgType']; 80 | province = json['province']; 81 | isChoice = false; 82 | createTime = json['createTime']; 83 | creatorUsername = json['creatorUsername']; 84 | updateUsername = json['updateUsername']; 85 | linkmanPhone = json['linkmanPhone']; 86 | } 87 | 88 | Map toJson() { 89 | final Map data = new Map(); 90 | data['orgName'] = this.orgName; 91 | data['code'] = this.code; 92 | data['certStatus'] = this.certStatus; 93 | data['linkmanFullName'] = this.linkmanFullName; 94 | data['city'] = this.city; 95 | data['transportCertificate'] = this.transportCertificate; 96 | data['county'] = this.county; 97 | data['orgFullName'] = this.orgFullName; 98 | data['updateTime'] = this.updateTime; 99 | data['orgStatus'] = this.orgStatus; 100 | data['orgType'] = this.orgType; 101 | data['province'] = this.province; 102 | data['isChoice'] = false; 103 | data['createTime'] = this.createTime; 104 | data['creatorUsername'] = this.creatorUsername; 105 | data['updateUsername'] = this.updateUsername; 106 | data['linkmanPhone'] = this.linkmanPhone; 107 | return data; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /lib/mode/self_info_mode.dart: -------------------------------------------------------------------------------- 1 | class SelfInfoMode { 2 | num code; 3 | Content content; 4 | 5 | SelfInfoMode({this.code, this.content}); 6 | 7 | SelfInfoMode.fromJson(Map json) { 8 | code = json['code']; 9 | content = 10 | json['content'] != null ? new Content.fromJson(json['content']) : null; 11 | } 12 | 13 | Map toJson() { 14 | final Map data = new Map(); 15 | data['code'] = this.code; 16 | if (this.content != null) { 17 | data['content'] = this.content.toJson(); 18 | } 19 | return data; 20 | } 21 | } 22 | 23 | class Content { 24 | String driverLicenseNo; 25 | String code; 26 | String userStatus; 27 | String certStatus; 28 | String gender; 29 | String qualificationCertificateResourceCode; 30 | String description; 31 | String userCode; 32 | String ownerOrgName; 33 | String identityNumber; 34 | bool disabled; 35 | String identityResourceCode; 36 | String moduleCode; 37 | String creatorUserCode; 38 | String driverLicenseResourceCode; 39 | String ip; 40 | String ownerUserCode; 41 | String driverLicenseAcceptType; 42 | String synchronousId; 43 | bool rootFlag; 44 | String fullName; 45 | String updateTime; 46 | String qualificationCertificateNumber; 47 | String updateUserCode; 48 | bool deleted; 49 | String ownerOrgCode; 50 | String phone; 51 | String createTime; 52 | String creatorUsername; 53 | String updateUsername; 54 | num userType; 55 | 56 | Content( 57 | {this.driverLicenseNo, 58 | this.code, 59 | this.userStatus, 60 | this.certStatus, 61 | this.gender, 62 | this.qualificationCertificateResourceCode, 63 | this.description, 64 | this.userCode, 65 | this.ownerOrgName, 66 | this.identityNumber, 67 | this.disabled, 68 | this.identityResourceCode, 69 | this.moduleCode, 70 | this.creatorUserCode, 71 | this.driverLicenseResourceCode, 72 | this.ip, 73 | this.ownerUserCode, 74 | this.driverLicenseAcceptType, 75 | this.synchronousId, 76 | this.rootFlag, 77 | this.fullName, 78 | this.updateTime, 79 | this.qualificationCertificateNumber, 80 | this.updateUserCode, 81 | this.deleted, 82 | this.ownerOrgCode, 83 | this.phone, 84 | this.createTime, 85 | this.creatorUsername, 86 | this.updateUsername, 87 | this.userType}); 88 | 89 | Content.fromJson(Map json) { 90 | driverLicenseNo = json['driverLicenseNo']; 91 | code = json['code']; 92 | userStatus = json['userStatus']; 93 | certStatus = json['certStatus']; 94 | gender = json['gender']; 95 | qualificationCertificateResourceCode = 96 | json['qualificationCertificateResourceCode']; 97 | description = json['description']; 98 | userCode = json['userCode']; 99 | ownerOrgName = json['ownerOrgName']; 100 | identityNumber = json['identityNumber']; 101 | disabled = json['disabled']; 102 | identityResourceCode = json['identityResourceCode']; 103 | moduleCode = json['moduleCode']; 104 | creatorUserCode = json['creatorUserCode']; 105 | driverLicenseResourceCode = json['driverLicenseResourceCode']; 106 | ip = json['ip']; 107 | ownerUserCode = json['ownerUserCode']; 108 | driverLicenseAcceptType = json['driverLicenseAcceptType']; 109 | synchronousId = json['synchronousId']; 110 | rootFlag = json['rootFlag']; 111 | fullName = json['fullName']; 112 | updateTime = json['updateTime']; 113 | qualificationCertificateNumber = json['qualificationCertificateNumber']; 114 | updateUserCode = json['updateUserCode']; 115 | deleted = json['deleted']; 116 | ownerOrgCode = json['ownerOrgCode']; 117 | phone = json['phone']; 118 | createTime = json['createTime']; 119 | creatorUsername = json['creatorUsername']; 120 | updateUsername = json['updateUsername']; 121 | userType = json['userType']; 122 | } 123 | 124 | Map toJson() { 125 | final Map data = new Map(); 126 | data['driverLicenseNo'] = this.driverLicenseNo; 127 | data['code'] = this.code; 128 | data['userStatus'] = this.userStatus; 129 | data['certStatus'] = this.certStatus; 130 | data['gender'] = this.gender; 131 | data['qualificationCertificateResourceCode'] = 132 | this.qualificationCertificateResourceCode; 133 | data['description'] = this.description; 134 | data['userCode'] = this.userCode; 135 | data['ownerOrgName'] = this.ownerOrgName; 136 | data['identityNumber'] = this.identityNumber; 137 | data['disabled'] = this.disabled; 138 | data['identityResourceCode'] = this.identityResourceCode; 139 | data['moduleCode'] = this.moduleCode; 140 | data['creatorUserCode'] = this.creatorUserCode; 141 | data['driverLicenseResourceCode'] = this.driverLicenseResourceCode; 142 | data['ip'] = this.ip; 143 | data['ownerUserCode'] = this.ownerUserCode; 144 | data['driverLicenseAcceptType'] = this.driverLicenseAcceptType; 145 | data['synchronousId'] = this.synchronousId; 146 | data['rootFlag'] = this.rootFlag; 147 | data['fullName'] = this.fullName; 148 | data['updateTime'] = this.updateTime; 149 | data['qualificationCertificateNumber'] = 150 | this.qualificationCertificateNumber; 151 | data['updateUserCode'] = this.updateUserCode; 152 | data['deleted'] = this.deleted; 153 | data['ownerOrgCode'] = this.ownerOrgCode; 154 | data['phone'] = this.phone; 155 | data['createTime'] = this.createTime; 156 | data['creatorUsername'] = this.creatorUsername; 157 | data['updateUsername'] = this.updateUsername; 158 | data['userType'] = this.userType; 159 | return data; 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /lib/mode/subscribe_line_route_mode.dart: -------------------------------------------------------------------------------- 1 | class SubScribeLineRouteMode { 2 | num code; 3 | List content; 4 | int total; 5 | 6 | SubScribeLineRouteMode({this.code, this.content, this.total}); 7 | 8 | SubScribeLineRouteMode.fromJson(Map json) { 9 | code = json['code']; 10 | if (json['content'] != null) { 11 | content = new List(); 12 | json['content'].forEach((v) { 13 | content.add(new SubScribeLineRouteContent.fromJson(v)); 14 | }); 15 | } 16 | total = json['total']; 17 | } 18 | 19 | Map toJson() { 20 | final Map data = new Map(); 21 | data['code'] = this.code; 22 | if (this.content != null) { 23 | data['content'] = this.content.map((v) => v.toJson()).toList(); 24 | } 25 | data['total'] = this.total; 26 | return data; 27 | } 28 | } 29 | 30 | class SubScribeLineRouteContent { 31 | String code; 32 | String moduleCode; 33 | String unloadingProvinceName; 34 | String creatorUserCode; 35 | String ip; 36 | String ownerUserCode; 37 | String unloadingCityCode; 38 | String synchronousId; 39 | String updateTime; 40 | String unloadingCityName; 41 | String updateUserCode; 42 | String ownerOrgName; 43 | bool deleted; 44 | String ownerOrgCode; 45 | String loadingCityName; 46 | String unloadingProvinceCode; 47 | String createTime; 48 | String loadingCityCode; 49 | String creatorUsername; 50 | String updateUsername; 51 | bool disabled; 52 | String loadingProvinceCode; 53 | num id; 54 | String loadingProvinceName; 55 | 56 | SubScribeLineRouteContent( 57 | {this.code, 58 | this.moduleCode, 59 | this.unloadingProvinceName, 60 | this.creatorUserCode, 61 | this.ip, 62 | this.ownerUserCode, 63 | this.unloadingCityCode, 64 | this.synchronousId, 65 | this.updateTime, 66 | this.unloadingCityName, 67 | this.updateUserCode, 68 | this.ownerOrgName, 69 | this.deleted, 70 | this.ownerOrgCode, 71 | this.loadingCityName, 72 | this.unloadingProvinceCode, 73 | this.createTime, 74 | this.loadingCityCode, 75 | this.creatorUsername, 76 | this.updateUsername, 77 | this.disabled, 78 | this.loadingProvinceCode, 79 | this.id, 80 | this.loadingProvinceName}); 81 | 82 | SubScribeLineRouteContent.fromJson(Map json) { 83 | code = json['code']; 84 | moduleCode = json['moduleCode']; 85 | unloadingProvinceName = json['unloadingProvinceName']; 86 | creatorUserCode = json['creatorUserCode']; 87 | ip = json['ip']; 88 | ownerUserCode = json['ownerUserCode']; 89 | unloadingCityCode = json['unloadingCityCode']; 90 | synchronousId = json['synchronousId']; 91 | updateTime = json['updateTime']; 92 | unloadingCityName = json['unloadingCityName']; 93 | updateUserCode = json['updateUserCode']; 94 | ownerOrgName = json['ownerOrgName']; 95 | deleted = json['deleted']; 96 | ownerOrgCode = json['ownerOrgCode']; 97 | loadingCityName = json['loadingCityName']; 98 | unloadingProvinceCode = json['unloadingProvinceCode']; 99 | createTime = json['createTime']; 100 | loadingCityCode = json['loadingCityCode']; 101 | creatorUsername = json['creatorUsername']; 102 | updateUsername = json['updateUsername']; 103 | disabled = json['disabled']; 104 | loadingProvinceCode = json['loadingProvinceCode']; 105 | id = json['id']; 106 | loadingProvinceName = json['loadingProvinceName']; 107 | } 108 | 109 | Map toJson() { 110 | final Map data = new Map(); 111 | data['code'] = this.code; 112 | data['moduleCode'] = this.moduleCode; 113 | data['unloadingProvinceName'] = this.unloadingProvinceName; 114 | data['creatorUserCode'] = this.creatorUserCode; 115 | data['ip'] = this.ip; 116 | data['ownerUserCode'] = this.ownerUserCode; 117 | data['unloadingCityCode'] = this.unloadingCityCode; 118 | data['synchronousId'] = this.synchronousId; 119 | data['updateTime'] = this.updateTime; 120 | data['unloadingCityName'] = this.unloadingCityName; 121 | data['updateUserCode'] = this.updateUserCode; 122 | data['ownerOrgName'] = this.ownerOrgName; 123 | data['deleted'] = this.deleted; 124 | data['ownerOrgCode'] = this.ownerOrgCode; 125 | data['loadingCityName'] = this.loadingCityName; 126 | data['unloadingProvinceCode'] = this.unloadingProvinceCode; 127 | data['createTime'] = this.createTime; 128 | data['loadingCityCode'] = this.loadingCityCode; 129 | data['creatorUsername'] = this.creatorUsername; 130 | data['updateUsername'] = this.updateUsername; 131 | data['disabled'] = this.disabled; 132 | data['loadingProvinceCode'] = this.loadingProvinceCode; 133 | data['id'] = this.id; 134 | data['loadingProvinceName'] = this.loadingProvinceName; 135 | return data; 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /lib/mode/trailer_truck_mode.dart: -------------------------------------------------------------------------------- 1 | class TrialerTruckMode { 2 | num code; 3 | TrialerTruckContent content; 4 | 5 | TrialerTruckMode({this.code, this.content}); 6 | 7 | TrialerTruckMode.fromJson(Map json) { 8 | code = json['code']; 9 | content = json['content'] != null ? new TrialerTruckContent.fromJson(json['content']) : null; 10 | } 11 | 12 | Map toJson() { 13 | final Map data = new Map(); 14 | data['code'] = this.code; 15 | if (this.content != null) { 16 | data['content'] = this.content.toJson(); 17 | } 18 | return data; 19 | } 20 | } 21 | 22 | class TrialerTruckContent { 23 | String transportLicenseNo; 24 | String transportLicenseRecourseCode; 25 | String certStatus; 26 | String ownerOrgName; 27 | String truckLengthUnitCode; 28 | String truckCode; 29 | num truckTotalWeight; 30 | bool disabled; 31 | num id; 32 | String drivingLicenseRecourseCode; 33 | String moduleCode; 34 | String creatorUserCode; 35 | String ip; 36 | String ownerUserCode; 37 | String truckModelCode; 38 | String truckTowWeightUnitCode; 39 | String synchronousId; 40 | String regTonnageUnitCode; 41 | String updateTime; 42 | String updateUserCode; 43 | bool deleted; 44 | String ownerOrgCode; 45 | num regTonnage; 46 | String createTime; 47 | String truckLicenseType; 48 | String truckModelName; 49 | String creatorUsername; 50 | String updateUsername; 51 | String truckTotalWeightUnitCode; 52 | num truckLength; 53 | String truckLicenseNo; 54 | bool isTrailer; 55 | 56 | TrialerTruckContent( 57 | {this.transportLicenseNo, 58 | this.transportLicenseRecourseCode, 59 | this.certStatus, 60 | this.ownerOrgName, 61 | this.truckLengthUnitCode, 62 | this.truckCode, 63 | this.truckTotalWeight, 64 | this.disabled, 65 | this.id, 66 | this.drivingLicenseRecourseCode, 67 | this.moduleCode, 68 | this.creatorUserCode, 69 | this.ip, 70 | this.ownerUserCode, 71 | this.truckModelCode, 72 | this.truckTowWeightUnitCode, 73 | this.synchronousId, 74 | this.regTonnageUnitCode, 75 | this.updateTime, 76 | this.updateUserCode, 77 | this.deleted, 78 | this.ownerOrgCode, 79 | this.regTonnage, 80 | this.createTime, 81 | this.truckLicenseType, 82 | this.truckModelName, 83 | this.creatorUsername, 84 | this.updateUsername, 85 | this.truckTotalWeightUnitCode, 86 | this.truckLength, 87 | this.truckLicenseNo, 88 | this.isTrailer}); 89 | 90 | TrialerTruckContent.fromJson(Map json) { 91 | transportLicenseNo = json['transportLicenseNo']; 92 | transportLicenseRecourseCode = json['transportLicenseRecourseCode']; 93 | certStatus = json['certStatus']; 94 | ownerOrgName = json['ownerOrgName']; 95 | truckLengthUnitCode = json['truckLengthUnitCode']; 96 | truckCode = json['truckCode']; 97 | truckTotalWeight = json['truckTotalWeight']; 98 | disabled = json['disabled']; 99 | id = json['id']; 100 | drivingLicenseRecourseCode = json['drivingLicenseRecourseCode']; 101 | moduleCode = json['moduleCode']; 102 | creatorUserCode = json['creatorUserCode']; 103 | ip = json['ip']; 104 | ownerUserCode = json['ownerUserCode']; 105 | truckModelCode = json['truckModelCode']; 106 | truckTowWeightUnitCode = json['truckTowWeightUnitCode']; 107 | synchronousId = json['synchronousId']; 108 | regTonnageUnitCode = json['regTonnageUnitCode']; 109 | updateTime = json['updateTime']; 110 | updateUserCode = json['updateUserCode']; 111 | deleted = json['deleted']; 112 | ownerOrgCode = json['ownerOrgCode']; 113 | regTonnage = json['regTonnage']; 114 | createTime = json['createTime']; 115 | truckLicenseType = json['truckLicenseType']; 116 | truckModelName = json['truckModelName']; 117 | creatorUsername = json['creatorUsername']; 118 | updateUsername = json['updateUsername']; 119 | truckTotalWeightUnitCode = json['truckTotalWeightUnitCode']; 120 | truckLength = json['truckLength']; 121 | truckLicenseNo = json['truckLicenseNo']; 122 | isTrailer = json['isTrailer']; 123 | } 124 | 125 | Map toJson() { 126 | final Map data = new Map(); 127 | data['transportLicenseNo'] = this.transportLicenseNo; 128 | data['transportLicenseRecourseCode'] = this.transportLicenseRecourseCode; 129 | data['certStatus'] = this.certStatus; 130 | data['ownerOrgName'] = this.ownerOrgName; 131 | data['truckLengthUnitCode'] = this.truckLengthUnitCode; 132 | data['truckCode'] = this.truckCode; 133 | data['truckTotalWeight'] = this.truckTotalWeight; 134 | data['disabled'] = this.disabled; 135 | data['id'] = this.id; 136 | data['drivingLicenseRecourseCode'] = this.drivingLicenseRecourseCode; 137 | data['moduleCode'] = this.moduleCode; 138 | data['creatorUserCode'] = this.creatorUserCode; 139 | data['ip'] = this.ip; 140 | data['ownerUserCode'] = this.ownerUserCode; 141 | data['truckModelCode'] = this.truckModelCode; 142 | data['truckTowWeightUnitCode'] = this.truckTowWeightUnitCode; 143 | data['synchronousId'] = this.synchronousId; 144 | data['regTonnageUnitCode'] = this.regTonnageUnitCode; 145 | data['updateTime'] = this.updateTime; 146 | data['updateUserCode'] = this.updateUserCode; 147 | data['deleted'] = this.deleted; 148 | data['ownerOrgCode'] = this.ownerOrgCode; 149 | data['regTonnage'] = this.regTonnage; 150 | data['createTime'] = this.createTime; 151 | data['truckLicenseType'] = this.truckLicenseType; 152 | data['truckModelName'] = this.truckModelName; 153 | data['creatorUsername'] = this.creatorUsername; 154 | data['updateUsername'] = this.updateUsername; 155 | data['truckTotalWeightUnitCode'] = this.truckTotalWeightUnitCode; 156 | data['truckLength'] = this.truckLength; 157 | data['truckLicenseNo'] = this.truckLicenseNo; 158 | data['isTrailer'] = this.isTrailer; 159 | return data; 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /lib/pages/all_waybill_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import 'package:flutter_easyrefresh/easy_refresh.dart'; 4 | import '../common/service_method.dart'; 5 | import '../common/util.dart'; 6 | import '../mode/waybill_list_mode.dart'; 7 | import '../components/progressDialog.dart'; 8 | import '../pages/waybill_detail_page.dart'; 9 | 10 | class AllWaybillPage extends StatefulWidget { 11 | _AllWaybillPageState createState() => _AllWaybillPageState(); 12 | } 13 | 14 | class _AllWaybillPageState extends State { 15 | GlobalKey _footerKey = new GlobalKey(); 16 | GlobalKey _headerKey = new GlobalKey(); 17 | List waybillList = []; 18 | int page = 1; 19 | int size = 10; 20 | Map actionObj = {}; 21 | bool _loading = false; 22 | void initState() { 23 | super.initState(); 24 | _loading = true; 25 | _getWaybillList(); 26 | } 27 | @override 28 | Widget build(BuildContext context) { 29 | return Scaffold( 30 | appBar: AppBar( title: Text('历史运单')), 31 | body: ProgressDialog( 32 | loading: _loading, 33 | msg: '正在加载', 34 | child: Container( 35 | child: EasyRefresh( 36 | child: waybillList.length > 0 37 | ? ListView.builder( 38 | itemCount: waybillList.length, 39 | itemBuilder: (BuildContext context, int index) { 40 | return waybillItem(index); 41 | }, 42 | ) 43 | :Center(child: Padding(child: Text('暂无运单',style: TextStyle(fontSize: ScreenUtil().setSp(40)),),padding: EdgeInsets.only(top: 200))), 44 | loadMore: (){ 45 | _getWaybillList(); 46 | }, 47 | onRefresh: (){ 48 | page = 1; 49 | waybillList = []; 50 | _getWaybillList(); 51 | }, 52 | refreshFooter: ClassicsFooter( 53 | key: _footerKey, 54 | bgColor: Colors.white, 55 | textColor: Colors.black26, 56 | moreInfoColor: Colors.black26, 57 | showMore: false, 58 | noMoreText: '没有更多', 59 | moreInfo: ' ', 60 | loadText: '上拉加载', 61 | loadReadyText: '上拉加载', 62 | loadedText: '加载完成', 63 | loadingText: '加载中' 64 | ), 65 | refreshHeader: ClassicsHeader( 66 | key: _headerKey, 67 | bgColor: Colors.white, 68 | textColor: Colors.black26, 69 | moreInfoColor: Colors.black26, 70 | showMore: true, 71 | moreInfo: '加载中', 72 | refreshReadyText: '下拉刷新', 73 | refreshedText: '刷新完成', 74 | ), 75 | ), 76 | ), 77 | ) 78 | 79 | ); 80 | } 81 | Widget waybillItem(index) { 82 | return InkWell( 83 | child: Container( 84 | margin: EdgeInsets.only(bottom: 10.0), 85 | padding: EdgeInsets.all(10.0), 86 | // height: 200, 87 | decoration: BoxDecoration( 88 | border: Border(bottom: BorderSide(width: 1,color: Color(0XFFCCCCCC)),top: BorderSide(width: 1,color: Color(0xFFCCCCCC))), 89 | color: Color(0xFFFFFFFF) 90 | ), 91 | child: Column( 92 | children: [ 93 | lineRouteWidget(index), 94 | Row(children: [Text('${waybillList[index].loadingOrgName} —— ${waybillList[index].unloadingOrgName}', style: TextStyle(fontSize: ScreenUtil().setSp(28),height: 1.6),)],), 95 | Row(children: [ 96 | Container( 97 | constraints: BoxConstraints(maxWidth: ScreenUtil().setWidth(240)), 98 | child: Text('${waybillList[index].goodsName} ',style: TextStyle(fontSize: ScreenUtil().setSp(28),height: 1.6),maxLines: 1, overflow: TextOverflow.ellipsis,), 99 | ), 100 | Text( waybillList[index]?.driverPrice != null?' ${waybillList[index].driverPrice}${unit[waybillList[index].meterageType]['driver.price'][waybillList[index].driverPriceUnitCode]}' : ' ',style: TextStyle(fontSize: ScreenUtil().setSp(28),height: 1.6)) 101 | ],), 102 | Row(children: [ 103 | Text('${waybillList[index].truckLicenseNo}',style: TextStyle(fontSize: ScreenUtil().setSp(28),height: 1.6)), 104 | Text(' 派车时间: ${waybillList[index].createTime}',style: TextStyle(fontSize: ScreenUtil().setSp(28),height: 1.6)) 105 | ],), 106 | Divider(color: Color(0xFFCCCCCC),), 107 | Container( 108 | height: ScreenUtil().setHeight(70), 109 | child: Row( 110 | mainAxisAlignment: MainAxisAlignment.end, 111 | children: [Text('')] 112 | ), 113 | ) 114 | ], 115 | ), 116 | ), 117 | onTap: (){ 118 | Navigator.push(context, MaterialPageRoute(builder: (context){ 119 | return WaybillDetailPage(code: waybillList[index].code,); 120 | })); 121 | }, 122 | ); 123 | } 124 | Widget lineRouteWidget(int index){ 125 | return Container( 126 | padding: EdgeInsets.only(bottom: 10.0), 127 | decoration: BoxDecoration( 128 | border: Border(bottom: BorderSide(width: 1,color: Color(0xFFF2F2F2))), 129 | ), 130 | child: Row( 131 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 132 | children: [ 133 | waybillList[index].routeName != null 134 | ? Container( 135 | constraints: BoxConstraints(maxWidth: ScreenUtil().setWidth(500)), 136 | child: Text(waybillList[index].routeName,style: TextStyle(fontSize: ScreenUtil().setSp(30),),maxLines: 1,overflow: TextOverflow.ellipsis,), 137 | ) 138 | : Row( 139 | children: [ 140 | Container( 141 | width: ScreenUtil().setWidth(210), 142 | child: Text("${waybillList[index].loadingCityName} ${waybillList[index].loadingCountyName}",style: TextStyle(fontSize: ScreenUtil().setSp(30),),maxLines: 1,overflow: TextOverflow.ellipsis,) 143 | ), 144 | Image.asset('assets/images/big_arrow.png'), 145 | Container( 146 | width: ScreenUtil().setWidth(210), 147 | child:Text("${waybillList[index].unloadingCityName} ${waybillList[index].unloadingCountyName}",style: TextStyle(fontSize: ScreenUtil().setSp(30),),maxLines: 1,overflow: TextOverflow.ellipsis,) 148 | ), 149 | 150 | ], 151 | ), 152 | Text("${waybillStatus[waybillList[index].waybillStatus]}",style: TextStyle(fontWeight: FontWeight.bold, fontSize: ScreenUtil().setSp(32),color: Theme.of(context).primaryColor),) 153 | ], 154 | ), 155 | ); 156 | } 157 | 158 | Widget minButton( String title, bool isMainColor, Function change) { 159 | return InkWell( 160 | child: Container( 161 | width: ScreenUtil().setWidth(200), 162 | height: ScreenUtil().setHeight(70), 163 | decoration: BoxDecoration( 164 | color: isMainColor? Theme.of(context).primaryColor :Color(0xFFFFFFFF), 165 | borderRadius: BorderRadius.circular(5.0), 166 | border: Border.all(width:1, color: isMainColor? Theme.of(context).primaryColor : Color(0xFFCCCCCC)) 167 | ), 168 | child: Center( 169 | child: Text(title, style: TextStyle(color: isMainColor? Color(0xFFFFFFFF) :Color(0xFF454545)),), 170 | ), 171 | ), 172 | onTap: change, 173 | ); 174 | } 175 | _getWaybillList() {//获取运单列表 176 | String stringParams = '?waybillStatus=finish,cancel&page=$page&size=$size'; 177 | getAjax('waybillList', stringParams, context).then((res){ 178 | setState(() { 179 | _loading = false; 180 | }); 181 | WaybillListMode waybilllistmode =WaybillListMode.fromJson(res); 182 | if(waybilllistmode.code == 200 && waybilllistmode.content.length > 0) { 183 | setState(() { 184 | waybillList.addAll(waybilllistmode.content); 185 | 186 | }); 187 | page++; 188 | String waybillCodeList = ''; 189 | List codeList = []; 190 | waybillList.forEach((item){ 191 | codeList.add(item.code); 192 | }); 193 | waybillCodeList = codeList.join(','); 194 | print(waybillCodeList); 195 | }else if(waybilllistmode.code == 200 && page == 1){ 196 | waybillList = []; 197 | } 198 | }); 199 | } 200 | @override 201 | void dispose() { 202 | waybillList = []; 203 | actionObj = {}; 204 | super.dispose(); 205 | } 206 | } -------------------------------------------------------------------------------- /lib/pages/bank_card_list_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import '../common/service_method.dart'; 4 | import '../pages/add_bank_card_page.dart'; 5 | import '../pages/manage_bank_card_page.dart'; 6 | 7 | class BankCardListPage extends StatefulWidget { 8 | @override 9 | _BankCardListPageState createState() => _BankCardListPageState(); 10 | } 11 | 12 | class _BankCardListPageState extends State { 13 | List cardList = []; 14 | @override 15 | void initState() { 16 | super.initState(); 17 | _getBankCardList(); 18 | } 19 | @override 20 | Widget build(BuildContext context) { 21 | return Scaffold( 22 | appBar: AppBar(title: Text('我的银行卡'),), 23 | body: SingleChildScrollView( 24 | child: Container( 25 | padding: EdgeInsets.only(left:10,right:10,top:10,bottom: 20), 26 | child: Column( 27 | children: [ 28 | bankCardList(), 29 | addBankCard(), 30 | Padding(child: null,padding: EdgeInsets.only(top: 20),), 31 | manageBankCard(), 32 | ], 33 | ), 34 | ), 35 | ) 36 | ); 37 | } 38 | Widget bankCardList() { 39 | return Container( 40 | child: Column( 41 | children: cardList.length > 0 42 | ? cardList.map((item){ 43 | return bankCardItem(item); 44 | }).toList() 45 | : [] 46 | ), 47 | ); 48 | } 49 | Widget bankCardItem(Map item) { 50 | return Padding( 51 | child: Stack( 52 | children: [ 53 | Image.asset('assets/images/bank_bg.png'), 54 | Positioned( 55 | left: 20, 56 | top: 26, 57 | child: Text('${item['realAccountName'] != null? item['realAccountName'].replaceRange(0,1,'*') : ''}',style: TextStyle(fontSize: ScreenUtil().setSp(34),color: Colors.white),), 58 | ), 59 | Positioned( 60 | left: 20, 61 | top: 60, 62 | child: Text('${item['bankName'] != null? item['bankName'] : ''}',style: TextStyle(fontSize: ScreenUtil().setSp(34),color: Colors.white)), 63 | ), 64 | Positioned( 65 | left: 20, 66 | top: 90, 67 | child: Row( 68 | children: [ 69 | Padding( 70 | child: Text('**** **** **** ',style: TextStyle(fontSize: ScreenUtil().setSp(34),color: Colors.white)), 71 | padding: EdgeInsets.only(top:4), 72 | ), 73 | Text('${item['realAccount'] != null? item['realAccount'].substring(item['realAccount'].length-4) : ''}',style: TextStyle(fontSize: ScreenUtil().setSp(34),color: Colors.white)), 74 | 75 | ], 76 | ), 77 | ) 78 | ], 79 | ), 80 | padding: EdgeInsets.only(bottom: 10), 81 | ); 82 | } 83 | Widget addBankCard() { 84 | return InkWell( 85 | child: Container( 86 | margin: EdgeInsets.only(top: 10), 87 | height: ScreenUtil().setHeight(240), 88 | decoration: BoxDecoration( 89 | border: Border.all(width: 1,color: Color(0xFFCCCCCC),style: BorderStyle.solid), 90 | borderRadius: BorderRadius.circular(5) 91 | ), 92 | child: Center( 93 | child: Row( 94 | mainAxisAlignment: MainAxisAlignment.center, 95 | children: [ 96 | Text('+ ',style: TextStyle(fontSize: ScreenUtil().setSp(70),color: Color(0xFF888888)),), 97 | Text('添加银行卡',style: TextStyle(fontSize: ScreenUtil().setSp(34),color: Color(0xFF888888))) 98 | ], 99 | ), 100 | ), 101 | ), 102 | onTap: (){ 103 | Navigator.push(context, MaterialPageRoute(builder: (context){ 104 | return AddBankCardPage(); 105 | })).then((res){ 106 | if(res == 'add'){ 107 | cardList = []; 108 | _getBankCardList(); 109 | } 110 | }); 111 | }, 112 | ); 113 | } 114 | Widget manageBankCard() { 115 | return InkWell( 116 | child: Container( 117 | height: ScreenUtil().setHeight(80), 118 | decoration: BoxDecoration( 119 | border: Border.all(width: 1, color: Color(0xFFCCCCCC)), 120 | borderRadius: BorderRadius.circular(5) 121 | ), 122 | child: Center( 123 | child: Text('管理银行卡',style: TextStyle(fontSize: ScreenUtil().setSp(34),color: Color(0xFF888888))), 124 | ), 125 | ), 126 | onTap: (){ 127 | Navigator.push(context, MaterialPageRoute(builder: (context){ 128 | return ManageBankCardPage(); 129 | })).then((res){ 130 | cardList = []; 131 | _getBankCardList(); 132 | }); 133 | }, 134 | ); 135 | } 136 | _getBankCardList() {//获取绑定的银行卡列表 137 | postAjax('mobileBankCardList', {}, context).then((res){ 138 | if(res['code'] == 200 && res['content'] != null && res['content'].length > 0) { 139 | setState(() { 140 | cardList = res['content']; 141 | }); 142 | }else{ 143 | setState(() { 144 | cardList = []; 145 | }); 146 | } 147 | }); 148 | } 149 | @override 150 | void dispose() { 151 | cardList = []; 152 | super.dispose(); 153 | } 154 | } -------------------------------------------------------------------------------- /lib/pages/bank_card_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import '../common/service_method.dart'; 4 | import '../mode/bank_card_mode.dart'; 5 | import 'dart:convert'; 6 | import 'package:shared_preferences/shared_preferences.dart'; 7 | import '../mode/bank_card_add_mode.dart'; 8 | import '../components/toast.dart'; 9 | 10 | class BankCardPage extends StatefulWidget { 11 | @override 12 | _BankCardPageState createState() => _BankCardPageState(); 13 | } 14 | 15 | class _BankCardPageState extends State { 16 | TextEditingController bankNameController = TextEditingController(); 17 | TextEditingController userNameController = TextEditingController(); 18 | TextEditingController accountNumberController = TextEditingController(); 19 | TextEditingController descriptionController = TextEditingController(); 20 | BankCardContent bankCardMessage; 21 | bool isEdite = false; 22 | @override 23 | void initState() { 24 | super.initState(); 25 | _getBankCardMessage(); 26 | } 27 | @override 28 | Widget build(BuildContext context) { 29 | return Scaffold( 30 | appBar: AppBar(title: Text('我的银行卡'),), 31 | body: SingleChildScrollView( 32 | child: Container( 33 | height: MediaQuery.of(context).size.height, 34 | color: Color(0xFFF2F2F2), 35 | padding: EdgeInsets.only(top: 10), 36 | child: Column( 37 | children: [ 38 | liItem( '我的开户行',bankNameController, '我的开户行', false, 'text', (){}), 39 | liItem('我的银行户名',userNameController, '我的银行户名', false, 'text', (){}), 40 | liItem('我的银行账户',accountNumberController, '我的银行账号', false, 'text', (){}), 41 | liItem('描述',descriptionController, '描述', false, 'text', (){}), 42 | Container(child: null,height: ScreenUtil().setHeight(100),), 43 | commonButton('确认保存',(){ 44 | _setBankCardMessage(); 45 | }) 46 | ], 47 | ), 48 | ), 49 | ) 50 | ); 51 | } 52 | 53 | Widget liItem( String leadingTitle,TextEditingController controller, String hintText, bool obscureText, String inputType, Function change) { 54 | return Container( 55 | height: ScreenUtil().setHeight(100), 56 | padding: EdgeInsets.only(left: 10, right:10), 57 | decoration: BoxDecoration( 58 | border: Border(bottom: BorderSide(width: 1,color: Color(0xFFF2F2F2))), 59 | color: Colors.white 60 | ), 61 | child: Row( 62 | children: [ 63 | Container( 64 | width: ScreenUtil().setWidth(220), 65 | child: Text(leadingTitle,style: TextStyle(fontSize: ScreenUtil().setSp(30),color: Color(0xFF666666)),), 66 | ), 67 | Expanded( 68 | flex: 1, 69 | child: _inputWidget(controller, hintText, obscureText, inputType, change), 70 | ) 71 | ], 72 | ), 73 | ); 74 | } 75 | Widget _inputWidget(TextEditingController controller, String hintText, bool obscureText, String inputType, Function change){ 76 | return Container( 77 | padding: EdgeInsets.only(left: 5.0), 78 | child: TextField( 79 | controller: controller, 80 | decoration: InputDecoration( 81 | hintText: hintText, 82 | border: OutlineInputBorder( 83 | borderRadius: BorderRadius.circular(3.0), 84 | borderSide: BorderSide(color: Colors.transparent) 85 | ), 86 | disabledBorder: InputBorder.none, 87 | enabledBorder:InputBorder.none, 88 | focusedBorder:InputBorder.none 89 | ), 90 | cursorColor: Colors.black, 91 | obscureText: obscureText, 92 | keyboardType:inputType == 'number'? TextInputType.number : TextInputType.text, 93 | onChanged: (text){ 94 | return change(text); 95 | }, 96 | ), 97 | ); 98 | } 99 | Widget commonButton(String title, Function success) { 100 | return InkWell( 101 | child: Container( 102 | width: ScreenUtil().setWidth(500), 103 | height: ScreenUtil().setHeight(90), 104 | decoration: BoxDecoration( 105 | color: Theme.of(context).primaryColor, 106 | borderRadius: BorderRadius.circular(5) 107 | ), 108 | child: Center( 109 | child: Text(title,style: TextStyle(fontSize: ScreenUtil().setSp(32),color: Colors.white),), 110 | ), 111 | ), 112 | onTap: success, 113 | ); 114 | } 115 | _getBankCardMessage() { 116 | getAjax('myBankCardAccount', '', context).then((res){ 117 | BankCardMode bankCardObj =BankCardMode.fromJson(res); 118 | if(bankCardObj.code == 200 && bankCardObj.content.bankName != null) { 119 | setState(() { 120 | isEdite = true; 121 | bankCardMessage = bankCardObj.content; 122 | bankNameController.text = bankCardMessage.bankName; 123 | userNameController.text = bankCardMessage.bankAccountName; 124 | accountNumberController.text = bankCardMessage.bankAccountNo; 125 | descriptionController.text = bankCardMessage.description; 126 | }); 127 | }else{ 128 | isEdite = false; 129 | } 130 | }); 131 | } 132 | _setBankCardMessage()async { 133 | RegExp regM = RegExp(r'(^([\u4e00-\u9fa5]){2,7}$)');//校验中文 134 | SharedPreferences pref = await SharedPreferences.getInstance(); 135 | Map selfObj = json.decode(pref.getString('selfObj')); 136 | String personCode = selfObj['code']; 137 | String bankName = bankNameController.text.trim(); 138 | String bankAccountName = userNameController.text.trim(); 139 | String bankAccountNo = accountNumberController.text.trim(); 140 | String description = descriptionController.text.trim(); 141 | if(!regM.hasMatch(bankAccountName)) { 142 | return Toast.toast(context, '银行户名不正确'); 143 | } 144 | if(bankAccountNo == ''){ 145 | return Toast.toast(context, '请输入银行账号'); 146 | } 147 | Map params = {}; 148 | params['personCode'] = personCode; 149 | params['bankName'] = bankName; 150 | params['bankAccountName'] = bankAccountName; 151 | params['bankAccountNo'] = bankAccountNo; 152 | params['description'] = description; 153 | print(params); 154 | if(isEdite){ 155 | _editeBankCardMessage(params); 156 | }else{ 157 | _addBankCardMessage(params); 158 | } 159 | } 160 | _addBankCardMessage(Map params) { 161 | postAjax('myBankCardAccountAdd', params, context).then((res){ 162 | BankCardAddMode data = BankCardAddMode.fromJson(res); 163 | if(data.code == 200) { 164 | Toast.toast(context, '新增成功'); 165 | Future.delayed(Duration(milliseconds: 1000), (){ 166 | return Navigator.pop(context); 167 | }); 168 | } 169 | }); 170 | } 171 | _editeBankCardMessage(Map params) { 172 | postAjax('myBankCardAccountEdit', params, context).then((res){ 173 | BankCardAddMode data = BankCardAddMode.fromJson(res); 174 | if(data.code == 200) { 175 | Toast.toast(context, '编辑成功'); 176 | } 177 | Future.delayed(Duration(milliseconds: 1000),()=> Navigator.pop(context)); 178 | }); 179 | } 180 | 181 | @override 182 | void dispose() { 183 | bankCardMessage = null; 184 | bankNameController = null; 185 | userNameController = null; 186 | accountNumberController = null; 187 | descriptionController = null; 188 | super.dispose(); 189 | } 190 | } -------------------------------------------------------------------------------- /lib/pages/find_password.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import '../common/service_method.dart'; 4 | import '../components/toast.dart'; 5 | import 'dart:async'; 6 | 7 | class FindPassword extends StatefulWidget { 8 | _FindPasswordState createState() => _FindPasswordState(); 9 | } 10 | 11 | class _FindPasswordState extends State { 12 | TextEditingController phoneController =TextEditingController(); 13 | TextEditingController codeController =TextEditingController(); 14 | TextEditingController passwordController =TextEditingController(); 15 | String newPassword = ''; 16 | String mobilePhone = ''; 17 | String verificationCode = ''; 18 | bool isGetVerifyCode = false; 19 | Timer _countdownTimer; 20 | String _codeCountdownStr = '获取验证码'; 21 | int _countdownNum = 59; 22 | @override 23 | Widget build(BuildContext context) { 24 | return Scaffold( 25 | appBar: AppBar(title: Text('找回密码'),), 26 | body: Container( 27 | color: Color(0xFFF2F2F2), 28 | child: Column( 29 | children: [ 30 | itemInputWidget('手机号', phoneController, '请输入手机号', false, 'number',(res){ 31 | mobilePhone = res; 32 | }), 33 | Container( 34 | padding: EdgeInsets.only(left: 10,), 35 | height: ScreenUtil().setHeight(100), 36 | decoration: BoxDecoration( 37 | border: Border(bottom: BorderSide(width: 1, color: Color(0xFFCCCCCC))), 38 | color: Color(0xFFFFFFFF) 39 | ), 40 | child: Row( 41 | mainAxisAlignment: MainAxisAlignment.start, 42 | children: [ 43 | Text('验证码'), 44 | Expanded( 45 | child: _inputWidget(codeController, '请输入验证码', false, 'number', (res){ 46 | verificationCode = res; 47 | }), 48 | ), 49 | isGetVerifyCode == false 50 | ? InkWell( 51 | child: Container( 52 | decoration: BoxDecoration( 53 | border: Border(left: BorderSide(width: 1,color: Color(0xFFCCCCCC))), 54 | color: Color(0xFFDDDDDD) 55 | ), 56 | width: ScreenUtil().setWidth(200), 57 | child: Center( 58 | child: Text('获取验证码'), 59 | ), 60 | ), 61 | onTap: (){ 62 | _getVerifyCode(); 63 | }, 64 | ) 65 | : Container( 66 | decoration: BoxDecoration( 67 | border: Border(left: BorderSide(width: 1,color: Color(0xFFCCCCCC))), 68 | color: Color(0xFFDDDDDD) 69 | ), 70 | width: ScreenUtil().setWidth(200), 71 | child: Center( 72 | child: Text(_codeCountdownStr, style: TextStyle(color: Color(0XFF666666)),), 73 | ), 74 | ) 75 | 76 | 77 | ], 78 | ), 79 | ), 80 | itemInputWidget('新密码', passwordController, '请输入密码', true, 'text',(res){ 81 | newPassword = res; 82 | }), 83 | Padding(child: null,padding: EdgeInsets.only(top: 100),), 84 | InkWell( 85 | child: Container( 86 | width: ScreenUtil().setWidth(400), 87 | height: ScreenUtil().setHeight(80), 88 | decoration: BoxDecoration( 89 | color: Theme.of(context).primaryColor, 90 | borderRadius: BorderRadius.circular(5) 91 | ), 92 | child: Center( 93 | child: Text('重置密码',style: TextStyle(fontSize: ScreenUtil().setSp(30),color: Colors.white),), 94 | ), 95 | ), 96 | onTap: _checkParams, 97 | ) 98 | ], 99 | ) 100 | ), 101 | ); 102 | } 103 | Widget itemInputWidget(String title, TextEditingController controller, String hintText,bool obscureText, String inputType, Function change) { 104 | return Container( 105 | padding: EdgeInsets.only(left: 10, right:10), 106 | height: ScreenUtil().setHeight(100), 107 | decoration: BoxDecoration( 108 | border: Border(bottom: BorderSide(width: 1, color: Color(0xFFCCCCCC))), 109 | color: Color(0xFFFFFFFF) 110 | ), 111 | child: Row( 112 | mainAxisAlignment: MainAxisAlignment.start, 113 | children: [ 114 | Text(title), 115 | Expanded( 116 | child: _inputWidget(controller, hintText, obscureText, inputType, change), 117 | ) 118 | 119 | ], 120 | ), 121 | ); 122 | } 123 | Widget _inputWidget(TextEditingController controller, String hintText, bool obscureText, String inputType, Function change){ 124 | return Container( 125 | margin: EdgeInsets.only(left: 20.0, right: 20.0,), 126 | padding: EdgeInsets.only(left: 5.0), 127 | child: TextField( 128 | controller: controller, 129 | decoration: InputDecoration( 130 | hintText: hintText, 131 | border: OutlineInputBorder( 132 | borderRadius: BorderRadius.circular(3.0), 133 | borderSide: BorderSide(color: Colors.transparent) 134 | ), 135 | disabledBorder: InputBorder.none, 136 | enabledBorder:InputBorder.none, 137 | focusedBorder:InputBorder.none 138 | ), 139 | cursorColor: Colors.black, 140 | obscureText: obscureText, 141 | keyboardType:inputType == 'number'? TextInputType.number : TextInputType.text, 142 | onChanged: (text){ 143 | return change(text); 144 | }, 145 | ), 146 | ); 147 | } 148 | _checkParams() { 149 | if(mobilePhone == '') { 150 | return Toast.toast(context, '请输入手号'); 151 | } 152 | if(verificationCode == '') { 153 | return Toast.toast(context, '请输入验证码'); 154 | } 155 | if(newPassword == '') { 156 | return Toast.toast(context, '请输入密码'); 157 | } 158 | _resetPassord(); 159 | } 160 | _resetPassord() {//重置密码 161 | Map params = { 162 | 'newPassword': newPassword.trim(), 163 | 'mobilePhone': mobilePhone.trim(), 164 | 'verificationCode': verificationCode.trim() 165 | }; 166 | postAjax('resetPassword', params, context).then((res){ 167 | if(res != '' && res['code'] == 200) { 168 | Toast.toast(context, '修改成功'); 169 | Future.delayed(Duration(milliseconds: 1000),() => Navigator.pop(context)); 170 | } 171 | }); 172 | } 173 | _getVerifyCode() {//获取手机验证码 174 | RegExp regM = RegExp(r'(^1[23456789]{1}\d{9}$)');//匹配手机号 175 | if(regM.hasMatch(mobilePhone.trim())){ 176 | postAjax('resetVerifyCode', {'mobilePhone':mobilePhone}, context).then((res){ 177 | print(res); 178 | if(res['code'] == 200) { 179 | reGetCountdown(); 180 | setState(() { 181 | isGetVerifyCode = true; 182 | }); 183 | } 184 | }); 185 | }else{ 186 | Toast.toast(context, '手机号不正确'); 187 | } 188 | } 189 | 190 | void reGetCountdown() {//倒计时 191 | setState(() { 192 | if (_countdownTimer != null) { 193 | return; 194 | } 195 | // Timer的第一秒倒计时是有一点延迟的,为了立刻显示效果可以添加下一行。 196 | _codeCountdownStr = '${_countdownNum--}秒重新获取'; 197 | _countdownTimer = 198 | new Timer.periodic(new Duration(seconds: 1), (timer) { 199 | setState(() { 200 | if (_countdownNum > 0) { 201 | _codeCountdownStr = '${_countdownNum--}秒重新获取'; 202 | } else { 203 | _codeCountdownStr = '获取验证码'; 204 | _countdownNum = 59; 205 | _countdownTimer.cancel(); 206 | _countdownTimer = null; 207 | isGetVerifyCode = false; 208 | } 209 | }); 210 | }); 211 | }); 212 | } 213 | // 在这里释放掉Timer 214 | @override 215 | void dispose() { 216 | _countdownTimer?.cancel(); 217 | _countdownTimer = null; 218 | super.dispose(); 219 | } 220 | } -------------------------------------------------------------------------------- /lib/pages/index_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import './resource_page.dart'; 4 | import './waybill_page.dart'; 5 | import './mine_page.dart'; 6 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 7 | 8 | class IndexPage extends StatefulWidget { 9 | 10 | _IndexPageState createState() => _IndexPageState(); 11 | } 12 | 13 | class _IndexPageState extends State { 14 | final List bottomTabs = [ 15 | BottomNavigationBarItem( 16 | icon: Icon(Icons.menu), 17 | title: Text('货源') 18 | ), 19 | BottomNavigationBarItem( 20 | icon: Icon(Icons.library_books), 21 | title: Text('运单') 22 | ), 23 | BottomNavigationBarItem( 24 | icon: Icon(Icons.person), 25 | title: Text('我') 26 | ), 27 | ]; 28 | 29 | final List tabBodies = [ 30 | ResourcePage(), 31 | WaybillPage(), 32 | MinePage(), 33 | ]; 34 | int currentIndex = 0; 35 | var currentPage; 36 | 37 | @override 38 | void initState() { 39 | currentPage = tabBodies[currentIndex]; 40 | super.initState(); 41 | } 42 | @override 43 | Widget build(BuildContext context) { 44 | ScreenUtil.instance =ScreenUtil(width: 750, height: 1334)..init(context); 45 | return Scaffold( 46 | backgroundColor: Color.fromRGBO(244, 245, 245, 1.0), 47 | bottomNavigationBar: BottomNavigationBar( 48 | type: BottomNavigationBarType.fixed, 49 | currentIndex: currentIndex, 50 | items: bottomTabs, 51 | onTap: (index) { 52 | setState(() { 53 | currentIndex = index; 54 | currentPage = tabBodies[currentIndex]; 55 | }); 56 | }, 57 | ), 58 | body: currentPage, 59 | ); 60 | } 61 | } -------------------------------------------------------------------------------- /lib/pages/join_company.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import '../common/service_method.dart'; 4 | import '../mode/join_company_list_mode.dart'; 5 | import '../components/show_modal.dart'; 6 | import '../config/service_url.dart'; 7 | import '../mode/search_join_company_list.dart'; 8 | import '../components/toast.dart'; 9 | 10 | class JoinCompanyPage extends StatefulWidget { 11 | @override 12 | _JoinCompanyPageState createState() => _JoinCompanyPageState(); 13 | } 14 | 15 | class _JoinCompanyPageState extends State { 16 | TextEditingController companyController =TextEditingController(); 17 | List companyList = []; 18 | String orgCode = ''; 19 | List searchResultList = []; 20 | @override 21 | void initState() { 22 | super.initState(); 23 | _getJoinCompanyList(); 24 | } 25 | @override 26 | Widget build(BuildContext context) { 27 | return Scaffold( 28 | appBar: AppBar(title: Text('挂靠公司'),), 29 | body: SingleChildScrollView( 30 | child: Container( 31 | color: Color(0xFFF2F2F2), 32 | child: Column( 33 | children: [ 34 | companyListWidget(), 35 | addCompanyWidget(companyController, '请输入公司名称', false, 'text', (res){ 36 | _getPartnerList(res); 37 | }) 38 | ], 39 | ), 40 | ), 41 | ) 42 | ); 43 | } 44 | Widget companyListWidget() { 45 | return LimitedBox( 46 | maxHeight: ScreenUtil().setHeight(500), 47 | child: Container( 48 | child: SingleChildScrollView( 49 | child: Column( 50 | children: companyList.length > 0 51 | ? companyList.map((item){ 52 | return conpanyItem(item); 53 | }).toList() 54 | : [] 55 | ) 56 | ) 57 | ), 58 | ); 59 | } 60 | Widget conpanyItem(item) { 61 | return Container( 62 | padding: EdgeInsets.only(left: 10, right:10), 63 | margin: EdgeInsets.only(top: 10), 64 | decoration: BoxDecoration( 65 | color: Colors.white, 66 | border: Border(top: BorderSide(width: 1, color: Color(0xFFCCCCCC)),bottom: BorderSide(width: 1, color: Color(0xFFCCCCCC))) 67 | ), 68 | height: ScreenUtil().setHeight(100), 69 | child: Row( 70 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 71 | children: [ 72 | Text(item?.orgFullName != null? item.orgFullName : ''), 73 | Switch(value: true,onChanged: (value){ 74 | _bindCancel(item?.code); 75 | },) 76 | ], 77 | ), 78 | ); 79 | } 80 | Widget addCompanyWidget(TextEditingController controller, String hintText, bool obscureText, String inputType, Function change) { 81 | return Container( 82 | color: Colors.white, 83 | child: Column( 84 | children: [ 85 | _inputWidget(controller, hintText, obscureText, inputType, change), 86 | Padding(child: null,padding: EdgeInsets.only(top: 20)), 87 | searchList(), 88 | 89 | commonButton('添加', (){ 90 | _addCompany(); 91 | }), 92 | Padding( 93 | child: Text('司机和车辆将会一起挂靠到该公司, 并且可收到该公司的直接派车'), 94 | padding: EdgeInsets.only(left: 20, right: 20, bottom: 10), 95 | ) 96 | ], 97 | ), 98 | ); 99 | } 100 | Widget _inputWidget(TextEditingController controller, String hintText, bool obscureText, String inputType, Function change){ 101 | return Container( 102 | margin: EdgeInsets.only(left: 10.0, right: 10.0, top: 10.0), 103 | padding: EdgeInsets.only(left: 5.0), 104 | decoration: BoxDecoration( 105 | border: Border.all(width: 1.0, color: Colors.black54), 106 | borderRadius: BorderRadius.circular(5.0) 107 | ), 108 | child: TextField( 109 | controller: controller, 110 | decoration: InputDecoration( 111 | hintText: hintText, 112 | border: OutlineInputBorder( 113 | borderRadius: BorderRadius.circular(3.0), 114 | borderSide: BorderSide(color: Colors.transparent) 115 | ), 116 | disabledBorder: InputBorder.none, 117 | enabledBorder:InputBorder.none, 118 | focusedBorder:InputBorder.none 119 | ), 120 | cursorColor: Colors.black, 121 | obscureText: obscureText, 122 | keyboardType:inputType == 'number'? TextInputType.number : TextInputType.text, 123 | onChanged: (text){ 124 | return change(text); 125 | }, 126 | ), 127 | ); 128 | } 129 | Widget commonButton(String title, Function success) { 130 | return InkWell( 131 | child: Container( 132 | margin: EdgeInsets.all(10), 133 | width: MediaQuery.of(context).size.width, 134 | height: ScreenUtil().setHeight(90), 135 | decoration: BoxDecoration( 136 | color: Theme.of(context).primaryColor, 137 | borderRadius: BorderRadius.circular(5) 138 | ), 139 | child: Center( 140 | child: Text(title,style: TextStyle(fontSize: ScreenUtil().setSp(32),color: Colors.white),), 141 | ), 142 | ), 143 | onTap: success, 144 | ); 145 | } 146 | Widget searchList() { 147 | return LimitedBox( 148 | maxHeight: ScreenUtil().setHeight(400), 149 | child: Container( 150 | width: MediaQuery.of(context).size.width, 151 | // height: ScreenUtil().setHeight(400), 152 | decoration: BoxDecoration( 153 | border: Border(bottom: BorderSide(width: 1, color: Color(0xFFf2f2f2))) 154 | ), 155 | child: SingleChildScrollView( 156 | child: Column( 157 | crossAxisAlignment: CrossAxisAlignment.start, 158 | children: searchResultList.length > 0 159 | ? searchResultList.map((_item){ 160 | return searchItem(_item); 161 | }).toList() 162 | : [] 163 | 164 | ), 165 | ), 166 | ) 167 | ); 168 | } 169 | Widget searchItem(item) { 170 | return InkWell( 171 | child: Container( 172 | padding: EdgeInsets.only(left: 10), 173 | height: ScreenUtil().setHeight(100), 174 | decoration: BoxDecoration( 175 | border: Border(top: BorderSide(width: 1,color: Color(0xFFF2F2F2))) 176 | ), 177 | child: Row( 178 | children: [ 179 | Radio(value: item.isChoice, groupValue: true,onChanged: (value){ 180 | searchResultList.forEach((_item){ 181 | if(_item.code == item.code) { 182 | setState(() { 183 | _item.isChoice = true; 184 | }); 185 | }else{ 186 | _item.isChoice = false; 187 | } 188 | }); 189 | },), 190 | Text(item?.orgFullName != null? item.orgFullName : '') 191 | ], 192 | ) 193 | ), 194 | onTap: (){ 195 | searchResultList.forEach((_item){ 196 | if(_item.code == item.code) { 197 | setState(() { 198 | _item.isChoice = true; 199 | orgCode = _item.code; 200 | }); 201 | }else{ 202 | _item.isChoice = false; 203 | } 204 | }); 205 | }, 206 | ); 207 | } 208 | _getJoinCompanyList() {//获取已挂靠组织列表 209 | getAjax('getPertainOrg', '', context).then((res){ 210 | JoinCompanyListMode data = JoinCompanyListMode.fromJson(res); 211 | if(data.code == 200 && data.content.length > 0) { 212 | setState(() { 213 | companyList = data.content; 214 | }); 215 | } 216 | }); 217 | } 218 | _bindCancel(orgCode){ 219 | showMyCupertinoDialog(context, '提示', '确认要解除挂靠?', (res){ 220 | if(res == 'confirm'){ 221 | 222 | _cancleCompany(orgCode); 223 | } 224 | 225 | }); 226 | } 227 | _cancleCompany(orgCode) {//取消已挂靠的组织 228 | postAjaxStr('$serviceUrl/transport/transport/pertain/org/$orgCode/remove', {}, context).then((res){ 229 | if(res['code'] == 200) { 230 | 231 | _getJoinCompanyList(); 232 | } 233 | }); 234 | } 235 | _addCompany() {//添加挂靠公司 236 | if(orgCode == '' ){ 237 | return Toast.toast(context, '请选择要挂靠的公司'); 238 | } 239 | Map params = {'orgCode': orgCode}; 240 | postAjax('addCompany', params, context).then((res){ 241 | if(res['code'] == 200) { 242 | setState(() { 243 | searchResultList = []; 244 | companyController.text = ''; 245 | orgCode = ''; 246 | }); 247 | _getJoinCompanyList(); 248 | 249 | } 250 | }); 251 | } 252 | _getPartnerList( String orgFullName) {//查询伙伴列表 253 | String stringParams = '?orgFullName=$orgFullName&size=100'; 254 | getAjax('manageList', stringParams, context).then((res){ 255 | SearchJoinCampanyList data = SearchJoinCampanyList.fromJson(res); 256 | if(data.code == 200 && data.content.length > 0) { 257 | setState(() { 258 | searchResultList = data.content; 259 | orgCode = ''; 260 | }); 261 | } 262 | }); 263 | } 264 | @override 265 | void dispose() { 266 | companyList = []; 267 | searchResultList = []; 268 | orgCode = ''; 269 | super.dispose(); 270 | } 271 | } -------------------------------------------------------------------------------- /lib/pages/login_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../components/toast.dart'; 3 | import 'package:dio/dio.dart'; 4 | import 'dart:io'; 5 | import '../common/util.dart'; 6 | import 'package:shared_preferences/shared_preferences.dart'; 7 | import '../pages/find_password.dart'; 8 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 9 | 10 | 11 | class LoginPage extends StatefulWidget { 12 | 13 | _LoginPageState createState() => _LoginPageState(); 14 | } 15 | 16 | class _LoginPageState extends State { 17 | TextEditingController userNameController = new TextEditingController(); 18 | TextEditingController passwordController = new TextEditingController(); 19 | String userName = ''; 20 | String password = ''; 21 | _loginAccount()async {//登录 22 | SharedPreferences prefs =await SharedPreferences.getInstance(); 23 | 24 | if(userName == '') { 25 | return Toast.toast(context, '请输入账号'); 26 | } 27 | if(password == '') { 28 | return Toast.toast(context, '请输入密码'); 29 | } 30 | try { 31 | print('获取数据'); 32 | Response response; 33 | Dio dio = new Dio(); 34 | dio.options.contentType = ContentType.parse("application/x-www-form-urlencoded"); 35 | response = await dio.post('https://rltx2-yfb-gateway.rltx.com/account/driverLogin', data: {'account':userName.trim(), 'password':password.trim()}); 36 | print(response.data['code']); 37 | if(response.data['code'] == 200) { 38 | String cookies = getCookieAndSaveInStorage(response); 39 | prefs.setString('cookies', cookies); 40 | Navigator.pushNamedAndRemoveUntil(context, '/resource', (route)=>false); 41 | }else{ 42 | Toast.toast(context, response.data['content']); 43 | } 44 | } on DioError catch (e) { 45 | if (e.response.data['code'] == 401) { 46 | Navigator.pushNamedAndRemoveUntil(context, '/login', (route)=>false); 47 | } 48 | } 49 | } 50 | @override 51 | Widget build(BuildContext context) { 52 | return Scaffold( 53 | appBar: AppBar(title: Text('登录'),), 54 | body: SingleChildScrollView( 55 | child: Container( 56 | constraints: BoxConstraints( 57 | maxHeight: MediaQuery.of(context).size.height, 58 | maxWidth: MediaQuery.of(context).size.width, 59 | ), 60 | child: Column( 61 | children: [ 62 | _logoImage(), 63 | loginWidget() 64 | ], 65 | ) 66 | ) 67 | ) 68 | ); 69 | } 70 | Widget _logoImage() { 71 | return Container( 72 | width: 200.0, 73 | margin: EdgeInsets.only(top: 60.0,bottom: 40.0), 74 | child: Center( 75 | child: Image.asset('assets/images/logo.png',width: ScreenUtil().setWidth(340),), 76 | ) 77 | ); 78 | } 79 | Widget loginWidget() { 80 | return Container( 81 | child: Center( 82 | child: Column( 83 | children: [ 84 | _inputWidget(userNameController, 'assets/images/users.png', '请输入用户名', false , 'number', (res){ 85 | setState(() { 86 | print(res); 87 | userName = res; 88 | }); 89 | }), 90 | _inputWidget(passwordController,'assets/images/password.png', '请输入密码', true, 'text', (res){ 91 | setState(() { 92 | password = res; 93 | }); 94 | }), 95 | InkWell( 96 | child: Container( 97 | width: MediaQuery.of(context).size.width, 98 | height: ScreenUtil().setHeight(100), 99 | margin: EdgeInsets.only(top: 20.0, left: 20.0,right: 20.0), 100 | decoration: BoxDecoration( 101 | color: Theme.of(context).primaryColor, 102 | borderRadius: BorderRadius.circular(5) 103 | ), 104 | child: Center( 105 | child: Text('登录', style:TextStyle(fontSize: ScreenUtil().setSp(40),color: Colors.white)), 106 | ), 107 | ), 108 | onTap: (){ 109 | _loginAccount(); 110 | }, 111 | ), 112 | Container( 113 | width: MediaQuery.of(context).size.width, 114 | margin: EdgeInsets.only(top: 10.0, left: 20.0,right: 20.0), 115 | child: Row( 116 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 117 | children: [ 118 | InkWell( 119 | child: Text('立即注册', style: TextStyle(fontSize: ScreenUtil().setSp(32),color: Colors.black26),), 120 | onTap: (){ 121 | Navigator.pushNamed(context, '/register'); 122 | }, 123 | ), 124 | InkWell( 125 | child: Text('找回密码', style: TextStyle(fontSize: ScreenUtil().setSp(32),color: Colors.black26),), 126 | onTap: (){ 127 | print('点击'); 128 | Navigator.push(context, MaterialPageRoute(builder: (context){ 129 | return FindPassword(); 130 | })); 131 | }, 132 | ) 133 | ], 134 | ) 135 | ) 136 | ], 137 | ), 138 | ) 139 | ); 140 | } 141 | Widget _inputWidget(TextEditingController controller, String imgUrl, String hintText, bool obscureText, String inputType, Function change){ 142 | return Container( 143 | margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0), 144 | padding: EdgeInsets.only(left: 5.0), 145 | decoration: BoxDecoration( 146 | border: Border.all(width: 1.0, color: Color(0xFFCCCCCC)), 147 | borderRadius: BorderRadius.circular(5.0) 148 | ), 149 | child: Row( 150 | children: [ 151 | Image.asset(imgUrl,width: ScreenUtil().setWidth(60),), 152 | Padding(child: null,padding: EdgeInsets.only(left: 10),), 153 | Expanded( 154 | child: TextField( 155 | controller: controller, 156 | decoration: InputDecoration( 157 | hintText: hintText, 158 | border: OutlineInputBorder( 159 | borderRadius: BorderRadius.circular(3.0), 160 | borderSide: BorderSide(color: Colors.transparent) 161 | ), 162 | disabledBorder: InputBorder.none, 163 | enabledBorder:InputBorder.none, 164 | focusedBorder:InputBorder.none 165 | ), 166 | cursorColor: Colors.black, 167 | obscureText: obscureText, 168 | keyboardType:inputType == 'number'? TextInputType.number : TextInputType.text, 169 | onChanged: (text){ 170 | return change(text); 171 | }, 172 | ), 173 | ) 174 | ], 175 | ), 176 | ); 177 | } 178 | 179 | } -------------------------------------------------------------------------------- /lib/pages/manage_bank_card_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import '../common/service_method.dart'; 4 | import '../components/toast.dart'; 5 | import '../components/show_modal.dart'; 6 | import '../pages/add_bank_card_page.dart'; 7 | 8 | class ManageBankCardPage extends StatefulWidget { 9 | @override 10 | _ManageBankCardPageState createState() => _ManageBankCardPageState(); 11 | } 12 | 13 | class _ManageBankCardPageState extends State { 14 | List bankCardList = []; 15 | @override 16 | void initState() { 17 | super.initState(); 18 | _getBankCardList(); 19 | } 20 | @override 21 | Widget build(BuildContext context) { 22 | return Scaffold( 23 | appBar: AppBar(title: Text('管理银行卡'),), 24 | body: Stack( 25 | children: [ 26 | SingleChildScrollView( 27 | child: ConstrainedBox( 28 | constraints: BoxConstraints( 29 | minHeight: MediaQuery.of(context).size.height-80 30 | ), 31 | child: Container( 32 | padding: EdgeInsets.only(top: 10), 33 | color: Color(0xFFF2F2F2), 34 | child: bankCardListModel(), 35 | ), 36 | ), 37 | ), 38 | Positioned( 39 | bottom: 10, 40 | left: 0, 41 | child: commonButton(), 42 | ) 43 | ], 44 | ) 45 | ); 46 | } 47 | Widget bankCardListModel() { 48 | return Container( 49 | child: Column( 50 | children: bankCardList.length > 0 51 | ? bankCardList.map((item){ 52 | return bankCardItem(item); 53 | }).toList() 54 | : [ 55 | ConstrainedBox( 56 | constraints: BoxConstraints( 57 | minHeight: MediaQuery.of(context).size.height-80 58 | ), 59 | child: Container( 60 | child: Center( 61 | child: Text('暂无银行卡',style: TextStyle(fontSize: ScreenUtil().setSp(36),color: Color(0xFF888888)),), 62 | ), 63 | ), 64 | ) 65 | ] 66 | ), 67 | ); 68 | } 69 | Widget bankCardItem(Map item) { 70 | return Container( 71 | padding: EdgeInsets.only(left: 10,right:10,bottom: 8), 72 | margin: EdgeInsets.only(bottom: 10), 73 | decoration: BoxDecoration( 74 | border: Border(top: BorderSide(width: 1,color: Color(0xFFCCCCCC)),bottom: BorderSide(width: 1,color: Color(0xFFCCCCCC))), 75 | color: Colors.white 76 | ), 77 | child: Column( 78 | children: [ 79 | Container( 80 | height: ScreenUtil().setHeight(90), 81 | child: Row( 82 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 83 | children: [ 84 | LimitedBox(child: Text(item['bankName'] != null? item['bankName'] : '',style: TextStyle(fontSize: ScreenUtil().setSp(32)),overflow: TextOverflow.ellipsis,),maxWidth: 300,), 85 | Text('尾号: ${item['realAccount'].substring(item['realAccount'].length - 4)}',style: TextStyle(fontSize: ScreenUtil().setSp(32),color:Color(0xFF888888)),) 86 | ], 87 | ), 88 | ), 89 | Divider(color: Color(0xFFCCCCCC),height:14,), 90 | Row( 91 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 92 | children: [ 93 | Container( 94 | child: Row( 95 | children: [ 96 | Radio( 97 | groupValue: true, 98 | value: item['isChoice'], 99 | onChanged: (res){ 100 | if(item['isChoice'] == false){ 101 | _setDefaultBankCard(item['realAccount']); 102 | } 103 | }, 104 | materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, 105 | ), 106 | Text('设置为默认银行卡') 107 | ], 108 | ), 109 | ), 110 | InkWell( 111 | child: Container( 112 | width: ScreenUtil().setWidth(140), 113 | height: ScreenUtil().setHeight(70), 114 | decoration: BoxDecoration( 115 | border: Border.all(width: 1,color: Color(0xFFCCCCCC)), 116 | borderRadius: BorderRadius.circular(5) 117 | ), 118 | child: Center( 119 | child: Text('删除'), 120 | ), 121 | ), 122 | onTap: (){ 123 | showMyCupertinoDialog(context, '提示', '确认删除该银行卡?', (res){ 124 | if(res == 'confirm') { 125 | _deleteBankCard(item['realAccount']); 126 | } 127 | }); 128 | }, 129 | ) 130 | ], 131 | ) 132 | ], 133 | ), 134 | ); 135 | } 136 | Widget commonButton() { 137 | return InkWell( 138 | child: Container( 139 | margin: EdgeInsets.only(left: 10,right:10), 140 | width: MediaQuery.of(context).size.width-20, 141 | height: ScreenUtil().setHeight(100), 142 | decoration: BoxDecoration( 143 | color: Theme.of(context).primaryColor, 144 | borderRadius: BorderRadius.circular(5) 145 | ), 146 | child: Center( 147 | child: Text('添加银行卡',style: TextStyle(color: Colors.white,fontSize: ScreenUtil().setSp(32)),), 148 | ), 149 | ), 150 | onTap: (){ 151 | Navigator.push(context, MaterialPageRoute(builder: (context){ 152 | return AddBankCardPage(); 153 | })); 154 | }, 155 | ); 156 | } 157 | _getBankCardList() {//获取银行卡列表 158 | postAjax('mobileBankCardList', {}, context).then((res){ 159 | if(res['code'] == 200 && res['content'] is List){ 160 | List list = res['content']; 161 | list.forEach((item){ 162 | if(item['isDefault'] != null && item['isDefault'] == 1) { 163 | item['isChoice'] = true; 164 | }else{ 165 | item['isChoice'] = false; 166 | } 167 | }); 168 | setState(() { 169 | bankCardList = list; 170 | }); 171 | } 172 | }); 173 | } 174 | _deleteBankCard(accountCode) { 175 | Map params = {}; 176 | params['accountCode'] = accountCode; 177 | postAjax('deleteBankCard', params, context).then((res){ 178 | if(res['code'] == 200){ 179 | Toast.toast(context, '删除成功'); 180 | bankCardList = []; 181 | _getBankCardList(); 182 | } 183 | }); 184 | } 185 | _setDefaultBankCard(accountCode) {//设置默认银行卡 186 | Map params = {}; 187 | params['accountCode'] = accountCode; 188 | postAjax('setDefaultBankCard', params, context).then((res){ 189 | if(res['code'] == 200) { 190 | bankCardList.forEach((item){ 191 | if(item['realAccount'] == accountCode) { 192 | setState(() { 193 | item['isChoice'] = true; 194 | }); 195 | Toast.toast(context, '设置成功'); 196 | }else{ 197 | setState(() { 198 | item['isChoice'] = false; 199 | }); 200 | 201 | } 202 | }); 203 | }else{ 204 | Toast.toast(context,res['content']); 205 | } 206 | }); 207 | } 208 | @override 209 | void dispose() { 210 | bankCardList = []; 211 | super.dispose(); 212 | } 213 | } -------------------------------------------------------------------------------- /lib/pages/mine_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import '../common/service_method.dart'; 4 | import '../components/show_modal.dart'; 5 | import '../pages/business_card.dart'; 6 | import '../pages/bank_card_page.dart'; 7 | import '../pages/join_company.dart'; 8 | import '../pages/my_oil_card_page.dart'; 9 | import '../pages/my_collect_recode_page.dart'; 10 | import '../pages/subscribe_line_route_page.dart'; 11 | import '../pages/change_phone_page.dart'; 12 | import '../pages/my_account_page.dart'; 13 | 14 | class MinePage extends StatefulWidget { 15 | _MinePageState createState() => _MinePageState(); 16 | } 17 | 18 | class _MinePageState extends State { 19 | @override 20 | Widget build(BuildContext context) { 21 | return Scaffold( 22 | appBar: AppBar(title: Text('个人中心'),), 23 | body: Container( 24 | color: Color(0xFFF2F2F2), 25 | padding: EdgeInsets.only(top: 20), 26 | child: Column( 27 | children: [ 28 | itemContent('assets/images/carte.png', '司机,车辆信息', (){ 29 | Navigator.push(context, MaterialPageRoute(builder: (context){ 30 | return BusinessCardPage(); 31 | })); 32 | }), 33 | itemContent('assets/images/bankcard.png', '我的银行卡', (){ 34 | Navigator.push(context, MaterialPageRoute(builder: (context){ 35 | return BankCardPage(); 36 | })); 37 | }), 38 | itemContent('assets/images/trading_account.png', '我的交易账户', (){ 39 | Navigator.push(context, MaterialPageRoute(builder: (context){ 40 | return MyAccountPage(); 41 | })); 42 | }), 43 | itemContent('assets/images/join.png', '挂靠公司', (){ 44 | Navigator.push(context, MaterialPageRoute(builder: (context){ 45 | return JoinCompanyPage(); 46 | })); 47 | }), 48 | itemContent('assets/images/oil_card.png', '我的油卡信息', (){ 49 | Navigator.push(context, MaterialPageRoute(builder: (context){ 50 | return MyOilCardPage(); 51 | })); 52 | }), 53 | itemContent('assets/images/mobile.png', '修改手机号', (){ 54 | Navigator.push(context, MaterialPageRoute(builder: (context){ 55 | return ChangePhonePage(); 56 | })); 57 | }), 58 | itemContent('assets/images/collection.png', '我的收藏', (){ 59 | Navigator.push(context, MaterialPageRoute(builder: (context){ 60 | return MyCollectRecodePage(); 61 | })); 62 | }), 63 | itemContent('assets/images/routeLine.png', '订阅线路', (){ 64 | Navigator.push(context, MaterialPageRoute(builder: (context){ 65 | return SubscribeLineRoutePage(); 66 | })); 67 | }), 68 | 69 | Center( 70 | child: InkWell( 71 | child: Container( 72 | width: ScreenUtil().setWidth(300), 73 | height: ScreenUtil().setHeight(80), 74 | margin: EdgeInsets.only(top: 30), 75 | decoration: BoxDecoration( 76 | color: Color(0xFFFFFFFF), 77 | border: Border.all(width: 1,color: Color(0xFFFDDDDDD)), 78 | borderRadius: BorderRadius.circular(5.0) 79 | ), 80 | child: Center( 81 | child: Text('退出登录'), 82 | ), 83 | ), 84 | onTap: (){ 85 | showMyCupertinoDialog(context, '提示', '确认退出登录?', (res){ 86 | if(res == 'confirm') { 87 | _loginOut(); 88 | } 89 | }); 90 | }, 91 | ), 92 | ) 93 | ], 94 | ), 95 | ) 96 | ); 97 | } 98 | Widget itemContent(String imageUrl, String title, Function onTap) { 99 | return InkWell( 100 | child: Container( 101 | height: ScreenUtil().setHeight(90), 102 | padding: EdgeInsets.only(left: 10,right:10), 103 | decoration: BoxDecoration( 104 | color: Color(0xFFFFFFFF), 105 | border: Border(bottom: BorderSide(width: 1, color: Color(0xFFF2F2F2))) 106 | ), 107 | child: Row( 108 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 109 | children: [ 110 | Row( 111 | children: [ 112 | Image.asset(imageUrl ,width: ScreenUtil().setWidth(60),height: ScreenUtil().setWidth(50),), 113 | Padding(child: Text(title , style: TextStyle(fontSize: ScreenUtil().setSp(30)),),padding: EdgeInsets.only(left: 10)), 114 | ], 115 | ), 116 | Image.asset('assets/images/arrow.png',width: ScreenUtil().setWidth(30),height: ScreenUtil().setHeight(30),) 117 | 118 | ], 119 | ), 120 | ), 121 | onTap: onTap, 122 | ); 123 | } 124 | void _loginOut() { 125 | getAjax('loginOut', '', context).then((res){ 126 | if(res['code'] == 200) { 127 | Navigator.pushNamedAndRemoveUntil(context, '/login', (route)=> false); 128 | } 129 | }); 130 | } 131 | } -------------------------------------------------------------------------------- /lib/pages/my_account_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import '../common/service_method.dart'; 4 | import '../pages/raise_cash_page.dart'; 5 | import '../pages/bank_card_list_page.dart'; 6 | import '../pages/trade_record_page.dart'; 7 | import '../pages/security_setting_page.dart'; 8 | 9 | class MyAccountPage extends StatefulWidget { 10 | @override 11 | _MyAccountPageState createState() => _MyAccountPageState(); 12 | } 13 | 14 | class _MyAccountPageState extends State { 15 | Map accountObj = {}; 16 | @override 17 | void initState() { 18 | super.initState(); 19 | _getAccountMessage(); 20 | } 21 | @override 22 | Widget build(BuildContext context) { 23 | return Scaffold( 24 | appBar: AppBar(title: Text('我的交易账户'),), 25 | body: Container( 26 | color: Color(0xFFF2F2F2), 27 | child: Column( 28 | children: [ 29 | accountBalanceModel(), 30 | commonItem('assets/images/bankcard.png', '我的银行卡', '${accountObj['bankCardList'] != null && accountObj['bankCardList'].length>0? accountObj['bankCardList'].length.toString() + '张' : '未绑定'}',(){ 31 | Navigator.push(context, MaterialPageRoute(builder: (context){ 32 | return BankCardListPage(); 33 | })).then((res){ 34 | accountObj = {}; 35 | _getAccountMessage(); 36 | }); 37 | }), 38 | commonItem('assets/images/transaction.png', '交易记录', '',(){ 39 | Navigator.push(context, MaterialPageRoute(builder: (context){ 40 | return TradeRecodePage(); 41 | })).then((res){ 42 | accountObj = {}; 43 | _getAccountMessage(); 44 | }); 45 | }), 46 | commonItem('assets/images/safety.png', '安全设置', '',(){ 47 | Navigator.push(context, MaterialPageRoute(builder: (context){ 48 | return SecuritySettingPage(); 49 | })).then((res){ 50 | accountObj = {}; 51 | _getAccountMessage(); 52 | }); 53 | }) 54 | ], 55 | ) 56 | ), 57 | ); 58 | } 59 | Widget accountBalanceModel() { 60 | return Container( 61 | color: Colors.orangeAccent, 62 | height: ScreenUtil().setHeight(350), 63 | child: Center( 64 | child: Column( 65 | children: [ 66 | Padding(child: null,padding: EdgeInsets.only(top: 30),), 67 | Text('账户余额',style: TextStyle(color:Colors.white,fontSize: ScreenUtil().setSp(34)),), 68 | Padding(child: null,padding: EdgeInsets.only(top: 16),), 69 | Text('¥ ${accountObj['userInfo'] !=null && accountObj['userInfo']['cash'] != null? accountObj['userInfo']['cash'].toStringAsFixed(2) : '' }',style: TextStyle(color:Colors.white,fontSize: ScreenUtil().setSp(42),fontWeight:FontWeight.bold),), 70 | Padding(child: null,padding: EdgeInsets.only(top: 16),), 71 | InkWell( 72 | child: Container( 73 | height: ScreenUtil().setHeight(60), 74 | width: ScreenUtil().setWidth(260), 75 | decoration: BoxDecoration( 76 | border: Border.all(width: 1, color: Colors.white), 77 | borderRadius: BorderRadius.all(Radius.circular(20)) 78 | ), 79 | child: Center( 80 | child: Text('提现',style: TextStyle(color:Colors.white,fontSize: ScreenUtil().setSp(34)),), 81 | ), 82 | ), 83 | onTap: (){ 84 | _bindRaiseCash(); 85 | }, 86 | ) 87 | ], 88 | ), 89 | ) 90 | ); 91 | } 92 | Widget commonItem(String imageUrl, String title, String tips, Function onTap) { 93 | return InkWell( 94 | child: Container( 95 | height: ScreenUtil().setHeight(100), 96 | padding: EdgeInsets.only(left: 10,right:10), 97 | decoration: BoxDecoration( 98 | color: Colors.white, 99 | border: Border(bottom: BorderSide(width: 1,color: Color(0xFFF2F2F2))) 100 | ), 101 | child: Row( 102 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 103 | children: [ 104 | Row( 105 | children: [ 106 | Image.asset(imageUrl,width: ScreenUtil().setWidth(52),), 107 | Padding(child: null,padding: EdgeInsets.only(left: 10)), 108 | Text(title,style: TextStyle(fontSize: ScreenUtil().setSp(32)),) 109 | ], 110 | ), 111 | Row( 112 | children: [ 113 | Text(tips != ''? tips : '',style: TextStyle(fontSize: ScreenUtil().setSp(28),color: Color(0xFF666666)),), 114 | Padding(child: null,padding: EdgeInsets.only(left: 5)), 115 | Image.asset('assets/images/arrow.png',width:ScreenUtil().setWidth(22)) 116 | ], 117 | ) 118 | ], 119 | ) 120 | ), 121 | onTap: onTap, 122 | ); 123 | } 124 | _getAccountMessage() {//获取交易账户信息 125 | postAjax('mobileUserMoney', {}, context).then((res){ 126 | if(res['code'] == 200) { 127 | setState(() { 128 | accountObj = res['content']; 129 | }); 130 | 131 | 132 | } 133 | }); 134 | } 135 | _bindRaiseCash() {//去提现 136 | if(accountObj['bankCardList'].length > 0){ 137 | Navigator.push(context, MaterialPageRoute(builder: (context){ 138 | return RaiseCashPage(cash: accountObj['userInfo']['cash'],); 139 | })).then((res){ 140 | accountObj = {}; 141 | _getAccountMessage(); 142 | }); 143 | }else{ 144 | Navigator.push(context, MaterialPageRoute(builder: (context){ 145 | return BankCardListPage(); 146 | })).then((res){ 147 | accountObj = {}; 148 | _getAccountMessage(); 149 | }); 150 | } 151 | } 152 | @override 153 | void dispose() { 154 | accountObj = null; 155 | super.dispose(); 156 | } 157 | } -------------------------------------------------------------------------------- /lib/pages/my_collect_recode_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../common/service_method.dart'; 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 | import 'package:flutter_easyrefresh/easy_refresh.dart'; 5 | import '../common/util.dart'; 6 | import '../pages/resource_detail_page.dart'; 7 | 8 | class MyCollectRecodePage extends StatefulWidget { 9 | @override 10 | _MyCollectRecodePageState createState() => _MyCollectRecodePageState(); 11 | } 12 | 13 | class _MyCollectRecodePageState extends State { 14 | GlobalKey _footerKey = new GlobalKey(); 15 | GlobalKey _headerKey = new GlobalKey(); 16 | List resourceLists = []; 17 | int page = 1; 18 | @override 19 | void initState() { 20 | super.initState(); 21 | _getCollectRecodeMessage(); 22 | } 23 | @override 24 | Widget build(BuildContext context) { 25 | return Scaffold( 26 | appBar: AppBar(title: Text('我的收藏'),), 27 | body: Container( 28 | color: Color(0xFFF2F2F2), 29 | padding: EdgeInsets.only(top: 10), 30 | child: EasyRefresh( 31 | child: resourceLists.length > 0 32 | ? ListView.builder( 33 | itemCount: resourceLists.length, 34 | itemBuilder: (BuildContext context, int index) { 35 | return resourceItem(index); 36 | }, 37 | ) 38 | : Center(child: Padding(child: Text('暂无收藏记录',style: TextStyle(fontSize: ScreenUtil().setSp(40)),),padding: EdgeInsets.only(top: 200))), 39 | loadMore: (){ 40 | _getCollectRecodeMessage(); 41 | }, 42 | onRefresh: (){ 43 | page = 1; 44 | resourceLists = []; 45 | _getCollectRecodeMessage(); 46 | }, 47 | refreshFooter: ClassicsFooter( 48 | key: _footerKey, 49 | bgColor: Colors.white, 50 | textColor: Colors.black26, 51 | moreInfoColor: Colors.black26, 52 | showMore: false, 53 | noMoreText: '', 54 | moreInfo: ' ', 55 | loadText: '上拉加载', 56 | loadReadyText: '上拉加载', 57 | loadedText: '加载完成', 58 | loadingText: '加载中' 59 | ), 60 | refreshHeader: ClassicsHeader( 61 | key: _headerKey, 62 | bgColor: Colors.white, 63 | textColor: Colors.black26, 64 | moreInfoColor: Colors.black26, 65 | showMore: true, 66 | moreInfo: '加载中', 67 | refreshReadyText: '下拉刷新', 68 | refreshedText: '刷新完成', 69 | ), 70 | ), 71 | ), 72 | ); 73 | } 74 | Widget resourceItem(int index){ 75 | return InkWell( 76 | child: Container( 77 | margin: EdgeInsets.only(bottom: 10.0), 78 | padding: EdgeInsets.all(10.0), 79 | // height: 200, 80 | decoration: BoxDecoration( 81 | border: Border(bottom: BorderSide(width: 1,color: Color(0XFFCCCCCC)),top: BorderSide(width: 1,color: Color(0xFFCCCCCC))), 82 | color: Color(0xFFFFFFFF) 83 | ), 84 | child: Column( 85 | children: [ 86 | lineRouteWidget(index), 87 | resourceLists[index]['routeName'] != null 88 | ? commonItem('线 路', "${resourceLists[index]['routeName']}") 89 | : Text('',style: TextStyle(fontSize: 0)), 90 | commonItem('货 品', "${resourceLists[index]['goodsName']}"), 91 | commonItem('司机运价', "${resourceLists[index]['quotePrice']}${unit[resourceLists[index]['meterageType']]['driver.price'][resourceLists[index]['quotePriceUnitCode']]}"), 92 | ], 93 | ), 94 | ), 95 | onTap: (){ 96 | Navigator.push(context, MaterialPageRoute(builder: (context){ 97 | return ResourceDetialPage(code: resourceLists[index]['code'],); 98 | })); 99 | }, 100 | ); 101 | } 102 | Widget lineRouteWidget(int index){ 103 | return Container( 104 | padding: EdgeInsets.only(bottom: 10.0), 105 | decoration: BoxDecoration( 106 | border: Border(bottom: BorderSide(width: 1,color: Color(0xFFF2F2F2))), 107 | ), 108 | child: Row( 109 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 110 | children: [ 111 | Row( 112 | children: [ 113 | Container( 114 | width: ScreenUtil().setWidth(210), 115 | child: Text("${resourceLists[index]['loadingCityName']} ${resourceLists[index]['loadingCountyName']}",style: TextStyle(fontSize: ScreenUtil().setSp(30),),maxLines: 1,overflow: TextOverflow.ellipsis,) 116 | ), 117 | Image.asset('assets/images/big_arrow.png'), 118 | Container( 119 | width: ScreenUtil().setWidth(210), 120 | child:Text("${resourceLists[index]['unloadingCityName']} ${resourceLists[index]['unloadingCountyName']}",style: TextStyle(fontSize: ScreenUtil().setSp(30),),maxLines: 1,overflow: TextOverflow.ellipsis,) 121 | ), 122 | 123 | ], 124 | ), 125 | Text("${resourceLists[index]['publishTime'].split(' ')[0]} ${resourceLists[index]['publishTime'].split(' ')[1].split(':')[0]}:${resourceLists[index]['publishTime'].split(' ')[1].split(':')[1]}",style: TextStyle(fontSize: ScreenUtil().setSp(28),color: Color(0xFF666666)),) 126 | 127 | ], 128 | ), 129 | ); 130 | } 131 | Widget commonItem(String title, String value) { 132 | return Container( 133 | margin: EdgeInsets.only(top: 10.0), 134 | child: Row( 135 | children: [ 136 | Container(child: Text(title,style:TextStyle(fontSize:ScreenUtil().setSp(26),color:Color(0xFF666666))),width: ScreenUtil().setWidth(140),), 137 | Text(value, style: TextStyle(fontSize: ScreenUtil().setSp(28)),) 138 | ], 139 | ), 140 | ); 141 | } 142 | _getCollectRecodeMessage() { 143 | String stringParams = '?page=$page&size=10'; 144 | getAjax('recodeList', stringParams, context).then((res){ 145 | if(res['code'] == 200 && res['content'].length > 0) { 146 | setState(() { 147 | resourceLists.addAll(res['content']); 148 | page++; 149 | }); 150 | }else if(res['code'] == 200 && page == 1){ 151 | setState(() { 152 | resourceLists = []; 153 | }); 154 | } 155 | 156 | }); 157 | } 158 | @override 159 | void dispose() { 160 | resourceLists = []; 161 | super.dispose(); 162 | } 163 | } -------------------------------------------------------------------------------- /lib/pages/my_oil_card_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import '../components/toast.dart'; 4 | import 'package:shared_preferences/shared_preferences.dart'; 5 | import '../common/service_method.dart'; 6 | import 'dart:convert'; 7 | 8 | class MyOilCardPage extends StatefulWidget { 9 | @override 10 | _MyOilCardPageState createState() => _MyOilCardPageState(); 11 | } 12 | 13 | class _MyOilCardPageState extends State { 14 | TextEditingController oilCardController = TextEditingController(); 15 | FocusNode oilCardFocusNode = FocusNode(); 16 | String oilCardNo = ''; 17 | bool enabled = false; 18 | @override 19 | void initState() { 20 | super.initState(); 21 | _getFuelCardMessage(); 22 | } 23 | @override 24 | Widget build(BuildContext context) { 25 | return Scaffold( 26 | appBar: AppBar(title: Text('我的油卡信息'),), 27 | body: Container( 28 | padding: EdgeInsets.only(top: 10), 29 | color: Color(0xFFF2F2F2), 30 | child: Column( 31 | children: [ 32 | inputOilCard('我的油卡号',oilCardController, '请输入油卡号', false, enabled, 'text',(res){ 33 | setState(() { 34 | oilCardNo = res; 35 | }); 36 | }), 37 | Padding(child: null,padding: EdgeInsets.only(top: 30),), 38 | !enabled 39 | ? commonButton('修改',(){ 40 | setState(() { 41 | enabled = true; 42 | FocusScope.of(context).requestFocus(oilCardFocusNode); 43 | }); 44 | }) 45 | : commonButton('确认保存',(){ 46 | 47 | _setFuelCardMessage(); 48 | 49 | }), 50 | 51 | ], 52 | ), 53 | ), 54 | ); 55 | } 56 | Widget inputOilCard(String title, TextEditingController controller, String hintText, bool obscureText, bool enabled, String inputType, Function change){ 57 | return Container( 58 | height: ScreenUtil().setHeight(100), 59 | padding: EdgeInsets.only(left: 10), 60 | color: Colors.white, 61 | child: Row( 62 | children: [ 63 | Text(title), 64 | Expanded( 65 | child: _inputWidget(controller, hintText, obscureText,enabled, inputType,change), 66 | ) 67 | ], 68 | ), 69 | ); 70 | } 71 | Widget _inputWidget(TextEditingController controller, String hintText, bool obscureText, bool enabled, String inputType, Function change){ 72 | return Container( 73 | padding: EdgeInsets.only(left: 5.0), 74 | child: TextField( 75 | controller: controller, 76 | decoration: InputDecoration( 77 | hintText: hintText, 78 | border: OutlineInputBorder( 79 | borderRadius: BorderRadius.circular(3.0), 80 | borderSide: BorderSide(color: Colors.transparent) 81 | ), 82 | disabledBorder: InputBorder.none, 83 | enabledBorder:InputBorder.none, 84 | focusedBorder:InputBorder.none 85 | ), 86 | cursorColor: Colors.black, 87 | obscureText: obscureText, 88 | enabled: enabled, 89 | focusNode: oilCardFocusNode, 90 | keyboardType:inputType == 'number'? TextInputType.number : TextInputType.text, 91 | onChanged: (text){ 92 | return change(text); 93 | }, 94 | ), 95 | ); 96 | } 97 | Widget commonButton(String title, Function success) { 98 | return InkWell( 99 | child: Container( 100 | margin: EdgeInsets.all(10), 101 | width: MediaQuery.of(context).size.width, 102 | height: ScreenUtil().setHeight(90), 103 | decoration: BoxDecoration( 104 | color: Theme.of(context).primaryColor, 105 | borderRadius: BorderRadius.circular(5) 106 | ), 107 | child: Center( 108 | child: Text(title,style: TextStyle(fontSize: ScreenUtil().setSp(32),color: Colors.white),), 109 | ), 110 | ), 111 | onTap: success, 112 | ); 113 | } 114 | _getFuelCardMessage()async {//获取油卡信息 115 | SharedPreferences prefs = await SharedPreferences.getInstance(); 116 | getAjax('selfInfo', '', context).then((res){ 117 | if(res['code'] == 200) { 118 | prefs.setString('selfObj', json.encode(res['content'])); 119 | setState(() { 120 | oilCardNo = res['content']['fuelCardNo']; 121 | oilCardController.text = oilCardNo; 122 | }); 123 | } 124 | }); 125 | 126 | } 127 | _setFuelCardMessage() {//修改油卡信息 128 | if(oilCardNo == '') { 129 | return Toast.toast(context, '请输入油卡号'); 130 | } 131 | Map params = {'fuelCardNo': oilCardNo}; 132 | postAjax('editeFuelCard', params, context).then((res){ 133 | if(res['code'] == 200) { 134 | Toast.toast(context, '修改成功'); 135 | setState(() { 136 | enabled = false; 137 | _getFuelCardMessage(); 138 | }); 139 | } 140 | }); 141 | } 142 | @override 143 | void dispose() { 144 | oilCardNo = ''; 145 | enabled = false; 146 | super.dispose(); 147 | } 148 | } -------------------------------------------------------------------------------- /lib/pages/search_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../components/city_picker.dart'; 3 | class SearchMessage extends StatefulWidget { 4 | final Function success; 5 | 6 | SearchMessage({Key key, this.success}) : super(key: key); 7 | 8 | _SearchMessageState createState() => _SearchMessageState(); 9 | } 10 | 11 | class _SearchMessageState extends State { 12 | TextEditingController startAdressController = TextEditingController(); 13 | TextEditingController endAdressController = TextEditingController(); 14 | TextEditingController goodsNameController = TextEditingController(); 15 | String startAdress; 16 | String endAdress; 17 | String goodsName = ''; 18 | Map startCodeMap; 19 | Map endCodeMap; 20 | @override 21 | Widget build(BuildContext context) { 22 | return Scaffold( 23 | appBar: AppBar(title: Text('搜索'),), 24 | body: Container( 25 | color: Colors.white, 26 | child: Column( 27 | mainAxisAlignment: MainAxisAlignment.start, 28 | crossAxisAlignment: CrossAxisAlignment.center, 29 | children: [ 30 | InkWell( 31 | child: input(startAdressController, '请输入出发地', false,(val){ 32 | 33 | }), 34 | onTap: (){ 35 | showPicker(context, (res){ 36 | setState(() { 37 | startAdress = res['textValue']; 38 | startAdressController.text = startAdress; 39 | startCodeMap = res; 40 | 41 | }); 42 | print(startCodeMap); 43 | },true); 44 | }, 45 | ), 46 | InkWell( 47 | child: input(endAdressController, '请输入目的地', false,(val){ 48 | 49 | }), 50 | onTap: (){ 51 | showPicker(context, (res){ 52 | setState(() { 53 | endAdress = res['textValue']; 54 | endAdressController.text = endAdress; 55 | endCodeMap = res; 56 | 57 | }); 58 | }, true); 59 | }, 60 | ), 61 | input(goodsNameController, '请输入货品名称', true,(val){ 62 | setState(() { 63 | goodsName = val; 64 | }); 65 | }), 66 | InkWell( 67 | child: Container( 68 | width: 200.0, 69 | height: 50.0, 70 | margin: EdgeInsets.only(top: 20.0), 71 | decoration: BoxDecoration( 72 | color: Theme.of(context).primaryColor, 73 | borderRadius: BorderRadius.circular(5.0) 74 | ), 75 | child: Center( 76 | child: Text('搜索',style: TextStyle(color: Colors.white,fontSize: 16.0),), 77 | ) 78 | ), 79 | onTap: (){ 80 | Navigator.of(context).pop(); 81 | Map result = {'startCodeMap': startCodeMap, 'endCodeMap': endCodeMap, 'goodsName':goodsName}; 82 | widget.success(result); 83 | }, 84 | ) 85 | ], 86 | ) 87 | ), 88 | ); 89 | } 90 | } 91 | 92 | Widget input(TextEditingController controller, String hintText, bool enabled, Function change){ 93 | return Container( 94 | margin: EdgeInsets.only(left: 10.0, right: 10.0, top: 10.0), 95 | padding: EdgeInsets.only(left: 5.0), 96 | decoration: BoxDecoration( 97 | border: Border.all(width: 1.0, color: Color(0XFFCCCCCC)), 98 | borderRadius: BorderRadius.circular(5.0) 99 | ), 100 | child: TextField( 101 | controller: controller, 102 | decoration: InputDecoration( 103 | hintText: hintText, 104 | border: OutlineInputBorder( 105 | borderRadius: BorderRadius.circular(3.0), 106 | borderSide: BorderSide(color: Colors.transparent), 107 | ), 108 | disabledBorder: InputBorder.none, 109 | enabledBorder:InputBorder.none, 110 | focusedBorder:InputBorder.none, 111 | hintStyle: TextStyle(color: Color(0xFFCCCCCC)) 112 | ), 113 | cursorColor: Colors.black, 114 | enabled: enabled, 115 | onChanged: (text){ 116 | return change(text); 117 | }, 118 | ), 119 | ); 120 | } -------------------------------------------------------------------------------- /lib/pages/security_setting_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import '../pages/change_password_page.dart'; 4 | 5 | class SecuritySettingPage extends StatefulWidget { 6 | @override 7 | _SecuritySettingPageState createState() => _SecuritySettingPageState(); 8 | } 9 | 10 | class _SecuritySettingPageState extends State { 11 | @override 12 | Widget build(BuildContext context) { 13 | return Scaffold( 14 | appBar: AppBar(title: Text('安全设置'),), 15 | body: Container( 16 | color: Color(0xFFF2F2F2), 17 | padding: EdgeInsets.only(top: 20), 18 | child: Column( 19 | children: [ 20 | safeSettingItem('设置交易密码', 0), 21 | safeSettingItem('修改交易密码', 1), 22 | safeSettingItem('忘记交易密码', 2) 23 | ], 24 | ), 25 | ), 26 | ); 27 | } 28 | Widget safeSettingItem(String title, int type){ 29 | return InkWell( 30 | child: Container( 31 | padding: EdgeInsets.only(left: 10,right:10), 32 | height: ScreenUtil().setHeight(100), 33 | decoration: BoxDecoration( 34 | border: Border(bottom: BorderSide(width: 1,color: Color(0xFFF2F2F2))), 35 | color: Colors.white 36 | ), 37 | child: Row( 38 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 39 | children: [ 40 | Text(title), 41 | Image.asset('assets/images/arrow.png',width: ScreenUtil().setWidth(22),) 42 | ], 43 | ), 44 | ), 45 | onTap: (){ 46 | if(type == 0){ 47 | Navigator.push(context, MaterialPageRoute(builder: (context){ 48 | return ChangePasswordPage(type: 0,); 49 | })); 50 | }else if(type == 1) { 51 | Navigator.push(context, MaterialPageRoute(builder: (context){ 52 | return ChangePasswordPage(type: 1,); 53 | })); 54 | }else{ 55 | Navigator.push(context, MaterialPageRoute(builder: (context){ 56 | return ChangePasswordPage(type: 2,); 57 | })); 58 | } 59 | }, 60 | ); 61 | } 62 | } -------------------------------------------------------------------------------- /lib/pages/trade_record_detail_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | 4 | class TradeRecordDetailPage extends StatefulWidget { 5 | final Map tradeItem; 6 | TradeRecordDetailPage({Key key, this.tradeItem}); 7 | @override 8 | _TradeRecordDetailPageState createState() => _TradeRecordDetailPageState(); 9 | } 10 | 11 | class _TradeRecordDetailPageState extends State { 12 | @override 13 | Widget build(BuildContext context) { 14 | return Scaffold( 15 | appBar: AppBar(title: Text('详情'),), 16 | body: Container( 17 | margin: EdgeInsets.only(top: 10), 18 | decoration: BoxDecoration( 19 | border: Border(top: BorderSide(width: 1,color: Color(0xFFCCCCCC))), 20 | color: Color(0xFFF2F2F2), 21 | ), 22 | child: Column( 23 | children: [ 24 | recordItem('金额', '${widget.tradeItem['balanceOfPaymentsType'] == 1? '+' : '-'}${widget.tradeItem['transferAmount']}', true), 25 | recordItem('收款人', '${widget.tradeItem['oppositeAccountName']}', true), 26 | recordItem('收款账户', '${widget.tradeItem['oppositeAccount'].substring(0, 4)} *** *** *** ${widget.tradeItem['oppositeAccount'].substring(widget.tradeItem['oppositeAccount'].length-4)}', true), 27 | recordItem('类型', '${_getDetailType(widget.tradeItem['detailType']) != null? _getDetailType(widget.tradeItem['detailType']) : ''}', true), 28 | recordItem('交易单号', '${widget.tradeItem['transactionCode']}', false), 29 | recordItem('交易日期', '${widget.tradeItem['transferTime']}', false), 30 | ], 31 | ), 32 | ), 33 | ); 34 | } 35 | Widget recordItem(String title, content, bool mainColor) { 36 | return Container( 37 | height: ScreenUtil().setHeight(100), 38 | padding: EdgeInsets.only(left: 10,right:10), 39 | decoration: BoxDecoration( 40 | border: Border(bottom: BorderSide(width:1,color: Color(0xFFCCCCCC))), 41 | color: Colors.white 42 | ), 43 | child: Row( 44 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 45 | children: [ 46 | Text(title,style: TextStyle(fontSize: ScreenUtil().setSp(32),color: Color(0xFF666666)),), 47 | Text(content,style: TextStyle(fontSize: ScreenUtil().setSp(32),color: mainColor? Theme.of(context).primaryColor :Color(0xFF454545)),) 48 | ], 49 | ), 50 | ); 51 | 52 | } 53 | _getDetailType(num type) { 54 | Map types = { 55 | 1001: '提现', 56 | 1002: '核心企业提现手续费', 57 | 1003: '提现手续费', 58 | 1004: '提现失败回冲', 59 | 1006: '提现手续费回冲', 60 | 1701: '运费收入', 61 | 1702: '运费收入', 62 | 1801: '撤销运单支付', 63 | 1802: '撤销运单支付', 64 | }; 65 | return types[type]; 66 | } 67 | } -------------------------------------------------------------------------------- /lib/pages/trade_record_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import '../common/service_method.dart'; 4 | import 'package:flutter_easyrefresh/easy_refresh.dart'; 5 | import './trade_record_detail_page.dart'; 6 | 7 | class TradeRecodePage extends StatefulWidget { 8 | @override 9 | _TradeRecodePageState createState() => _TradeRecodePageState(); 10 | } 11 | 12 | class _TradeRecodePageState extends State { 13 | GlobalKey _footerKey = new GlobalKey(); 14 | GlobalKey _headerKey = new GlobalKey(); 15 | int page = 1; 16 | List recordList = []; 17 | @override 18 | void initState() { 19 | super.initState(); 20 | _getRecordListMessage(); 21 | } 22 | @override 23 | Widget build(BuildContext context) { 24 | return Scaffold( 25 | appBar: AppBar(title: Text('交易记录'),), 26 | body:Container( 27 | child:EasyRefresh( 28 | child: recordList.length > 0 29 | ? ListView.builder( 30 | itemCount: recordList.length, 31 | itemBuilder: (BuildContext context, int index) { 32 | return recordItem(index); 33 | } 34 | ) 35 | :Center( 36 | child: Padding( 37 | child: Text('暂无交易记录', style:TextStyle(fontSize:ScreenUtil().setSp(46),color:Color(0xFF666666))), 38 | padding: EdgeInsets.only(top: 200), 39 | ), 40 | ), 41 | loadMore: (){ 42 | page++; 43 | _getRecordListMessage(); 44 | }, 45 | onRefresh: (){ 46 | page = 1; 47 | recordList = []; 48 | _getRecordListMessage(); 49 | }, 50 | refreshFooter: ClassicsFooter( 51 | key: _footerKey, 52 | bgColor: Colors.white, 53 | textColor: Colors.black26, 54 | moreInfoColor: Colors.black26, 55 | showMore: false, 56 | noMoreText: '没有更多', 57 | moreInfo: ' ', 58 | loadText: '上拉加载', 59 | loadReadyText: '上拉加载', 60 | loadedText: '加载完成', 61 | loadingText: '加载中' 62 | ), 63 | refreshHeader: ClassicsHeader( 64 | key: _headerKey, 65 | bgColor: Colors.white, 66 | textColor: Colors.black26, 67 | moreInfoColor: Colors.black26, 68 | showMore: true, 69 | moreInfo: '加载中', 70 | refreshReadyText: '下拉刷新', 71 | refreshedText: '刷新完成', 72 | ), 73 | ) 74 | ) 75 | ); 76 | } 77 | Widget recordItem(int index) { 78 | return InkWell( 79 | child: Container( 80 | padding: EdgeInsets.all(10), 81 | decoration: BoxDecoration( 82 | border: Border(bottom: BorderSide(width: 1,color: Color(0xFFF2F2F2))) 83 | ), 84 | child: Row( 85 | children: [ 86 | Container( 87 | padding: EdgeInsets.only(right: 10), 88 | decoration: BoxDecoration( 89 | border: Border(right: BorderSide(width: 1,color: Color(0xFFF2F2F2))) 90 | ), 91 | child: Image.asset(_getAssetsImage(recordList[index]['detailType']) != null? _getAssetsImage(recordList[index]['detailType']) : 'assets/images/transaction-r.png',width: ScreenUtil().setWidth(80),), 92 | ), 93 | Padding(child: null,padding: EdgeInsets.only(left:10),), 94 | Expanded( 95 | child: Row( 96 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 97 | children: [ 98 | Column( 99 | crossAxisAlignment: CrossAxisAlignment.start, 100 | children: [ 101 | Text('${recordList[index]['details']}(尾号${recordList[index]['lastNum']})'), 102 | Padding(child: null,padding: EdgeInsets.only(top: 10),), 103 | Text('${recordList[index]['transferTime']}',style: TextStyle(color: Color(0xFFBCBCBC)),) 104 | ], 105 | ), 106 | recordList[index]['balanceOfPaymentsType'] == 1 107 | ? Text('+${ recordList[index]['transferAmount']}',style: TextStyle(fontSize: ScreenUtil().setSp(34),color: Theme.of(context).primaryColor),) 108 | : Text('-${ recordList[index]['transferAmount']}',style: TextStyle(fontSize: ScreenUtil().setSp(34),color: Theme.of(context).primaryColor),) 109 | ], 110 | ), 111 | ) 112 | ], 113 | ), 114 | ), 115 | onTap: (){ 116 | Map tradeItem = recordList[index]; 117 | 118 | Navigator.push(context, MaterialPageRoute(builder: (context){ 119 | return TradeRecordDetailPage(tradeItem: tradeItem); 120 | })); 121 | }, 122 | ); 123 | } 124 | _getAssetsImage(type) { 125 | Map imageTypes = { 126 | 1001: 'assets/images/putforward.png', 127 | 1002: 'assets/images/cashfailure.png', 128 | 1003: 'assets/images/cashfailure.png', 129 | 1004: 'assets/images/cashfailure.png', 130 | 1006: 'assets/images/cashfailure.png', 131 | 1701: 'assets/images/transaction-r.png', 132 | 1702: 'assets/images/transaction-r.png', 133 | 1801: 'assets/images/cancle-waybill.jpg', 134 | 1802: 'assets/images/cancle-waybill.jpg', 135 | }; 136 | return imageTypes[type]; 137 | } 138 | _getDetailType(num type) { 139 | Map types = { 140 | 1001: '提现', 141 | 1002: '核心企业提现手续费', 142 | 1003: '提现手续费', 143 | 1004: '提现失败回冲', 144 | 1006: '提现手续费回冲', 145 | 1701: '运费收入', 146 | 1702: '运费收入', 147 | 1801: '撤销运单支付', 148 | 1802: '撤销运单支付', 149 | }; 150 | return types[type]; 151 | } 152 | _getRecordListMessage() {//获取交易记录 153 | Map params = {}; 154 | params['page'] = page; 155 | params['size'] = 10; 156 | postAjax('tradeLog', params, context).then((res){ 157 | if(res['code'] == 200 && res['content'] != null && res['content']['dataList'].length > 0) { 158 | page++; 159 | List list = res['content']['dataList']; 160 | list.forEach((item){ 161 | item['lastNum'] = item['oppositeAccount'].substring(item['oppositeAccount'].length-4); 162 | item['transferAmount'] = item['transferAmount'].toStringAsFixed(2); 163 | item['details'] = _getDetailType(item['detailType']) != null? _getDetailType(item['detailType']) : ''; 164 | }); 165 | setState(() { 166 | recordList.addAll(list); 167 | }); 168 | 169 | }else if(res['code'] == 200 && page == 1){ 170 | setState(() { 171 | recordList = []; 172 | }); 173 | } 174 | }); 175 | } 176 | @override 177 | void dispose() { 178 | recordList = []; 179 | page = 1; 180 | super.dispose(); 181 | } 182 | } -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://www.dartlang.org/tools/pub/glossary#lockfile 3 | packages: 4 | after_layout: 5 | dependency: transitive 6 | description: 7 | name: after_layout 8 | url: "https://pub.flutter-io.cn" 9 | source: hosted 10 | version: "1.0.7" 11 | amap_location: 12 | dependency: "direct main" 13 | description: 14 | name: amap_location 15 | url: "https://pub.flutter-io.cn" 16 | source: hosted 17 | version: "0.2.0" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.flutter-io.cn" 23 | source: hosted 24 | version: "2.0.8" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.flutter-io.cn" 30 | source: hosted 31 | version: "1.0.4" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "1.1.2" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.flutter-io.cn" 44 | source: hosted 45 | version: "1.14.11" 46 | cookie_jar: 47 | dependency: transitive 48 | description: 49 | name: cookie_jar 50 | url: "https://pub.flutter-io.cn" 51 | source: hosted 52 | version: "1.0.0" 53 | cupertino_icons: 54 | dependency: "direct main" 55 | description: 56 | name: cupertino_icons 57 | url: "https://pub.flutter-io.cn" 58 | source: hosted 59 | version: "0.1.2" 60 | dio: 61 | dependency: "direct main" 62 | description: 63 | name: dio 64 | url: "https://pub.flutter-io.cn" 65 | source: hosted 66 | version: "2.1.0" 67 | flutter: 68 | dependency: "direct main" 69 | description: flutter 70 | source: sdk 71 | version: "0.0.0" 72 | flutter_easyrefresh: 73 | dependency: "direct main" 74 | description: 75 | name: flutter_easyrefresh 76 | url: "https://pub.flutter-io.cn" 77 | source: hosted 78 | version: "1.2.7" 79 | flutter_screenutil: 80 | dependency: "direct main" 81 | description: 82 | name: flutter_screenutil 83 | url: "https://pub.flutter-io.cn" 84 | source: hosted 85 | version: "0.5.1" 86 | flutter_test: 87 | dependency: "direct dev" 88 | description: flutter 89 | source: sdk 90 | version: "0.0.0" 91 | image_picker: 92 | dependency: "direct main" 93 | description: 94 | name: image_picker 95 | url: "https://pub.flutter-io.cn" 96 | source: hosted 97 | version: "0.5.2" 98 | matcher: 99 | dependency: transitive 100 | description: 101 | name: matcher 102 | url: "https://pub.flutter-io.cn" 103 | source: hosted 104 | version: "0.12.3+1" 105 | meta: 106 | dependency: transitive 107 | description: 108 | name: meta 109 | url: "https://pub.flutter-io.cn" 110 | source: hosted 111 | version: "1.1.6" 112 | path: 113 | dependency: transitive 114 | description: 115 | name: path 116 | url: "https://pub.flutter-io.cn" 117 | source: hosted 118 | version: "1.6.2" 119 | pedantic: 120 | dependency: transitive 121 | description: 122 | name: pedantic 123 | url: "https://pub.flutter-io.cn" 124 | source: hosted 125 | version: "1.4.0" 126 | photo_view: 127 | dependency: "direct main" 128 | description: 129 | name: photo_view 130 | url: "https://pub.flutter-io.cn" 131 | source: hosted 132 | version: "0.2.4" 133 | provide: 134 | dependency: "direct main" 135 | description: 136 | name: provide 137 | url: "https://pub.flutter-io.cn" 138 | source: hosted 139 | version: "1.0.2" 140 | quiver: 141 | dependency: transitive 142 | description: 143 | name: quiver 144 | url: "https://pub.flutter-io.cn" 145 | source: hosted 146 | version: "2.0.1" 147 | shared_preferences: 148 | dependency: "direct main" 149 | description: 150 | name: shared_preferences 151 | url: "https://pub.flutter-io.cn" 152 | source: hosted 153 | version: "0.5.1+2" 154 | simple_permissions: 155 | dependency: "direct main" 156 | description: 157 | name: simple_permissions 158 | url: "https://pub.flutter-io.cn" 159 | source: hosted 160 | version: "0.1.9" 161 | sky_engine: 162 | dependency: transitive 163 | description: flutter 164 | source: sdk 165 | version: "0.0.99" 166 | source_span: 167 | dependency: transitive 168 | description: 169 | name: source_span 170 | url: "https://pub.flutter-io.cn" 171 | source: hosted 172 | version: "1.5.3" 173 | stack_trace: 174 | dependency: transitive 175 | description: 176 | name: stack_trace 177 | url: "https://pub.flutter-io.cn" 178 | source: hosted 179 | version: "1.9.3" 180 | stream_channel: 181 | dependency: transitive 182 | description: 183 | name: stream_channel 184 | url: "https://pub.flutter-io.cn" 185 | source: hosted 186 | version: "1.6.8" 187 | string_scanner: 188 | dependency: transitive 189 | description: 190 | name: string_scanner 191 | url: "https://pub.flutter-io.cn" 192 | source: hosted 193 | version: "1.0.4" 194 | term_glyph: 195 | dependency: transitive 196 | description: 197 | name: term_glyph 198 | url: "https://pub.flutter-io.cn" 199 | source: hosted 200 | version: "1.1.0" 201 | test_api: 202 | dependency: transitive 203 | description: 204 | name: test_api 205 | url: "https://pub.flutter-io.cn" 206 | source: hosted 207 | version: "0.2.2" 208 | typed_data: 209 | dependency: transitive 210 | description: 211 | name: typed_data 212 | url: "https://pub.flutter-io.cn" 213 | source: hosted 214 | version: "1.1.6" 215 | url_launcher: 216 | dependency: "direct main" 217 | description: 218 | name: url_launcher 219 | url: "https://pub.flutter-io.cn" 220 | source: hosted 221 | version: "5.0.2" 222 | vector_math: 223 | dependency: transitive 224 | description: 225 | name: vector_math 226 | url: "https://pub.flutter-io.cn" 227 | source: hosted 228 | version: "2.0.8" 229 | sdks: 230 | dart: ">=2.1.0 <3.0.0" 231 | flutter: ">=0.5.6 <2.0.0" 232 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_driver_application 2 | description: A new Flutter project. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # Read more about versioning at semver.org. 10 | version: 1.0.0+1 11 | 12 | environment: 13 | sdk: ">=2.1.0 <3.0.0" 14 | 15 | dependencies: 16 | flutter: 17 | sdk: flutter 18 | 19 | # The following adds the Cupertino Icons font to your application. 20 | # Use with the CupertinoIcons class for iOS style icons. 21 | cupertino_icons: ^0.1.2 22 | flutter_screenutil: ^0.5.1 23 | url_launcher: ^5.0.1 24 | dio: ^2.0.7 25 | flutter_easyrefresh: ^1.2.7 26 | provide: ^1.0.2 27 | shared_preferences: ^0.5.1 28 | photo_view: ^0.2.4 29 | image_picker: ^0.5.2 30 | amap_location: ^0.2.0 31 | simple_permissions: 0.1.9 32 | 33 | dev_dependencies: 34 | flutter_test: 35 | sdk: flutter 36 | 37 | 38 | # For information on the generic Dart part of this file, see the 39 | # following page: https://www.dartlang.org/tools/pub/pubspec 40 | 41 | # The following section is specific to Flutter. 42 | flutter: 43 | 44 | # The following line ensures that the Material Icons font is 45 | # included with your application, so that you can use the icons in 46 | # the material Icons class. 47 | uses-material-design: true 48 | 49 | # To add assets to your application, add an assets section, like this: 50 | assets: 51 | - assets/images/logo.png 52 | - assets/images/big_arrow.png 53 | - assets/images/carte.png 54 | - assets/images/bankcard.png 55 | - assets/images/trading_account.png 56 | - assets/images/join.png 57 | - assets/images/oil_card.png 58 | - assets/images/collection.png 59 | - assets/images/routeLine.png 60 | - assets/images/arrow.png 61 | - assets/images/ewm.png 62 | - assets/images/mobile.png 63 | - assets/images/pic.png 64 | - assets/images/btn_delete_photo.png 65 | - assets/images/f.png 66 | - assets/images/z.png 67 | - assets/images/r.png 68 | - assets/images/phone.png 69 | - assets/images/finish.png 70 | - assets/images/going.png 71 | - assets/images/transportation.png 72 | - assets/images/waitingLoading.png 73 | - assets/images/password.png 74 | - assets/images/users.png 75 | - assets/images/safety.png 76 | - assets/images/transaction.png 77 | - assets/images/bank_bg.png 78 | - assets/images/close.png 79 | - assets/images/splash.png 80 | - assets/images/transaction-r.png 81 | - assets/images/cancle-waybill.jpg 82 | - assets/images/cashfailure.png 83 | - assets/images/putforward.png 84 | 85 | # An image asset can refer to one or more resolution-specific "variants", see 86 | # https://flutter.io/assets-and-images/#resolution-aware. 87 | 88 | # For details regarding adding assets from package dependencies, see 89 | # https://flutter.io/assets-and-images/#from-packages 90 | 91 | # To add custom fonts to your application, add a fonts section here, 92 | # in this "flutter" section. Each entry in this list should have a 93 | # "family" key with the font family name, and a "fonts" key with a 94 | # list giving the asset and other descriptors for the font. For 95 | # example: 96 | # fonts: 97 | # - family: Schyler 98 | # fonts: 99 | # - asset: fonts/Schyler-Regular.ttf 100 | # - asset: fonts/Schyler-Italic.ttf 101 | # style: italic 102 | # - family: Trajan Pro 103 | # fonts: 104 | # - asset: fonts/TrajanPro.ttf 105 | # - asset: fonts/TrajanPro_Bold.ttf 106 | # weight: 700 107 | # 108 | # For details regarding fonts from package dependencies, 109 | # see https://flutter.io/custom-fonts/#from-packages 110 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:flutter_driver_application/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | --------------------------------------------------------------------------------