├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── xiejiapei
│ │ │ │ └── jdshop_flutter
│ │ │ │ └── jdshop_flutter
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable-v21
│ │ │ └── launch_background.xml
│ │ │ ├── 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-night
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── jdshop_flutter_android.iml
└── settings.gradle
├── images
├── 2.0x
│ ├── login.png
│ ├── user.png
│ └── user_bg.jpg
├── 3.0x
│ ├── login.png
│ ├── user.png
│ └── user_bg.jpg
├── login.png
├── user.png
└── user_bg.jpg
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Podfile.lock
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.swift
│ ├── 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
│ └── Runner-Bridging-Header.h
├── jdshop_flutter.iml
├── lib
├── address
│ ├── AddressAdd.dart
│ ├── AddressEdit.dart
│ └── AddressList.dart
├── config
│ └── Config.dart
├── main.dart
├── model
│ ├── CateModel.dart
│ ├── FocusModel.dart
│ ├── OrderModel.dart
│ ├── ProductContentMainModel.dart
│ └── ProductList.dart
├── pages
│ ├── cart
│ │ ├── cartItem.dart
│ │ └── cartNum.dart
│ ├── login
│ │ ├── Login.dart
│ │ ├── RegisterFirst.dart
│ │ ├── RegisterSecond.dart
│ │ └── RegisterThird.dart
│ ├── productContent
│ │ ├── CheckOut.dart
│ │ ├── Order.dart
│ │ ├── OrderInfo.dart
│ │ ├── Pay.dart
│ │ ├── ProductContent.dart
│ │ ├── ProductContentCartNum.dart
│ │ ├── ProductContentDetail.dart
│ │ ├── ProductContentMain.dart
│ │ └── ProductContentRate.dart
│ └── tabs
│ │ ├── Cart.dart
│ │ ├── Category.dart
│ │ ├── Home.dart
│ │ ├── ProductList.dart
│ │ ├── Search.dart
│ │ ├── Tabs.dart
│ │ └── User.dart
├── provider
│ ├── CartProvider.dart
│ ├── CheckOutProvider.dart
│ └── Counter.dart
├── routers
│ └── router.dart
├── services
│ ├── CartService.dart
│ ├── CheckOutServices.dart
│ ├── Counter.dart
│ ├── EventsBus.dart
│ ├── ScreenAdaper.dart
│ ├── SearchServices.dart
│ ├── SignServices.dart
│ ├── Storage.dart
│ └── UserServices.dart
└── widget
│ ├── JDButton.dart
│ ├── JDText.dart
│ └── LoadingWidget.dart
├── linux
├── .gitignore
├── CMakeLists.txt
├── flutter
│ ├── CMakeLists.txt
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ └── generated_plugins.cmake
├── main.cc
├── my_application.cc
└── my_application.h
├── macos
├── .gitignore
├── Flutter
│ ├── Flutter-Debug.xcconfig
│ ├── Flutter-Release.xcconfig
│ └── GeneratedPluginRegistrant.swift
├── Podfile
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── app_icon_1024.png
│ │ ├── app_icon_128.png
│ │ ├── app_icon_16.png
│ │ ├── app_icon_256.png
│ │ ├── app_icon_32.png
│ │ ├── app_icon_512.png
│ │ └── app_icon_64.png
│ ├── Base.lproj
│ └── MainMenu.xib
│ ├── Configs
│ ├── AppInfo.xcconfig
│ ├── Debug.xcconfig
│ ├── Release.xcconfig
│ └── Warnings.xcconfig
│ ├── DebugProfile.entitlements
│ ├── Info.plist
│ ├── MainFlutterWindow.swift
│ └── Release.entitlements
├── pubspec.lock
├── pubspec.yaml
├── test
└── widget_test.dart
├── web
├── favicon.png
├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
├── index.html
└── manifest.json
└── windows
├── .gitignore
├── CMakeLists.txt
├── flutter
├── CMakeLists.txt
├── generated_plugin_registrant.cc
├── generated_plugin_registrant.h
└── generated_plugins.cmake
└── runner
├── CMakeLists.txt
├── Runner.rc
├── flutter_window.cpp
├── flutter_window.h
├── main.cpp
├── resource.h
├── resources
└── app_icon.ico
├── runner.exe.manifest
├── utils.cpp
├── utils.h
├── win32_window.cpp
└── win32_window.h
/README.md:
--------------------------------------------------------------------------------
1 | ### 项目的开发指南
2 | - [Flutter:入门](https://www.jianshu.com/p/fb74b7beec43)
3 |
4 | - [Flutter:进阶](https://www.jianshu.com/p/1d0a51c71597)
5 |
6 | - [Flutter:仿京东商城APP的完整开发指南(一)](https://www.jianshu.com/p/b594f3c83aee)
7 |
8 | - [Flutter:仿京东商城APP的完整开发指南(二)](https://www.jianshu.com/p/86df79b2e74e)
9 |
10 | - [Flutter:仿京东商城APP的完整开发指南(三)](https://www.jianshu.com/p/d729be843578)
11 |
12 | 嘻嘻
13 |
14 | ### 运行效果图
15 | 
16 |
17 | 
18 |
19 | 
20 |
21 | 
22 |
23 | 
24 |
25 | 
26 |
27 | 
28 |
29 | 
30 |
31 | 
32 |
33 | 
34 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/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 plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion flutter.compileSdkVersion
30 | ndkVersion flutter.ndkVersion
31 |
32 | compileOptions {
33 | sourceCompatibility JavaVersion.VERSION_1_8
34 | targetCompatibility JavaVersion.VERSION_1_8
35 | }
36 |
37 | kotlinOptions {
38 | jvmTarget = '1.8'
39 | }
40 |
41 | sourceSets {
42 | main.java.srcDirs += 'src/main/kotlin'
43 | }
44 |
45 | defaultConfig {
46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47 | applicationId "com.xiejiapei.jdshop_flutter.jdshop_flutter"
48 | // You can update the following values to match your application needs.
49 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
50 | minSdkVersion flutter.minSdkVersion
51 | targetSdkVersion flutter.targetSdkVersion
52 | versionCode flutterVersionCode.toInteger()
53 | versionName flutterVersionName
54 | }
55 |
56 | buildTypes {
57 | release {
58 | // TODO: Add your own signing config for the release build.
59 | // Signing with the debug keys for now, so `flutter run --release` works.
60 | signingConfig signingConfigs.debug
61 | }
62 | }
63 | }
64 |
65 | flutter {
66 | source '../..'
67 | }
68 |
69 | dependencies {
70 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
71 | }
72 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
15 |
19 |
23 |
24 |
25 |
26 |
27 |
28 |
30 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/xiejiapei/jdshop_flutter/jdshop_flutter/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.xiejiapei.jdshop_flutter.jdshop_flutter
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/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/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.7.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:7.2.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | mavenCentral()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
6 |
--------------------------------------------------------------------------------
/android/jdshop_flutter_android.iml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/images/2.0x/login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/images/2.0x/login.png
--------------------------------------------------------------------------------
/images/2.0x/user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/images/2.0x/user.png
--------------------------------------------------------------------------------
/images/2.0x/user_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/images/2.0x/user_bg.jpg
--------------------------------------------------------------------------------
/images/3.0x/login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/images/3.0x/login.png
--------------------------------------------------------------------------------
/images/3.0x/user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/images/3.0x/user.png
--------------------------------------------------------------------------------
/images/3.0x/user_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/images/3.0x/user_bg.jpg
--------------------------------------------------------------------------------
/images/login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/images/login.png
--------------------------------------------------------------------------------
/images/user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/images/user.png
--------------------------------------------------------------------------------
/images/user_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/images/user_bg.jpg
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/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 | 11.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '11.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | end
36 |
37 | post_install do |installer|
38 | installer.pods_project.targets.each do |target|
39 | flutter_additional_ios_build_settings(target)
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Flutter (1.0.0)
3 | - flutter_inappwebview (0.0.1):
4 | - Flutter
5 | - fluttertoast (0.0.2):
6 | - Flutter
7 | - Toast
8 | - shared_preferences (0.0.1):
9 | - Flutter
10 | - Toast (4.0.0)
11 |
12 | DEPENDENCIES:
13 | - Flutter (from `Flutter`)
14 | - flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
15 | - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
16 | - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
17 |
18 | SPEC REPOS:
19 | trunk:
20 | - Toast
21 |
22 | EXTERNAL SOURCES:
23 | Flutter:
24 | :path: Flutter
25 | flutter_inappwebview:
26 | :path: ".symlinks/plugins/flutter_inappwebview/ios"
27 | fluttertoast:
28 | :path: ".symlinks/plugins/fluttertoast/ios"
29 | shared_preferences:
30 | :path: ".symlinks/plugins/shared_preferences/ios"
31 |
32 | SPEC CHECKSUMS:
33 | Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
34 | flutter_inappwebview: 239198123453705522ba6c4f78d3d7468215f248
35 | fluttertoast: eb263d302cc92e04176c053d2385237e9f43fad0
36 | shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
37 | Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
38 |
39 | PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
40 |
41 | COCOAPODS: 1.11.3
42 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
69 |
71 |
77 |
78 |
79 |
80 |
82 |
83 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
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/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/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/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/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/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/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/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/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/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/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/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/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/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/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/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/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/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/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/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/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/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/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/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/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/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/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/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/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/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/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/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiejiapei-creator/JDShop_Flutter/4c166270173332b45f83af679009973016fbe0c9/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 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | Jdshop Flutter
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | jdshop_flutter
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(FLUTTER_BUILD_NUMBER)
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | UIViewControllerBasedStatusBarAppearance
45 |
46 | CADisableMinimumFrameDurationOnPhone
47 |
48 | UIApplicationSupportsIndirectInputEvents
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/jdshop_flutter.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/lib/address/AddressAdd.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 |
3 | import 'package:dio/dio.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:jdshop_app/config/Config.dart';
6 | import 'package:jdshop_app/services/EventsBus.dart';
7 | import 'package:jdshop_app/services/ScreenAdaper.dart';
8 | import 'package:jdshop_app/services/SignServices.dart';
9 | import 'package:jdshop_app/services/UserServices.dart';
10 | import 'package:jdshop_app/widget/JDButton.dart';
11 | import 'package:jdshop_app/widget/JDText.dart';
12 | import 'package:city_pickers/city_pickers.dart';
13 |
14 | class AddressAddPage extends StatefulWidget {
15 | AddressAddPage({Key key}) : super(key: key);
16 | @override
17 | _AddressAddPageState createState() => _AddressAddPageState();
18 | }
19 |
20 | class _AddressAddPageState extends State {
21 | String area='';
22 | String name='';
23 | String phone='';
24 | String address='';
25 |
26 | // 页面销毁广播
27 | @override
28 | void dispose() {
29 | // TODO: implement dispose
30 | super.dispose();
31 | eventBus.fire(new AddressEvent("增加地址成功"));
32 | eventBus.fire(new DefaultAddressEvent('改收货地址成功...'));
33 | }
34 |
35 | @override
36 | Widget build(BuildContext context) {
37 | ScreenAdaper.init(context);
38 |
39 | return Scaffold(
40 | appBar: AppBar(
41 | title: Text("增加收货地址"),
42 | ),
43 | body: Container(
44 | padding: EdgeInsets.all(10),
45 | child: ListView(
46 | children: [
47 |
48 | SizedBox(height: 20),
49 | JdText(
50 | text: "收货人姓名",
51 | onChanged: (value) {
52 | this.name = value;
53 | },
54 | ),
55 | SizedBox(height: 10),
56 | JdText(
57 | text: "收货人电话",
58 | onChanged: (value) {
59 | this.phone = value;
60 | },
61 | ),
62 | SizedBox(height: 10),
63 |
64 | // 弹出省市区
65 | Container(
66 | padding: EdgeInsets.only(left: 5),
67 | height: ScreenAdaper.height(68),
68 | decoration: BoxDecoration(
69 | border: Border(
70 | bottom: BorderSide(width: 1, color: Colors.black12))),
71 |
72 | child: InkWell(
73 |
74 | child: Row(
75 | children: [
76 | Icon(Icons.add_location),
77 | this.area.length > 0 ? Text('${this.area}', style: TextStyle(color: Colors.black54)): Text('省/市/区', style: TextStyle(color: Colors.black54))
78 | ],
79 | ),
80 |
81 | onTap: () async{
82 | Result result = await CityPickers.showCityPicker(
83 | context: context,
84 | cancelWidget: Text("取消", style: TextStyle(color: Colors.blue)),
85 | confirmWidget: Text("确定", style: TextStyle(color: Colors.blue))
86 | );
87 | setState(() {
88 | this.area = "${result.provinceName}/${result.cityName}/${result.areaName}";
89 | });
90 | },
91 | ),
92 | ),
93 |
94 | SizedBox(height: 10),
95 | JdText(
96 | text: "详细地址",
97 | maxLines: 4,
98 | height: 200,
99 | onChanged: (value) {
100 | this.address = "${this.area} ${value}";
101 | },
102 | ),
103 | SizedBox(height: 40),
104 | JDButton(buttonTitle: "增加", buttonColor: Colors.red, tapEvent: () async {
105 | // 生成签名
106 | List userinfo = await UserServices.getUserInfo();
107 | var tempJson = {
108 | "uid":userinfo[0]["_id"],
109 | "name":this.name,
110 | "phone":this.phone,
111 | "address":this.address,
112 | "salt":userinfo[0]["salt"]
113 | };
114 | var sign=SignServices.getSign(tempJson);
115 | // 网络请求
116 | var api = '${Config.domain}api/addAddress';
117 | var result = await Dio().post(api,data:{
118 | "uid":userinfo[0]["_id"],
119 | "name":this.name,
120 | "phone":this.phone,
121 | "address":this.address,
122 | "sign":sign
123 | });
124 | Navigator.pop(context);
125 | })
126 | ],
127 | ),
128 | )
129 | );
130 | }
131 | }
--------------------------------------------------------------------------------
/lib/address/AddressEdit.dart:
--------------------------------------------------------------------------------
1 | import 'package:city_pickers/city_pickers.dart';
2 | import 'package:dio/dio.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:jdshop_app/config/Config.dart';
5 | import 'package:jdshop_app/services/EventsBus.dart';
6 | import 'package:jdshop_app/services/ScreenAdaper.dart';
7 | import 'package:jdshop_app/services/SignServices.dart';
8 | import 'package:jdshop_app/services/UserServices.dart';
9 | import 'package:jdshop_app/widget/JDButton.dart';
10 | import 'package:jdshop_app/widget/JDText.dart';
11 |
12 | class AddressEditPage extends StatefulWidget {
13 | Map arguments;
14 | AddressEditPage({Key key,this.arguments}) : super(key: key);
15 |
16 | _AddressEditPageState createState() => _AddressEditPageState();
17 | }
18 |
19 | class _AddressEditPageState extends State {
20 | String area='';
21 | // 初始化的时候给编辑页面赋值
22 | TextEditingController nameController=new TextEditingController();
23 | TextEditingController phoneController=new TextEditingController();
24 | TextEditingController addressController=new TextEditingController();
25 |
26 | @override
27 | void initState() {
28 | // TODO: implement initState
29 | super.initState();
30 |
31 | nameController.text = widget.arguments['name'];
32 | phoneController.text = widget.arguments['phone'];
33 | addressController.text = widget.arguments['address'];
34 | }
35 |
36 | //监听页面销毁的事件
37 | dispose(){
38 | super.dispose();
39 | eventBus.fire(new AddressEvent('编辑成功...'));
40 | }
41 |
42 | @override
43 | Widget build(BuildContext context) {
44 | return Scaffold(
45 | appBar: AppBar(
46 | title: Text("修改收货地址"),
47 | ),
48 | body: Container(
49 | padding: EdgeInsets.all(10),
50 | child: ListView(
51 | children: [
52 |
53 | SizedBox(height: 20),
54 | JdText(
55 | controller: nameController,
56 | text: "收货人姓名",
57 | onChanged: (value){
58 | nameController.text = value;
59 | },
60 | ),
61 | SizedBox(height: 10),
62 | JdText(
63 | controller: phoneController,
64 | text: "收货人电话",
65 | onChanged: (value){
66 | phoneController.text = value;
67 | },
68 | ),
69 |
70 | // 地址
71 | SizedBox(height: 10),
72 | Container(
73 | padding: EdgeInsets.only(left: 5),
74 | height: ScreenAdaper.height(68),
75 | decoration: BoxDecoration(
76 | border: Border(
77 | bottom: BorderSide(width: 1, color: Colors.black12))),
78 | child: InkWell(
79 | child: Row(
80 | children: [
81 | Icon(Icons.add_location),
82 | this.area.length>0?Text('${this.area}', style: TextStyle(color: Colors.black54)):Text('省/市/区', style: TextStyle(color: Colors.black54))
83 | ],
84 | ),
85 | onTap: () async{
86 | Result result = await CityPickers.showCityPicker(
87 | context: context,
88 | // 可以直接定位
89 | // locationCode: "130102",
90 | cancelWidget:
91 | Text("取消", style: TextStyle(color: Colors.blue)),
92 | confirmWidget:
93 | Text("确定", style: TextStyle(color: Colors.blue))
94 | );
95 | setState(() {
96 | this.area= "${result.provinceName}/${result.cityName}/${result.areaName}";
97 | });
98 | },
99 | ),
100 | ),
101 |
102 | SizedBox(height: 10),
103 | JdText(
104 | controller: addressController,
105 | text: "详细地址",
106 | maxLines: 4,
107 | height: 200,
108 | onChanged: (value){
109 | addressController.text = value;
110 | },
111 | ),
112 | SizedBox(height: 40),
113 |
114 | // 修改
115 | JDButton(buttonTitle: "修改", buttonColor: Colors.red,tapEvent: () async{
116 | List userinfo=await UserServices.getUserInfo();
117 | var tempJson={
118 | "uid":userinfo[0]["_id"],
119 | "id":widget.arguments["id"],
120 | "name": nameController.text,
121 | "phone":phoneController.text,
122 | "address":addressController.text,
123 | "salt":userinfo[0]["salt"]
124 | };
125 | var sign = SignServices.getSign(tempJson);
126 | var api = '${Config.domain}api/editAddress';
127 | var response = await Dio().post(api,data:{
128 | "uid":userinfo[0]["_id"],
129 | "id":widget.arguments["id"],
130 | "name": nameController.text,
131 | "phone":phoneController.text,
132 | "address":addressController.text,
133 | "sign":sign
134 | });
135 | Navigator.pop(context);
136 | })
137 | ],
138 | ),
139 | )
140 | );
141 | }
142 | }
--------------------------------------------------------------------------------
/lib/config/Config.dart:
--------------------------------------------------------------------------------
1 | class Config {
2 | // 静态属性,直接通过类名访问
3 | static String domain = "http://jd.itying.com/";
4 | }
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:jdshop_app/provider/CartProvider.dart';
3 | import 'package:jdshop_app/provider/CheckOutProvider.dart';
4 | import 'package:jdshop_app/routers/router.dart';
5 | import 'package:provider/provider.dart';
6 |
7 | void main() => runApp(MyApp());
8 |
9 | class MyApp extends StatefulWidget {
10 | MyApp({Key key}) : super(key: key);
11 |
12 | @override
13 | _MyAppState createState() => _MyAppState();
14 | }
15 |
16 | class _MyAppState extends State {
17 | @override
18 | Widget build(BuildContext context) {
19 | // 提供通知
20 | return MultiProvider(
21 | providers: [
22 | ChangeNotifierProvider(create: (_) => CheckOutProvider()),
23 | ChangeNotifierProvider(create: (_) => CartProvider()),
24 | ],
25 |
26 | child: MaterialApp(
27 | initialRoute: '/',
28 | onGenerateRoute: onGenerateRoute,
29 | // 修改主题颜色
30 | theme: ThemeData(
31 | primaryColor: Colors.white
32 | ),
33 | // 去掉debug
34 | debugShowCheckedModeBanner: false
35 | )
36 | );
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/lib/model/CateModel.dart:
--------------------------------------------------------------------------------
1 | class CateModel {
2 | List result;
3 |
4 | CateModel({this.result});
5 |
6 | CateModel.fromJson(Map json) {
7 | if (json['result'] != null) {
8 | result = new List();
9 | json['result'].forEach((v) {
10 | result.add(new CateItemModel.fromJson(v));
11 | });
12 | }
13 | }
14 |
15 | Map toJson() {
16 | final Map data = new Map();
17 | if (this.result != null) {
18 | data['result'] = this.result.map((v) => v.toJson()).toList();
19 | }
20 | return data;
21 | }
22 | }
23 |
24 | class CateItemModel {
25 | String sId;
26 | String title;
27 | Object status;
28 | String pic;
29 | String pid;
30 | String sort;
31 |
32 | CateItemModel({this.sId, this.title, this.status, this.pic, this.pid, this.sort});
33 |
34 | CateItemModel.fromJson(Map json) {
35 | sId = json['_id'];
36 | title = json['title'];
37 | status = json['status'];
38 | pic = json['pic'];
39 | pid = json['pid'];
40 | sort = json['sort'];
41 | }
42 |
43 | Map toJson() {
44 | final Map data = new Map();
45 | data['_id'] = this.sId;
46 | data['title'] = this.title;
47 | data['status'] = this.status;
48 | data['pic'] = this.pic;
49 | data['pid'] = this.pid;
50 | data['sort'] = this.sort;
51 | return data;
52 | }
53 | }
--------------------------------------------------------------------------------
/lib/model/FocusModel.dart:
--------------------------------------------------------------------------------
1 | // '{"_id":"59f6ef443ce1fb0fb02c7a43","title":"笔记本电脑 ","status":"1","pic":"public\\upload\\UObZahqPYzFvx_C9CQjU8KiX.png"," url":"12" }'
2 | // 小项目中使用 dart:convert 手动序列化 JSON 非常好
3 | // 大项目类型安全(20看不出int还是string、自动补全people.name而不是people["name"]
4 | // 最重要的编译时异常people["neme"]打错不能发现,编译了才能发现
5 |
6 | class FocusModel {
7 | List result;
8 |
9 | FocusModel({this.result});
10 |
11 | FocusModel.fromJson(Map json) {
12 | if (json['result'] != null) {
13 | result = new List();
14 | json['result'].forEach((v) {
15 | result.add(new FocusItem.fromJson(v));
16 | });
17 | }
18 | }
19 |
20 | Map toJson() {
21 | final Map data = new Map();
22 | if (this.result != null) {
23 | data['result'] = this.result.map((v) => v.toJson()).toList();
24 | }
25 | return data;
26 | }
27 | }
28 |
29 | class FocusItem {
30 | String sId;// 商品id
31 | String title;// 标题
32 | String status;
33 | String pic;// 图片地址
34 | String url;// 跳转地址
35 |
36 | // 可选构造函数
37 | FocusItem({this.sId, this.title, this.status, this.pic, this.url});
38 |
39 | // 命名构造函数
40 | FocusItem.fromJson(Map json) {
41 | sId = json['_id'];
42 | title = json['title'];
43 | status = json['status'];
44 | pic = json['pic'];
45 | url = json['url'];
46 | }
47 |
48 | // 类里面的属性转化为Map类型
49 | Map toJson() {
50 | final Map data = new Map();
51 | data['_id'] = this.sId;
52 | data['title'] = this.title;
53 | data['status'] = this.status;
54 | data['pic'] = this.pic;
55 | data['url'] = this.url;
56 | return data;
57 | }
58 | }
--------------------------------------------------------------------------------
/lib/model/OrderModel.dart:
--------------------------------------------------------------------------------
1 | class OrderModel {
2 | bool success;
3 | String message;
4 | List result;
5 |
6 | OrderModel({this.success, this.message, this.result});
7 |
8 | OrderModel.fromJson(Map json) {
9 | success = json['success'];
10 | message = json['message'];
11 | if (json['result'] != null) {
12 | result = new List();
13 | json['result'].forEach((v) {
14 | result.add(new Result.fromJson(v));
15 | });
16 | }
17 | }
18 |
19 | Map toJson() {
20 | final Map data = new Map();
21 | data['success'] = this.success;
22 | data['message'] = this.message;
23 | if (this.result != null) {
24 | data['result'] = this.result.map((v) => v.toJson()).toList();
25 | }
26 | return data;
27 | }
28 | }
29 |
30 | class Result {
31 | String sId;
32 | String uid;
33 | String name;
34 | String phone;
35 | String address;
36 | String allPrice;
37 | int payStatus;
38 | int orderStatus;
39 | List orderItem;
40 |
41 | Result(
42 | {this.sId,
43 | this.uid,
44 | this.name,
45 | this.phone,
46 | this.address,
47 | this.allPrice,
48 | this.payStatus,
49 | this.orderStatus,
50 | this.orderItem});
51 |
52 | Result.fromJson(Map json) {
53 | sId = json['_id'];
54 | uid = json['uid'];
55 | name = json['name'];
56 | phone = json['phone'];
57 | address = json['address'];
58 | allPrice = json['all_price'];
59 | payStatus = json['pay_status'];
60 | orderStatus = json['order_status'];
61 | if (json['order_item'] != null) {
62 | orderItem = new List();
63 | json['order_item'].forEach((v) {
64 | orderItem.add(new OrderItem.fromJson(v));
65 | });
66 | }
67 | }
68 |
69 | Map toJson() {
70 | final Map data = new Map();
71 | data['_id'] = this.sId;
72 | data['uid'] = this.uid;
73 | data['name'] = this.name;
74 | data['phone'] = this.phone;
75 | data['address'] = this.address;
76 | data['all_price'] = this.allPrice;
77 | data['pay_status'] = this.payStatus;
78 | data['order_status'] = this.orderStatus;
79 | if (this.orderItem != null) {
80 | data['order_item'] = this.orderItem.map((v) => v.toJson()).toList();
81 | }
82 | return data;
83 | }
84 | }
85 |
86 | class OrderItem {
87 | String sId;
88 | String orderId;
89 | String productTitle;
90 | String productId;
91 | int productPrice;
92 | String productImg;
93 | int productCount;
94 | String selectedAttr;
95 | int addTime;
96 |
97 | OrderItem(
98 | {this.sId,
99 | this.orderId,
100 | this.productTitle,
101 | this.productId,
102 | this.productPrice,
103 | this.productImg,
104 | this.productCount,
105 | this.selectedAttr,
106 | this.addTime});
107 |
108 | OrderItem.fromJson(Map json) {
109 | sId = json['_id'];
110 | orderId = json['order_id'];
111 | productTitle = json['product_title'];
112 | productId = json['product_id'];
113 | productPrice = json['product_price'];
114 | productImg = json['product_img'];
115 | productCount = json['product_count'];
116 | selectedAttr = json['selected_attr'];
117 | addTime = json['add_time'];
118 | }
119 |
120 | Map toJson() {
121 | final Map data = new Map();
122 | data['_id'] = this.sId;
123 | data['order_id'] = this.orderId;
124 | data['product_title'] = this.productTitle;
125 | data['product_id'] = this.productId;
126 | data['product_price'] = this.productPrice;
127 | data['product_img'] = this.productImg;
128 | data['product_count'] = this.productCount;
129 | data['selected_attr'] = this.selectedAttr;
130 | data['add_time'] = this.addTime;
131 | return data;
132 | }
133 | }
--------------------------------------------------------------------------------
/lib/model/ProductContentMainModel.dart:
--------------------------------------------------------------------------------
1 | class ProductContentMainModel {
2 | ProductContentMainItem result;
3 |
4 | ProductContentMainModel({this.result});
5 |
6 | ProductContentMainModel.fromJson(Map json) {
7 | result =
8 | json['result'] != null ? new ProductContentMainItem.fromJson(json['result']) : null;
9 | }
10 |
11 | Map toJson() {
12 | final Map data = new Map();
13 | if (this.result != null) {
14 | data['result'] = this.result.toJson();
15 | }
16 | return data;
17 | }
18 | }
19 |
20 | class ProductContentMainItem {
21 | String sId;
22 | String title;
23 | String cid;
24 | Object price;
25 | String oldPrice;
26 | Object isBest;
27 | Object isHot;
28 | Object isNew;
29 | String status;
30 | String pic;
31 | String content;
32 | String cname;
33 | List attr;
34 | String subTitle;
35 | Object salecount;
36 | // 新增
37 | int count;
38 | String selectedAttr;
39 |
40 | ProductContentMainItem(
41 | {this.sId,
42 | this.title,
43 | this.cid,
44 | this.price,
45 | this.oldPrice,
46 | this.isBest,
47 | this.isHot,
48 | this.isNew,
49 | this.status,
50 | this.pic,
51 | this.content,
52 | this.cname,
53 | this.attr,
54 | this.subTitle,
55 | this.salecount,
56 | this.count,
57 | this.selectedAttr});
58 |
59 | ProductContentMainItem.fromJson(Map json) {
60 | sId = json['_id'];
61 | title = json['title'];
62 | cid = json['cid'];
63 | price = json['price'];
64 | oldPrice = json['old_price'];
65 | isBest = json['is_best'];
66 | isHot = json['is_hot'];
67 | isNew = json['is_new'];
68 | status = json['status'];
69 | pic = json['pic'];
70 | content = json['content'];
71 | cname = json['cname'];
72 | if (json['attr'] != null) {
73 | attr = new List();
74 | json['attr'].forEach((v) {
75 | attr.add(new Attr.fromJson(v));
76 | });
77 | }
78 | subTitle = json['sub_title'];
79 | salecount = json['salecount'];
80 |
81 | // 新增
82 | count = 1;
83 | selectedAttr = '';
84 | }
85 |
86 | Map toJson() {
87 | final Map data = new Map();
88 | data['_id'] = this.sId;
89 | data['title'] = this.title;
90 | data['cid'] = this.cid;
91 | data['price'] = this.price;
92 | data['old_price'] = this.oldPrice;
93 | data['is_best'] = this.isBest;
94 | data['is_hot'] = this.isHot;
95 | data['is_new'] = this.isNew;
96 | data['status'] = this.status;
97 | data['pic'] = this.pic;
98 | data['content'] = this.content;
99 | data['cname'] = this.cname;
100 | if (this.attr != null) {
101 | data['attr'] = this.attr.map((v) => v.toJson()).toList();
102 | }
103 | data['sub_title'] = this.subTitle;
104 | data['salecount'] = this.salecount;
105 | return data;
106 | }
107 | }
108 |
109 | class Attr {
110 | String cate;
111 | List list;
112 | // 新添属性,用于添加CHECK
113 | List