├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── dev │ │ │ │ └── flutter │ │ │ │ └── provider_shopper │ │ │ │ └── MainActivity.kt │ │ └── 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 └── settings.gradle ├── assets ├── Aramis.svg ├── Benefit Cosmetics.svg ├── Bordelle.svg ├── Brioni.svg ├── Bulgari.svg ├── CHANEL.svg ├── CHEANEY.svg ├── Calvin Klein.svg ├── EDWARD GREEN.svg ├── Estee Lauder.svg ├── HERMES.svg ├── Jaeger-LeCoultre.svg ├── Jimmy Choo.svg ├── Louis Vuitton.svg ├── Manolo Blahnik.svg ├── Pomellato.svg ├── Ralph Lauren.svg ├── Ray-Ban.svg ├── Roger Vivier.svg ├── Salvatore Ferragamo.svg ├── TAG Heuer.svg └── Van Cleef.svg ├── fonts └── YaHei │ └── Microsoft-YaHei.ttf ├── github-assets ├── Screenshot_1567050012.png ├── Screenshot_1567050036.png ├── Screenshot_1567583879.png ├── flutter-design-pattern.png ├── logo.png └── official.png ├── ios ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── 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 ├── lib ├── controllers │ ├── cart.dart │ └── catalog.dart ├── db │ └── sqlite.dart ├── driver │ └── catalog.dart ├── file │ └── catalog.dart ├── main.dart ├── memory │ └── catalog.dart ├── models │ └── catalog.dart ├── repositories │ └── catalog.dart ├── utils │ └── helps.dart └── views │ ├── cart.dart │ ├── catalog.dart │ └── order.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: 7a4c33425ddd78c54aba07d86f3f9a4a0051769b 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Flutter Samples 2 | 3 | The project is maintained by a non-profit organization, along with an amazing collections of Flutter samples. We're trying to make continuous commits for changes along with the Flutter tech progress. 4 | 5 | 6 | # The Design Pattern 7 | 8 | Design Pattern 9 | 10 | ## Goals for this sample 11 | 12 | - Shows a state management approach using the [Provider](https://pub.dev/packages/provider) package,mainly use StreamProvider and ChangeNotifier. 13 | - Show a logic for fetch data from different datasources as above graph. 14 | 15 | ## Memory fetch data 16 | 17 | Change `repositories/catalog.dart` 18 | 19 | ``` 20 | const dataSource = 'memory'; 21 | ``` 22 | 23 | `repositories/catalog.dart` A route distribution for fetching data 24 | `memory/catalog.dart` All CURD operations will be here 25 | `file/catalog.dart` Define data 26 | 27 | ## Sqlite fetch data 28 | 29 | Change `repositories/catalog.dart` 30 | 31 | ``` 32 | const dataSource = 'db'; 33 | ``` 34 | 35 | #### Notice 36 | 37 | You can't use `cart.items.contains(item)` to compare catalog whether exists in cart,because use database reload data.Add `contains` method in cart controller,and use below 38 | 39 | ``` 40 | cart.contains(item.id) 41 | ``` 42 | 43 | ## Todo 44 | - Http implement 45 | --- 46 | # Screen Shots 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 |
Screen ShotsScreen ShotsScreen Shots
55 | 56 | 57 | --- 58 | 59 | Welcome Contribute With Pull Request. 60 | 61 | --- 62 | 63 | [For Chinese,you can read this wechat official article](https://mp.weixin.qq.com/s/nyCp9KaWpMqyzVnbv_07Iw) 64 | 65 | --- 66 | 67 | # About 68 | ![微信公众号](https://raw.githubusercontent.com/flutter-samples/flutter-design-pattern/master/github-assets/official.png) 69 | 70 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:pedantic/analysis_options.1.7.0.yaml 2 | 3 | analyzer: 4 | strong-mode: 5 | implicit-casts: true 6 | implicit-dynamic: true 7 | 8 | linter: 9 | rules: 10 | - avoid_types_on_closure_parameters 11 | - avoid_void_async 12 | - await_only_futures 13 | - camel_case_types 14 | - cancel_subscriptions 15 | - close_sinks 16 | - constant_identifier_names 17 | - control_flow_in_finally 18 | - empty_statements 19 | - hash_and_equals 20 | - implementation_imports 21 | - non_constant_identifier_names 22 | - package_api_docs 23 | - package_names 24 | - package_prefixed_library_names 25 | - test_types_in_equals 26 | - throw_in_finally 27 | - unnecessary_brace_in_string_interps 28 | - unnecessary_getters_setters 29 | - unnecessary_new 30 | - unnecessary_statements 31 | -------------------------------------------------------------------------------- /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 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "dev.flutter.shopper" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 | testImplementation 'junit:junit:4.12' 65 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 66 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 67 | } 68 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 13 | 20 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/dev/flutter/provider_shopper/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package dev.flutter.shopper 2 | 3 | import android.os.Bundle 4 | 5 | import io.flutter.app.FlutterActivity 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity: FlutterActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 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/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/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 | ext.kotlin_version = '1.2.71' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.2.1' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 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/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/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/Aramis.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 10 | 15 | 17 | 23 | 29 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /assets/Benefit Cosmetics.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 46 | 49 | 52 | 62 | 65 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /assets/Bordelle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 35 | 36 | 37 | 38 | 39 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /assets/Brioni.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /assets/Bulgari.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 16 | 25 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /assets/CHANEL.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /assets/CHEANEY.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 36 | 37 | 38 | 40 | 42 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /assets/Calvin Klein.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 16 | 17 | 18 | 19 | 20 | 29 | 30 | 31 | 32 | 33 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /assets/EDWARD GREEN.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 45 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /assets/Estee Lauder.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 12 | 16 | 20 | 25 | 27 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /assets/HERMES.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /assets/Jaeger-LeCoultre.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 10 | 29 | 31 | 33 | 35 | 37 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /assets/Jimmy Choo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /assets/Louis Vuitton.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /assets/Manolo Blahnik.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /assets/Pomellato.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | 26 | 27 | 28 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /assets/Ralph Lauren.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /assets/Ray-Ban.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /assets/Roger Vivier.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /assets/Salvatore Ferragamo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 28 | 32 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /assets/TAG Heuer.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 11 | 37 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /assets/Van Cleef.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /fonts/YaHei/Microsoft-YaHei.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/fonts/YaHei/Microsoft-YaHei.ttf -------------------------------------------------------------------------------- /github-assets/Screenshot_1567050012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/github-assets/Screenshot_1567050012.png -------------------------------------------------------------------------------- /github-assets/Screenshot_1567050036.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/github-assets/Screenshot_1567050036.png -------------------------------------------------------------------------------- /github-assets/Screenshot_1567583879.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/github-assets/Screenshot_1567583879.png -------------------------------------------------------------------------------- /github-assets/flutter-design-pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/github-assets/flutter-design-pattern.png -------------------------------------------------------------------------------- /github-assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/github-assets/logo.png -------------------------------------------------------------------------------- /github-assets/official.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/github-assets/official.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 "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, '9.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 parse_KV_file(file, separator='=') 14 | file_abs_path = File.expand_path(file) 15 | if !File.exists? file_abs_path 16 | return []; 17 | end 18 | pods_ary = [] 19 | skip_line_start_symbols = ["#", "/"] 20 | File.foreach(file_abs_path) { |line| 21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } 22 | plugin = line.split(pattern=separator) 23 | if plugin.length == 2 24 | podname = plugin[0].strip() 25 | path = plugin[1].strip() 26 | podpath = File.expand_path("#{path}", file_abs_path) 27 | pods_ary.push({:name => podname, :path => podpath}); 28 | else 29 | puts "Invalid plugin specification: #{line}" 30 | end 31 | } 32 | return pods_ary 33 | end 34 | 35 | target 'Runner' do 36 | use_frameworks! 37 | 38 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock 39 | # referring to absolute paths on developers' machines. 40 | system('rm -rf .symlinks') 41 | system('mkdir -p .symlinks/plugins') 42 | 43 | # Flutter Pods 44 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') 45 | if generated_xcode_build_settings.empty? 46 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first." 47 | end 48 | generated_xcode_build_settings.map { |p| 49 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR' 50 | symlink = File.join('.symlinks', 'flutter') 51 | File.symlink(File.dirname(p[:path]), symlink) 52 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) 53 | end 54 | } 55 | 56 | # Plugin Pods 57 | plugin_pods = parse_KV_file('../.flutter-plugins') 58 | plugin_pods.map { |p| 59 | symlink = File.join('.symlinks', 'plugins', p[:name]) 60 | File.symlink(p[:path], symlink) 61 | pod p[:name], :path => File.join(symlink, 'ios') 62 | } 63 | end 64 | 65 | # Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. 66 | install! 'cocoapods', :disable_input_output_paths => true 67 | 68 | post_install do |installer| 69 | installer.pods_project.targets.each do |target| 70 | target.build_configurations.each do |config| 71 | config.build_settings['ENABLE_BITCODE'] = 'NO' 72 | end 73 | end 74 | end 75 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - FMDB (2.7.5): 4 | - FMDB/standard (= 2.7.5) 5 | - FMDB/standard (2.7.5) 6 | - path_provider (0.0.1): 7 | - Flutter 8 | - sqflite (0.0.1): 9 | - Flutter 10 | - FMDB (~> 2.7.2) 11 | 12 | DEPENDENCIES: 13 | - Flutter (from `.symlinks/flutter/ios`) 14 | - path_provider (from `.symlinks/plugins/path_provider/ios`) 15 | - sqflite (from `.symlinks/plugins/sqflite/ios`) 16 | 17 | SPEC REPOS: 18 | https://github.com/cocoapods/specs.git: 19 | - FMDB 20 | 21 | EXTERNAL SOURCES: 22 | Flutter: 23 | :path: ".symlinks/flutter/ios" 24 | path_provider: 25 | :path: ".symlinks/plugins/path_provider/ios" 26 | sqflite: 27 | :path: ".symlinks/plugins/sqflite/ios" 28 | 29 | SPEC CHECKSUMS: 30 | Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a 31 | FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a 32 | path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259 33 | sqflite: ff1d9da63c06588cc8d1faf7256d741f16989d5a 34 | 35 | PODFILE CHECKSUM: b6a0a141693093b304368d08511b46cf3d1d0ac5 36 | 37 | COCOAPODS: 1.7.4 38 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 18 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 19 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 20 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 21 | C2179F375C649972AA186798 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95D87BC0EEB43E1D19BC7283 /* Pods_Runner.framework */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXCopyFilesBuildPhase section */ 25 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 26 | isa = PBXCopyFilesBuildPhase; 27 | buildActionMask = 2147483647; 28 | dstPath = ""; 29 | dstSubfolderSpec = 10; 30 | files = ( 31 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 32 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 33 | ); 34 | name = "Embed Frameworks"; 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXCopyFilesBuildPhase section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 41 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 42 | 1FFFA7E05B5D0F9688942A35 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 43 | 200167DDB68790B0B4BA61C1 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 44 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 45 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 46 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 47 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 48 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 49 | 95D87BC0EEB43E1D19BC7283 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 51 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 52 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 53 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 55 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 56 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 57 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 58 | D194F02BB83AEB4C9C0DF8BE /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 59 | /* End PBXFileReference section */ 60 | 61 | /* Begin PBXFrameworksBuildPhase section */ 62 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 67 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 68 | C2179F375C649972AA186798 /* Pods_Runner.framework in Frameworks */, 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | /* End PBXFrameworksBuildPhase section */ 73 | 74 | /* Begin PBXGroup section */ 75 | 1E56AE98FFF769F436C44937 /* Pods */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | D194F02BB83AEB4C9C0DF8BE /* Pods-Runner.debug.xcconfig */, 79 | 200167DDB68790B0B4BA61C1 /* Pods-Runner.release.xcconfig */, 80 | 1FFFA7E05B5D0F9688942A35 /* Pods-Runner.profile.xcconfig */, 81 | ); 82 | name = Pods; 83 | path = Pods; 84 | sourceTree = ""; 85 | }; 86 | 33C4FBAEFACDA84A0FB91199 /* Frameworks */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 95D87BC0EEB43E1D19BC7283 /* Pods_Runner.framework */, 90 | ); 91 | name = Frameworks; 92 | sourceTree = ""; 93 | }; 94 | 9740EEB11CF90186004384FC /* Flutter */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 3B80C3931E831B6300D905FE /* App.framework */, 98 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 99 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 100 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 101 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 102 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 103 | ); 104 | name = Flutter; 105 | sourceTree = ""; 106 | }; 107 | 97C146E51CF9000F007C117D = { 108 | isa = PBXGroup; 109 | children = ( 110 | 9740EEB11CF90186004384FC /* Flutter */, 111 | 97C146F01CF9000F007C117D /* Runner */, 112 | 97C146EF1CF9000F007C117D /* Products */, 113 | 1E56AE98FFF769F436C44937 /* Pods */, 114 | 33C4FBAEFACDA84A0FB91199 /* Frameworks */, 115 | ); 116 | sourceTree = ""; 117 | }; 118 | 97C146EF1CF9000F007C117D /* Products */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 97C146EE1CF9000F007C117D /* Runner.app */, 122 | ); 123 | name = Products; 124 | sourceTree = ""; 125 | }; 126 | 97C146F01CF9000F007C117D /* Runner */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 130 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 131 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 132 | 97C147021CF9000F007C117D /* Info.plist */, 133 | 97C146F11CF9000F007C117D /* Supporting Files */, 134 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 135 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 136 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 137 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 138 | ); 139 | path = Runner; 140 | sourceTree = ""; 141 | }; 142 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | ); 146 | name = "Supporting Files"; 147 | sourceTree = ""; 148 | }; 149 | /* End PBXGroup section */ 150 | 151 | /* Begin PBXNativeTarget section */ 152 | 97C146ED1CF9000F007C117D /* Runner */ = { 153 | isa = PBXNativeTarget; 154 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 155 | buildPhases = ( 156 | F773291B7BF155747BD4C9C9 /* [CP] Check Pods Manifest.lock */, 157 | 9740EEB61CF901F6004384FC /* Run Script */, 158 | 97C146EA1CF9000F007C117D /* Sources */, 159 | 97C146EB1CF9000F007C117D /* Frameworks */, 160 | 97C146EC1CF9000F007C117D /* Resources */, 161 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 162 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 163 | F7C3300F480A4817719AD06F /* [CP] Embed Pods Frameworks */, 164 | ); 165 | buildRules = ( 166 | ); 167 | dependencies = ( 168 | ); 169 | name = Runner; 170 | productName = Runner; 171 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 172 | productType = "com.apple.product-type.application"; 173 | }; 174 | /* End PBXNativeTarget section */ 175 | 176 | /* Begin PBXProject section */ 177 | 97C146E61CF9000F007C117D /* Project object */ = { 178 | isa = PBXProject; 179 | attributes = { 180 | LastUpgradeCheck = 0910; 181 | ORGANIZATIONNAME = "The Chromium Authors"; 182 | TargetAttributes = { 183 | 97C146ED1CF9000F007C117D = { 184 | CreatedOnToolsVersion = 7.3.1; 185 | LastSwiftMigration = 0910; 186 | }; 187 | }; 188 | }; 189 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 190 | compatibilityVersion = "Xcode 3.2"; 191 | developmentRegion = English; 192 | hasScannedForEncodings = 0; 193 | knownRegions = ( 194 | en, 195 | Base, 196 | ); 197 | mainGroup = 97C146E51CF9000F007C117D; 198 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 199 | projectDirPath = ""; 200 | projectRoot = ""; 201 | targets = ( 202 | 97C146ED1CF9000F007C117D /* Runner */, 203 | ); 204 | }; 205 | /* End PBXProject section */ 206 | 207 | /* Begin PBXResourcesBuildPhase section */ 208 | 97C146EC1CF9000F007C117D /* Resources */ = { 209 | isa = PBXResourcesBuildPhase; 210 | buildActionMask = 2147483647; 211 | files = ( 212 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 213 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 214 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 215 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 216 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | /* End PBXResourcesBuildPhase section */ 221 | 222 | /* Begin PBXShellScriptBuildPhase section */ 223 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 224 | isa = PBXShellScriptBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | ); 228 | inputPaths = ( 229 | ); 230 | name = "Thin Binary"; 231 | outputPaths = ( 232 | ); 233 | runOnlyForDeploymentPostprocessing = 0; 234 | shellPath = /bin/sh; 235 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 236 | }; 237 | 9740EEB61CF901F6004384FC /* Run Script */ = { 238 | isa = PBXShellScriptBuildPhase; 239 | buildActionMask = 2147483647; 240 | files = ( 241 | ); 242 | inputPaths = ( 243 | ); 244 | name = "Run Script"; 245 | outputPaths = ( 246 | ); 247 | runOnlyForDeploymentPostprocessing = 0; 248 | shellPath = /bin/sh; 249 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 250 | }; 251 | F773291B7BF155747BD4C9C9 /* [CP] Check Pods Manifest.lock */ = { 252 | isa = PBXShellScriptBuildPhase; 253 | buildActionMask = 2147483647; 254 | files = ( 255 | ); 256 | inputFileListPaths = ( 257 | ); 258 | inputPaths = ( 259 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 260 | "${PODS_ROOT}/Manifest.lock", 261 | ); 262 | name = "[CP] Check Pods Manifest.lock"; 263 | outputFileListPaths = ( 264 | ); 265 | outputPaths = ( 266 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 267 | ); 268 | runOnlyForDeploymentPostprocessing = 0; 269 | shellPath = /bin/sh; 270 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 271 | showEnvVarsInLog = 0; 272 | }; 273 | F7C3300F480A4817719AD06F /* [CP] Embed Pods Frameworks */ = { 274 | isa = PBXShellScriptBuildPhase; 275 | buildActionMask = 2147483647; 276 | files = ( 277 | ); 278 | inputPaths = ( 279 | ); 280 | name = "[CP] Embed Pods Frameworks"; 281 | outputPaths = ( 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | shellPath = /bin/sh; 285 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 286 | showEnvVarsInLog = 0; 287 | }; 288 | /* End PBXShellScriptBuildPhase section */ 289 | 290 | /* Begin PBXSourcesBuildPhase section */ 291 | 97C146EA1CF9000F007C117D /* Sources */ = { 292 | isa = PBXSourcesBuildPhase; 293 | buildActionMask = 2147483647; 294 | files = ( 295 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 296 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 297 | ); 298 | runOnlyForDeploymentPostprocessing = 0; 299 | }; 300 | /* End PBXSourcesBuildPhase section */ 301 | 302 | /* Begin PBXVariantGroup section */ 303 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 304 | isa = PBXVariantGroup; 305 | children = ( 306 | 97C146FB1CF9000F007C117D /* Base */, 307 | ); 308 | name = Main.storyboard; 309 | sourceTree = ""; 310 | }; 311 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 312 | isa = PBXVariantGroup; 313 | children = ( 314 | 97C147001CF9000F007C117D /* Base */, 315 | ); 316 | name = LaunchScreen.storyboard; 317 | sourceTree = ""; 318 | }; 319 | /* End PBXVariantGroup section */ 320 | 321 | /* Begin XCBuildConfiguration section */ 322 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 323 | isa = XCBuildConfiguration; 324 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 325 | buildSettings = { 326 | ALWAYS_SEARCH_USER_PATHS = NO; 327 | CLANG_ANALYZER_NONNULL = YES; 328 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 329 | CLANG_CXX_LIBRARY = "libc++"; 330 | CLANG_ENABLE_MODULES = YES; 331 | CLANG_ENABLE_OBJC_ARC = YES; 332 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 333 | CLANG_WARN_BOOL_CONVERSION = YES; 334 | CLANG_WARN_COMMA = YES; 335 | CLANG_WARN_CONSTANT_CONVERSION = YES; 336 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 337 | CLANG_WARN_EMPTY_BODY = YES; 338 | CLANG_WARN_ENUM_CONVERSION = YES; 339 | CLANG_WARN_INFINITE_RECURSION = YES; 340 | CLANG_WARN_INT_CONVERSION = YES; 341 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 342 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 343 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 344 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 345 | CLANG_WARN_STRICT_PROTOTYPES = YES; 346 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 347 | CLANG_WARN_UNREACHABLE_CODE = YES; 348 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 349 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 350 | COPY_PHASE_STRIP = NO; 351 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 352 | ENABLE_NS_ASSERTIONS = NO; 353 | ENABLE_STRICT_OBJC_MSGSEND = YES; 354 | GCC_C_LANGUAGE_STANDARD = gnu99; 355 | GCC_NO_COMMON_BLOCKS = YES; 356 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 357 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 358 | GCC_WARN_UNDECLARED_SELECTOR = YES; 359 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 360 | GCC_WARN_UNUSED_FUNCTION = YES; 361 | GCC_WARN_UNUSED_VARIABLE = YES; 362 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 363 | MTL_ENABLE_DEBUG_INFO = NO; 364 | SDKROOT = iphoneos; 365 | TARGETED_DEVICE_FAMILY = "1,2"; 366 | VALIDATE_PRODUCT = YES; 367 | }; 368 | name = Profile; 369 | }; 370 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 371 | isa = XCBuildConfiguration; 372 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 373 | buildSettings = { 374 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 375 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 376 | DEVELOPMENT_TEAM = S8QB4VV633; 377 | ENABLE_BITCODE = NO; 378 | FRAMEWORK_SEARCH_PATHS = ( 379 | "$(inherited)", 380 | "$(PROJECT_DIR)/Flutter", 381 | ); 382 | INFOPLIST_FILE = Runner/Info.plist; 383 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 384 | LIBRARY_SEARCH_PATHS = ( 385 | "$(inherited)", 386 | "$(PROJECT_DIR)/Flutter", 387 | ); 388 | PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.providerShopper; 389 | PRODUCT_NAME = "$(TARGET_NAME)"; 390 | SWIFT_VERSION = 4.0; 391 | VERSIONING_SYSTEM = "apple-generic"; 392 | }; 393 | name = Profile; 394 | }; 395 | 97C147031CF9000F007C117D /* Debug */ = { 396 | isa = XCBuildConfiguration; 397 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 398 | buildSettings = { 399 | ALWAYS_SEARCH_USER_PATHS = NO; 400 | CLANG_ANALYZER_NONNULL = YES; 401 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 402 | CLANG_CXX_LIBRARY = "libc++"; 403 | CLANG_ENABLE_MODULES = YES; 404 | CLANG_ENABLE_OBJC_ARC = YES; 405 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 406 | CLANG_WARN_BOOL_CONVERSION = YES; 407 | CLANG_WARN_COMMA = YES; 408 | CLANG_WARN_CONSTANT_CONVERSION = YES; 409 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 410 | CLANG_WARN_EMPTY_BODY = YES; 411 | CLANG_WARN_ENUM_CONVERSION = YES; 412 | CLANG_WARN_INFINITE_RECURSION = YES; 413 | CLANG_WARN_INT_CONVERSION = YES; 414 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 415 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 416 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 417 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 418 | CLANG_WARN_STRICT_PROTOTYPES = YES; 419 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 420 | CLANG_WARN_UNREACHABLE_CODE = YES; 421 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 422 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 423 | COPY_PHASE_STRIP = NO; 424 | DEBUG_INFORMATION_FORMAT = dwarf; 425 | ENABLE_STRICT_OBJC_MSGSEND = YES; 426 | ENABLE_TESTABILITY = YES; 427 | GCC_C_LANGUAGE_STANDARD = gnu99; 428 | GCC_DYNAMIC_NO_PIC = NO; 429 | GCC_NO_COMMON_BLOCKS = YES; 430 | GCC_OPTIMIZATION_LEVEL = 0; 431 | GCC_PREPROCESSOR_DEFINITIONS = ( 432 | "DEBUG=1", 433 | "$(inherited)", 434 | ); 435 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 436 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 437 | GCC_WARN_UNDECLARED_SELECTOR = YES; 438 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 439 | GCC_WARN_UNUSED_FUNCTION = YES; 440 | GCC_WARN_UNUSED_VARIABLE = YES; 441 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 442 | MTL_ENABLE_DEBUG_INFO = YES; 443 | ONLY_ACTIVE_ARCH = YES; 444 | SDKROOT = iphoneos; 445 | TARGETED_DEVICE_FAMILY = "1,2"; 446 | }; 447 | name = Debug; 448 | }; 449 | 97C147041CF9000F007C117D /* Release */ = { 450 | isa = XCBuildConfiguration; 451 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 452 | buildSettings = { 453 | ALWAYS_SEARCH_USER_PATHS = NO; 454 | CLANG_ANALYZER_NONNULL = YES; 455 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 456 | CLANG_CXX_LIBRARY = "libc++"; 457 | CLANG_ENABLE_MODULES = YES; 458 | CLANG_ENABLE_OBJC_ARC = YES; 459 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 460 | CLANG_WARN_BOOL_CONVERSION = YES; 461 | CLANG_WARN_COMMA = YES; 462 | CLANG_WARN_CONSTANT_CONVERSION = YES; 463 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 464 | CLANG_WARN_EMPTY_BODY = YES; 465 | CLANG_WARN_ENUM_CONVERSION = YES; 466 | CLANG_WARN_INFINITE_RECURSION = YES; 467 | CLANG_WARN_INT_CONVERSION = YES; 468 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 469 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 470 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 471 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 472 | CLANG_WARN_STRICT_PROTOTYPES = YES; 473 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 474 | CLANG_WARN_UNREACHABLE_CODE = YES; 475 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 476 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 477 | COPY_PHASE_STRIP = NO; 478 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 479 | ENABLE_NS_ASSERTIONS = NO; 480 | ENABLE_STRICT_OBJC_MSGSEND = YES; 481 | GCC_C_LANGUAGE_STANDARD = gnu99; 482 | GCC_NO_COMMON_BLOCKS = YES; 483 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 484 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 485 | GCC_WARN_UNDECLARED_SELECTOR = YES; 486 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 487 | GCC_WARN_UNUSED_FUNCTION = YES; 488 | GCC_WARN_UNUSED_VARIABLE = YES; 489 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 490 | MTL_ENABLE_DEBUG_INFO = NO; 491 | SDKROOT = iphoneos; 492 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 493 | TARGETED_DEVICE_FAMILY = "1,2"; 494 | VALIDATE_PRODUCT = YES; 495 | }; 496 | name = Release; 497 | }; 498 | 97C147061CF9000F007C117D /* Debug */ = { 499 | isa = XCBuildConfiguration; 500 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 501 | buildSettings = { 502 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 503 | CLANG_ENABLE_MODULES = YES; 504 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 505 | ENABLE_BITCODE = NO; 506 | FRAMEWORK_SEARCH_PATHS = ( 507 | "$(inherited)", 508 | "$(PROJECT_DIR)/Flutter", 509 | ); 510 | INFOPLIST_FILE = Runner/Info.plist; 511 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 512 | LIBRARY_SEARCH_PATHS = ( 513 | "$(inherited)", 514 | "$(PROJECT_DIR)/Flutter", 515 | ); 516 | PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.providerShopper; 517 | PRODUCT_NAME = "$(TARGET_NAME)"; 518 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 519 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 520 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 521 | SWIFT_VERSION = 4.0; 522 | VERSIONING_SYSTEM = "apple-generic"; 523 | }; 524 | name = Debug; 525 | }; 526 | 97C147071CF9000F007C117D /* Release */ = { 527 | isa = XCBuildConfiguration; 528 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 529 | buildSettings = { 530 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 531 | CLANG_ENABLE_MODULES = YES; 532 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 533 | ENABLE_BITCODE = NO; 534 | FRAMEWORK_SEARCH_PATHS = ( 535 | "$(inherited)", 536 | "$(PROJECT_DIR)/Flutter", 537 | ); 538 | INFOPLIST_FILE = Runner/Info.plist; 539 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 540 | LIBRARY_SEARCH_PATHS = ( 541 | "$(inherited)", 542 | "$(PROJECT_DIR)/Flutter", 543 | ); 544 | PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.providerShopper; 545 | PRODUCT_NAME = "$(TARGET_NAME)"; 546 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 547 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 548 | SWIFT_VERSION = 4.0; 549 | VERSIONING_SYSTEM = "apple-generic"; 550 | }; 551 | name = Release; 552 | }; 553 | /* End XCBuildConfiguration section */ 554 | 555 | /* Begin XCConfigurationList section */ 556 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 557 | isa = XCConfigurationList; 558 | buildConfigurations = ( 559 | 97C147031CF9000F007C117D /* Debug */, 560 | 97C147041CF9000F007C117D /* Release */, 561 | 249021D3217E4FDB00AE95B9 /* Profile */, 562 | ); 563 | defaultConfigurationIsVisible = 0; 564 | defaultConfigurationName = Release; 565 | }; 566 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 567 | isa = XCConfigurationList; 568 | buildConfigurations = ( 569 | 97C147061CF9000F007C117D /* Debug */, 570 | 97C147071CF9000F007C117D /* Release */, 571 | 249021D4217E4FDB00AE95B9 /* Profile */, 572 | ); 573 | defaultConfigurationIsVisible = 0; 574 | defaultConfigurationName = Release; 575 | }; 576 | /* End XCConfigurationList section */ 577 | }; 578 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 579 | } 580 | -------------------------------------------------------------------------------- /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 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /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: [UIApplicationLaunchOptionsKey: 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/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/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/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/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/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/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/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/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/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/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/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/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/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/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/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/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/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/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/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/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/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/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/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/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/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/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/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/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/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/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/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flutter-samples/flutter-design-pattern/081168971f8bc6272b9f461a779851216cfdbae7/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 | shopper 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/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /lib/controllers/cart.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:shopper/models/catalog.dart'; 3 | 4 | class CartController with ChangeNotifier { 5 | List _itemIds; 6 | 7 | CartController() { 8 | init(); 9 | } 10 | 11 | List get items => _itemIds; 12 | 13 | int get totalPrice => 14 | items.fold(0, (total, current) => total + current.price); 15 | 16 | void init() { 17 | _itemIds = []; 18 | } 19 | 20 | add(Catalog catalog) { 21 | _itemIds.add(catalog); 22 | notifyListeners(); 23 | } 24 | 25 | remove(Catalog catalog) { 26 | _itemIds.removeWhere((item) => item.id == catalog.id); 27 | notifyListeners(); 28 | } 29 | 30 | clear() { 31 | _itemIds.clear(); 32 | notifyListeners(); 33 | } 34 | 35 | contains(id) { 36 | return _itemIds 37 | .map((item) { 38 | return item.id; 39 | }) 40 | .toList() 41 | .contains(id); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/controllers/catalog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shopper/repositories/catalog.dart'; 3 | import 'package:shopper/models/catalog.dart'; 4 | import 'dart:async'; 5 | 6 | class CatalogController with ChangeNotifier { 7 | final _catalogRepository = CatalogRepository(); 8 | List _items = []; 9 | List get catalogs => _items; 10 | 11 | CatalogController() { 12 | init(); 13 | } 14 | 15 | init() async { 16 | // initial sample data here. 17 | await addCatalog(); 18 | await addCatalog(); 19 | // end 20 | await getCatalogs(); 21 | } 22 | 23 | Future getCatalogs() async { 24 | _items = await _catalogRepository.getCatalogs(); 25 | notifyListeners(); 26 | } 27 | 28 | Future addCatalog() async { 29 | await _catalogRepository.addCatalog(); 30 | await getCatalogs(); 31 | notifyListeners(); 32 | } 33 | 34 | Future clearCatalogs() async { 35 | await _catalogRepository.clearCatalogs(); 36 | await getCatalogs(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/db/sqlite.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | 4 | import 'package:path/path.dart'; 5 | import 'package:path_provider/path_provider.dart'; 6 | import 'package:sqflite/sqflite.dart'; 7 | 8 | import 'package:shopper/driver/catalog.dart'; 9 | 10 | class DatabaseProvider { 11 | static final DatabaseProvider dbProvider = DatabaseProvider(); 12 | 13 | Database _database; 14 | 15 | Future get database async { 16 | if (_database != null) return _database; 17 | _database = await createDatabase(); 18 | return _database; 19 | } 20 | 21 | createDatabase() async { 22 | Directory documentsDirectory = await getApplicationDocumentsDirectory(); 23 | String path = join(documentsDirectory.path, CatalogDriver.database); 24 | 25 | var database = await openDatabase(path, 26 | version: 1, onCreate: initDB, onUpgrade: onUpgrade); 27 | return database; 28 | } 29 | 30 | Future onUpgrade(Database database, int oldVersion, int newVersion) async { 31 | await database.execute("DROP TABLE ${CatalogDriver.tableCatalog}"); 32 | await initDB(database, newVersion); 33 | } 34 | 35 | Future initDB(Database database, int version) async { 36 | return await database.execute("CREATE TABLE ${CatalogDriver.tableCatalog} (" 37 | "id INTEGER PRIMARY KEY," 38 | "name TEXT, " 39 | "color INTEGER, " 40 | "price INTEGER " 41 | ")"); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/driver/catalog.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:shopper/db/sqlite.dart'; 3 | import 'package:shopper/models/catalog.dart'; 4 | import 'package:shopper/utils/helps.dart'; 5 | 6 | class CatalogDriver { 7 | final dbProvider = DatabaseProvider.dbProvider; 8 | static final String database = 'shopper.db'; 9 | static final String tableCatalog = 'catalog'; 10 | 11 | CatalogDriver() { 12 | initCatalogs(); 13 | } 14 | Future initCatalogs() async { 15 | await clearCatalogs(); 16 | } 17 | 18 | Future addCatalog() async { 19 | final db = await dbProvider.database; 20 | int total = await getTotal(); 21 | Map randomJson = Helper.makeRandCatalog(total); 22 | var result = await db.insert(tableCatalog, randomJson); 23 | return result; 24 | } 25 | 26 | Future getCatalogs() async { 27 | final db = await dbProvider.database; 28 | var catalogList = List(); 29 | List result = await db.query(tableCatalog); 30 | catalogList = result.map((item) => Catalog.fromJson(item)).toList(); 31 | return catalogList; 32 | } 33 | 34 | Future getTotal() async { 35 | final db = await dbProvider.database; 36 | var result = 37 | await db.rawQuery("SELECT COUNT(id) as Total FROM $tableCatalog"); 38 | return result[0]['Total']; 39 | } 40 | 41 | Future clearCatalogs() async { 42 | final db = await dbProvider.database; 43 | var result = await db.delete( 44 | tableCatalog, 45 | ); 46 | return result; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/file/catalog.dart: -------------------------------------------------------------------------------- 1 | import 'package:shopper/models/catalog.dart'; 2 | 3 | List catalogList = List(); 4 | Map json1 = { 5 | "id": 1, 6 | "name": "Roger Vivier", 7 | "color": 0xFF4caf50, 8 | "price": 43 9 | }; 10 | Map json2 = { 11 | "id": 2, 12 | "name": "Calvin Klein", 13 | "color": 0xFF9c27b0, 14 | "price": 34 15 | }; 16 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | import 'package:shopper/controllers/cart.dart'; 4 | import 'package:shopper/controllers/catalog.dart'; 5 | import 'package:shopper/views/cart.dart'; 6 | import 'package:shopper/views/catalog.dart'; 7 | import 'package:shopper/views/order.dart'; 8 | 9 | void main() { 10 | runApp(MyApp()); 11 | } 12 | 13 | class MyApp extends StatelessWidget { 14 | @override 15 | Widget build(BuildContext context) { 16 | return MultiProvider( 17 | providers: [ 18 | ChangeNotifierProvider( 19 | builder: (context) => CatalogController(), 20 | child: ShopCatalog(), 21 | ), 22 | ChangeNotifierProvider( 23 | builder: (_) => CartController(), 24 | child: ShopCart(), 25 | ), 26 | ], 27 | child: MaterialApp( 28 | title: 'Shopper', 29 | debugShowCheckedModeBanner: false, 30 | initialRoute: '/', 31 | routes: { 32 | '/': (context) => ShopCatalog(), 33 | '/cart': (context) => ShopCart(), 34 | '/order': (context) => ShopOrder(), 35 | }, 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/memory/catalog.dart: -------------------------------------------------------------------------------- 1 | import 'package:shopper/models/catalog.dart'; 2 | import 'package:shopper/file/catalog.dart'; 3 | import 'package:shopper/utils/helps.dart'; 4 | 5 | class CatalogMemory { 6 | CatalogMemory() { 7 | initCatalogs(); 8 | } 9 | Future initCatalogs() async { 10 | catalogList.clear(); 11 | } 12 | 13 | Future getCatalogs() async { 14 | return catalogList; 15 | } 16 | 17 | Future addCatalog() async { 18 | Map randomJson = Helper.makeRandCatalog( 19 | catalogList.length, 20 | ); 21 | Catalog randomCatalog = Catalog.fromJson(randomJson); 22 | catalogList.add(randomCatalog); 23 | return catalogList.length + 1; 24 | } 25 | 26 | Future clearCatalogs() async { 27 | var result = await catalogList.clear(); 28 | return result; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/models/catalog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | @immutable 4 | class Catalog { 5 | final int id; 6 | final String name; 7 | final int color; 8 | final int price; 9 | 10 | Catalog(this.id, this.name, this.color, this.price); 11 | 12 | Catalog.fromJson(Map json) 13 | : id = json['id'], 14 | name = json['name'], 15 | color = json['color'], 16 | price = json['price']; 17 | 18 | Map toJson() => { 19 | 'id': id, 20 | 'name': name, 21 | 'color': color, 22 | 'price': price, 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /lib/repositories/catalog.dart: -------------------------------------------------------------------------------- 1 | import 'package:shopper/driver/catalog.dart'; 2 | import 'package:shopper/memory/catalog.dart'; 3 | 4 | /// Do fetch data logic as you need here 5 | const dataSource = 'memory'; 6 | 7 | class CatalogRepository { 8 | final _catalogDriver = CatalogDriver(); 9 | final _catalogFile = CatalogMemory(); 10 | 11 | Future getCatalogs({String query}) { 12 | switch (dataSource) { 13 | case 'memory': 14 | return _catalogFile.getCatalogs(); 15 | break; 16 | case 'db': 17 | return _catalogDriver.getCatalogs(); 18 | break; 19 | default: 20 | return _catalogFile.getCatalogs(); 21 | } 22 | } 23 | 24 | Future addCatalog() { 25 | switch (dataSource) { 26 | case 'memory': 27 | return _catalogFile.addCatalog(); 28 | break; 29 | case 'db': 30 | return _catalogDriver.addCatalog(); 31 | break; 32 | default: 33 | return _catalogFile.addCatalog(); 34 | } 35 | } 36 | 37 | Future clearCatalogs() { 38 | switch (dataSource) { 39 | case 'memory': 40 | return _catalogFile.clearCatalogs(); 41 | break; 42 | case 'db': 43 | return _catalogDriver.clearCatalogs(); 44 | break; 45 | default: 46 | return _catalogFile.clearCatalogs(); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/utils/helps.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'dart:math'; 3 | 4 | class Helper { 5 | static const catalogNames = [ 6 | 'Brioni', 7 | 'HERMES', 8 | 'Louis Vuitton', 9 | 'Bulgari', 10 | 'TAG Heuer', 11 | 'Benefit Cosmetics', 12 | 'Estee Lauder', 13 | 'Aramis', 14 | 'Van Cleef', 15 | 'Jaeger-LeCoultre', 16 | 'Ray-Ban', 17 | 'Pomellato', 18 | 'Ralph Lauren', 19 | 'Calvin Klein', 20 | 'Manolo Blahnik', 21 | 'Jimmy Choo', 22 | 'Roger Vivier', 23 | 'Salvatore Ferragamo', 24 | 'CHEANEY', 25 | 'EDWARD GREEN', 26 | 'CHANEL', 27 | 'Bordelle' 28 | ]; 29 | 30 | static Map makeRandCatalog(id) { 31 | var rand = Random(); 32 | var color = Colors.primaries[id % Colors.primaries.length]; 33 | Map randomJson = { 34 | "id": id + 1, 35 | "name": catalogNames[id % catalogNames.length], 36 | "color": int.parse('0x${color.value.toRadixString(16)}'), 37 | "price": rand.nextInt(100) 38 | }; 39 | return randomJson; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/views/cart.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | import 'package:badges/badges.dart'; 4 | import 'package:shopper/controllers/cart.dart'; 5 | import 'package:shopper/views/order.dart'; 6 | 7 | class ShopCart extends StatelessWidget { 8 | @override 9 | Widget build(BuildContext context) { 10 | return Scaffold( 11 | appBar: _AppBar(), 12 | body: Container( 13 | color: Colors.orange, 14 | child: Column( 15 | children: [ 16 | Expanded( 17 | child: Padding( 18 | padding: const EdgeInsets.only( 19 | top: 18, 20 | bottom: 18, 21 | ), 22 | child: _CartList(), 23 | ), 24 | ), 25 | Divider(height: 4, color: Colors.white), 26 | _CartTotal() 27 | ], 28 | ), 29 | ), 30 | ); 31 | } 32 | } 33 | 34 | class _CartList extends StatelessWidget { 35 | @override 36 | Widget build(BuildContext context) { 37 | var cart = Provider.of(context); 38 | return ListView.builder( 39 | itemCount: cart.items.length, 40 | itemBuilder: (context, index) => ListTile( 41 | leading: ClipOval( 42 | child: Container( 43 | padding: EdgeInsets.all(0.0), 44 | color: Colors.white, 45 | child: Icon( 46 | Icons.fiber_manual_record, 47 | color: Color(cart.items[index].color), 48 | ), 49 | ), 50 | ), 51 | title: Text( 52 | cart.items[index].name, 53 | style: TextStyle( 54 | fontFamily: 'YaHei', 55 | color: Colors.white, 56 | fontSize: 18, 57 | ), 58 | ), 59 | trailing: IconButton( 60 | icon: Icon( 61 | Icons.delete_outline, 62 | color: Colors.white, 63 | ), 64 | onPressed: () { 65 | cart.remove(cart.items[index]); 66 | }, 67 | ), 68 | ), 69 | ); 70 | } 71 | } 72 | 73 | class _CartTotal extends StatelessWidget { 74 | @override 75 | Widget build(BuildContext context) { 76 | return SizedBox( 77 | height: 200, 78 | child: Center( 79 | child: Row( 80 | mainAxisAlignment: MainAxisAlignment.center, 81 | children: [ 82 | Consumer( 83 | builder: (context, cart, child) => Text('\$${cart.totalPrice}', 84 | style: TextStyle( 85 | fontSize: 48, 86 | color: Colors.white, 87 | )), 88 | ), 89 | SizedBox(width: 24), 90 | FlatButton( 91 | onPressed: () { 92 | Navigator.push( 93 | context, 94 | MaterialPageRoute( 95 | builder: (context) => ShopOrder(), 96 | ), 97 | ); 98 | }, 99 | color: Colors.white, 100 | child: Text('BUY'), 101 | ), 102 | ], 103 | ), 104 | ), 105 | ); 106 | } 107 | } 108 | 109 | class _AppBar extends StatelessWidget with PreferredSizeWidget { 110 | @override 111 | Widget build(BuildContext context) { 112 | var cartController = Provider.of(context); 113 | return AppBar( 114 | title: Text('Cart'), 115 | backgroundColor: Colors.teal, 116 | actions: [ 117 | Consumer( 118 | builder: (context, cart, child) => IconButton( 119 | icon: Badge( 120 | badgeColor: Colors.orange, 121 | toAnimate: false, 122 | badgeContent: Text( 123 | '${cart.items.length}', 124 | style: TextStyle( 125 | fontSize: 12, 126 | color: Colors.white, 127 | ), 128 | ), 129 | child: Icon( 130 | Icons.delete_forever, 131 | color: Colors.white, 132 | ), 133 | ), 134 | onPressed: () { 135 | cartController.clear(); 136 | }, 137 | ), 138 | ), 139 | ], 140 | ); 141 | } 142 | 143 | @override 144 | Size get preferredSize => Size.fromHeight(kToolbarHeight); 145 | } 146 | -------------------------------------------------------------------------------- /lib/views/catalog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | import 'package:shopper/controllers/cart.dart'; 4 | import 'package:shopper/controllers/catalog.dart'; 5 | import 'package:shopper/models/catalog.dart'; 6 | import 'package:flutter_svg/flutter_svg.dart'; 7 | import 'package:badges/badges.dart'; 8 | 9 | class ShopCatalog extends StatelessWidget { 10 | @override 11 | Widget build(BuildContext context) { 12 | return Scaffold( 13 | appBar: _AppBar(), 14 | body: Consumer( 15 | builder: (context, catalog, _) => ListView.builder( 16 | itemCount: catalog.catalogs.length, 17 | itemBuilder: (context, index) => _CatalogList( 18 | catalog.catalogs[index], 19 | ), 20 | ), 21 | ), 22 | floatingActionButtonLocation: FloatingActionButtonLocation.endDocked, 23 | floatingActionButton: FloatingActionButton( 24 | onPressed: () { 25 | var catalog = Provider.of(context); 26 | catalog.addCatalog(); 27 | }, 28 | tooltip: 'Add catalog', 29 | child: Icon(Icons.add), 30 | elevation: 2.0, 31 | ), 32 | bottomNavigationBar: _BottomBar(), 33 | ); 34 | } 35 | } 36 | 37 | class _CartButton extends StatelessWidget { 38 | final Catalog item; 39 | const _CartButton({Key key, @required this.item}) : super(key: key); 40 | @override 41 | Widget build(BuildContext context) { 42 | var cart = Provider.of(context); 43 | return Container( 44 | color: Colors.transparent, 45 | child: IconButton( 46 | icon: cart.contains(item.id) 47 | ? Icon( 48 | Icons.remove_shopping_cart, 49 | ) 50 | : Icon( 51 | Icons.add_shopping_cart, 52 | ), 53 | color: cart.contains(item.id) ? Colors.grey : Colors.black, 54 | splashColor: Theme.of(context).primaryColor, 55 | onPressed: () { 56 | cart.contains(item.id) ? cart.remove(item) : cart.add(item); 57 | }, 58 | ), 59 | ); 60 | } 61 | } 62 | 63 | class _CartItem extends StatelessWidget { 64 | final Catalog item; 65 | const _CartItem({Key key, @required this.item}) : super(key: key); 66 | @override 67 | Widget build(BuildContext context) { 68 | var cart = Provider.of(context); 69 | return Expanded( 70 | child: Padding( 71 | padding: EdgeInsets.only( 72 | left: 18, 73 | right: 18, 74 | ), 75 | child: Text( 76 | item.name, 77 | style: TextStyle( 78 | fontFamily: 'YaHei', 79 | fontWeight: FontWeight.w700, 80 | fontSize: 20, 81 | color: cart.contains(item.id) ? Colors.grey : Colors.black, 82 | decoration: cart.contains(item.id) 83 | ? TextDecoration.lineThrough 84 | : TextDecoration.none, 85 | ), 86 | ), 87 | ), 88 | ); 89 | } 90 | } 91 | 92 | class _AppBar extends StatelessWidget with PreferredSizeWidget { 93 | @override 94 | Widget build(BuildContext context) { 95 | var catalogController = Provider.of(context); 96 | return AppBar( 97 | title: Text('Catalog'), 98 | actions: [ 99 | Consumer( 100 | builder: (context, catalog, child) => IconButton( 101 | icon: Badge( 102 | badgeColor: Colors.orange, 103 | toAnimate: false, 104 | badgeContent: Text( 105 | '${catalog.catalogs.length}', 106 | style: TextStyle( 107 | fontSize: 12, 108 | color: Colors.white, 109 | ), 110 | ), 111 | child: Icon( 112 | Icons.delete_forever, 113 | color: Colors.white, 114 | ), 115 | ), 116 | onPressed: () { 117 | catalogController.clearCatalogs(); 118 | }, 119 | ), 120 | ), 121 | ], 122 | ); 123 | } 124 | 125 | @override 126 | Size get preferredSize => Size.fromHeight(kToolbarHeight); 127 | } 128 | 129 | class _BottomBar extends StatelessWidget { 130 | @override 131 | Widget build(BuildContext context) { 132 | return BottomAppBar( 133 | color: Colors.cyan, 134 | shape: CircularNotchedRectangle(), 135 | child: Container( 136 | height: 60, 137 | child: Row( 138 | mainAxisSize: MainAxisSize.max, 139 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 140 | children: [ 141 | Consumer( 142 | builder: (context, cart, child) => Container( 143 | width: 100, 144 | height: 60, 145 | color: Colors.orange, 146 | child: IconButton( 147 | color: Colors.red, 148 | iconSize: 30.0, 149 | padding: EdgeInsets.only(left: 0.0), 150 | icon: Badge( 151 | badgeContent: Text( 152 | '${cart.items.length}', 153 | style: TextStyle( 154 | fontSize: 12, 155 | color: Colors.white, 156 | ), 157 | ), 158 | child: Icon( 159 | Icons.shopping_cart, 160 | color: Colors.white, 161 | ), 162 | ), 163 | onPressed: () => Navigator.pushNamed(context, '/cart'), 164 | ), 165 | ), 166 | ), 167 | Consumer( 168 | builder: (context, cart, child) => _buildLabel( 169 | Icons.attach_money, 170 | '${cart.totalPrice}', 171 | EdgeInsets.only(right: 150.0, top: 10.0, bottom: 10.0), 172 | ), 173 | ), 174 | ], 175 | ), 176 | ), 177 | ); 178 | } 179 | 180 | Widget _buildLabel(IconData icon, String text, EdgeInsets padding) { 181 | return Container( 182 | color: Colors.transparent, 183 | padding: padding, 184 | child: Row( 185 | children: [ 186 | Icon( 187 | icon, 188 | size: 28, 189 | color: Colors.white, 190 | ), 191 | Consumer( 192 | builder: (context, cart, child) => Text( 193 | '$text', 194 | style: TextStyle( 195 | fontSize: 28, 196 | color: Colors.white, 197 | fontFamily: 'YaHei', 198 | fontWeight: FontWeight.w800, 199 | ), 200 | ), 201 | ), 202 | ], 203 | ), 204 | ); 205 | } 206 | } 207 | 208 | class _CatalogList extends StatelessWidget { 209 | final Catalog item; 210 | _CatalogList(this.item, {Key key}) : super(key: key); 211 | @override 212 | Widget build(BuildContext context) { 213 | return Padding( 214 | padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), 215 | child: LimitedBox( 216 | maxHeight: 48, 217 | child: Row( 218 | children: [ 219 | AspectRatio( 220 | aspectRatio: 1, 221 | child: Container( 222 | decoration: BoxDecoration( 223 | color: Color(item.color), 224 | border: Border.all( 225 | color: Color(item.color), 226 | ), 227 | borderRadius: BorderRadius.all( 228 | const Radius.circular(5.0), 229 | ), 230 | ), 231 | padding: EdgeInsets.all(5.0), 232 | child: SvgPicture.asset("assets/${item.name}.svg", 233 | color: Colors.white, semanticsLabel: '${item.name}'), 234 | ), 235 | ), 236 | Container( 237 | width: 40, 238 | color: Colors.transparent, 239 | child: Center( 240 | child: Text( 241 | item.price.toString(), 242 | style: TextStyle( 243 | fontFamily: 'YaHei', 244 | fontWeight: FontWeight.w700, 245 | fontSize: 12, 246 | color: Color(item.color), 247 | ), 248 | ), 249 | ), 250 | ), 251 | _CartItem(item: item), 252 | _CartButton(item: item), 253 | ], 254 | ), 255 | ), 256 | ); 257 | } 258 | } 259 | -------------------------------------------------------------------------------- /lib/views/order.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | import 'package:flutter_svg/flutter_svg.dart'; 4 | import 'package:shopper/controllers/cart.dart'; 5 | import 'package:shopper/models/catalog.dart'; 6 | 7 | class ShopOrder extends StatelessWidget { 8 | @override 9 | Widget build(BuildContext context) { 10 | var cartController = Provider.of(context); 11 | return Scaffold( 12 | body: CustomScrollView( 13 | slivers: [ 14 | _AppBar(), 15 | SliverFixedExtentList( 16 | itemExtent: MediaQuery.of(context).size.width, 17 | delegate: SliverChildBuilderDelegate((context, index) { 18 | return _OrderList(item: cartController.items[index]); 19 | }, childCount: cartController.items.length), 20 | ), 21 | ], 22 | ), 23 | ); 24 | } 25 | } 26 | 27 | class _AppBar extends StatelessWidget { 28 | @override 29 | Widget build(BuildContext context) { 30 | return SliverAppBar( 31 | title: Text('Order'), 32 | backgroundColor: Colors.indigo, 33 | pinned: true, 34 | actions: [ 35 | IconButton( 36 | icon: Icon( 37 | Icons.home, 38 | color: Colors.white, 39 | ), 40 | onPressed: () { 41 | Navigator.popUntil( 42 | context, 43 | ModalRoute.withName( 44 | Navigator.defaultRouteName, 45 | ), 46 | ); 47 | }, 48 | ), 49 | ], 50 | ); 51 | } 52 | } 53 | 54 | class _OrderList extends StatelessWidget { 55 | final Catalog item; 56 | const _OrderList({Key key, @required this.item}) : super(key: key); 57 | @override 58 | Widget build(BuildContext context) { 59 | return Stack( 60 | children: [ 61 | SizedBox( 62 | height: MediaQuery.of(context).size.width, 63 | width: MediaQuery.of(context).size.width, 64 | child: Card( 65 | color: Colors.white, 66 | clipBehavior: Clip.antiAlias, 67 | borderOnForeground: true, 68 | elevation: 0.0, 69 | margin: EdgeInsets.all(10.0), 70 | shape: BeveledRectangleBorder( 71 | side: BorderSide( 72 | color: Colors.grey, 73 | width: 0.0, 74 | ), 75 | ), 76 | child: Container( 77 | padding: EdgeInsets.all( 78 | MediaQuery.of(context).size.width / 4, 79 | ), 80 | child: SvgPicture.asset("assets/${item.name}.svg", 81 | color: Color(item.color), semanticsLabel: '${item.name}'), 82 | ), 83 | ), 84 | ), 85 | Positioned( 86 | top: 20.0, 87 | left: 20.0, 88 | child: Text( 89 | item.name, 90 | style: TextStyle( 91 | fontFamily: 'YaHei', 92 | fontSize: 20, 93 | color: Color(item.color), 94 | fontWeight: FontWeight.w800, 95 | ), 96 | ), 97 | ), 98 | Positioned( 99 | bottom: 20.0, 100 | right: 20.0, 101 | child: Text( 102 | "\$${item.price.toString()}", 103 | style: TextStyle( 104 | fontFamily: 'YaHei', 105 | fontSize: 20, 106 | color: Color(item.color), 107 | fontWeight: FontWeight.w800, 108 | ), 109 | ), 110 | ) 111 | ], 112 | ); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | analyzer: 5 | dependency: transitive 6 | description: 7 | name: analyzer 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "0.36.4" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.5.2" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.2.0" 25 | badges: 26 | dependency: "direct dev" 27 | description: 28 | name: badges 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.1.0" 32 | boolean_selector: 33 | dependency: transitive 34 | description: 35 | name: boolean_selector 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.0.4" 39 | charcode: 40 | dependency: transitive 41 | description: 42 | name: charcode 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.1.2" 46 | collection: 47 | dependency: transitive 48 | description: 49 | name: collection 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.14.11" 53 | convert: 54 | dependency: transitive 55 | description: 56 | name: convert 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.1" 60 | crypto: 61 | dependency: transitive 62 | description: 63 | name: crypto 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "2.1.2" 67 | csslib: 68 | dependency: transitive 69 | description: 70 | name: csslib 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "0.16.1" 74 | flutter: 75 | dependency: "direct main" 76 | description: flutter 77 | source: sdk 78 | version: "0.0.0" 79 | flutter_svg: 80 | dependency: "direct dev" 81 | description: 82 | name: flutter_svg 83 | url: "https://pub.dartlang.org" 84 | source: hosted 85 | version: "0.14.0" 86 | flutter_test: 87 | dependency: "direct dev" 88 | description: flutter 89 | source: sdk 90 | version: "0.0.0" 91 | front_end: 92 | dependency: transitive 93 | description: 94 | name: front_end 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "0.1.19" 98 | glob: 99 | dependency: transitive 100 | description: 101 | name: glob 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "1.1.7" 105 | html: 106 | dependency: transitive 107 | description: 108 | name: html 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "0.14.0+2" 112 | http: 113 | dependency: transitive 114 | description: 115 | name: http 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "0.12.0+2" 119 | http_multi_server: 120 | dependency: transitive 121 | description: 122 | name: http_multi_server 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "2.1.0" 126 | http_parser: 127 | dependency: transitive 128 | description: 129 | name: http_parser 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "3.1.3" 133 | io: 134 | dependency: transitive 135 | description: 136 | name: io 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "0.3.3" 140 | js: 141 | dependency: transitive 142 | description: 143 | name: js 144 | url: "https://pub.dartlang.org" 145 | source: hosted 146 | version: "0.6.1+1" 147 | json_rpc_2: 148 | dependency: transitive 149 | description: 150 | name: json_rpc_2 151 | url: "https://pub.dartlang.org" 152 | source: hosted 153 | version: "2.1.0" 154 | kernel: 155 | dependency: transitive 156 | description: 157 | name: kernel 158 | url: "https://pub.dartlang.org" 159 | source: hosted 160 | version: "0.3.19" 161 | matcher: 162 | dependency: transitive 163 | description: 164 | name: matcher 165 | url: "https://pub.dartlang.org" 166 | source: hosted 167 | version: "0.12.5" 168 | meta: 169 | dependency: transitive 170 | description: 171 | name: meta 172 | url: "https://pub.dartlang.org" 173 | source: hosted 174 | version: "1.1.6" 175 | mime: 176 | dependency: transitive 177 | description: 178 | name: mime 179 | url: "https://pub.dartlang.org" 180 | source: hosted 181 | version: "0.9.6+3" 182 | multi_server_socket: 183 | dependency: transitive 184 | description: 185 | name: multi_server_socket 186 | url: "https://pub.dartlang.org" 187 | source: hosted 188 | version: "1.0.2" 189 | node_preamble: 190 | dependency: transitive 191 | description: 192 | name: node_preamble 193 | url: "https://pub.dartlang.org" 194 | source: hosted 195 | version: "1.4.6" 196 | package_config: 197 | dependency: transitive 198 | description: 199 | name: package_config 200 | url: "https://pub.dartlang.org" 201 | source: hosted 202 | version: "1.1.0" 203 | package_resolver: 204 | dependency: transitive 205 | description: 206 | name: package_resolver 207 | url: "https://pub.dartlang.org" 208 | source: hosted 209 | version: "1.0.10" 210 | path: 211 | dependency: transitive 212 | description: 213 | name: path 214 | url: "https://pub.dartlang.org" 215 | source: hosted 216 | version: "1.6.2" 217 | path_drawing: 218 | dependency: transitive 219 | description: 220 | name: path_drawing 221 | url: "https://pub.dartlang.org" 222 | source: hosted 223 | version: "0.4.1" 224 | path_parsing: 225 | dependency: transitive 226 | description: 227 | name: path_parsing 228 | url: "https://pub.dartlang.org" 229 | source: hosted 230 | version: "0.1.4" 231 | path_provider: 232 | dependency: "direct dev" 233 | description: 234 | name: path_provider 235 | url: "https://pub.dartlang.org" 236 | source: hosted 237 | version: "0.5.0+1" 238 | pedantic: 239 | dependency: transitive 240 | description: 241 | name: pedantic 242 | url: "https://pub.dartlang.org" 243 | source: hosted 244 | version: "1.7.0" 245 | petitparser: 246 | dependency: transitive 247 | description: 248 | name: petitparser 249 | url: "https://pub.dartlang.org" 250 | source: hosted 251 | version: "2.4.0" 252 | pool: 253 | dependency: transitive 254 | description: 255 | name: pool 256 | url: "https://pub.dartlang.org" 257 | source: hosted 258 | version: "1.4.0" 259 | provider: 260 | dependency: "direct main" 261 | description: 262 | name: provider 263 | url: "https://pub.dartlang.org" 264 | source: hosted 265 | version: "3.1.0" 266 | pub_semver: 267 | dependency: transitive 268 | description: 269 | name: pub_semver 270 | url: "https://pub.dartlang.org" 271 | source: hosted 272 | version: "1.4.2" 273 | quiver: 274 | dependency: transitive 275 | description: 276 | name: quiver 277 | url: "https://pub.dartlang.org" 278 | source: hosted 279 | version: "2.0.3" 280 | shelf: 281 | dependency: transitive 282 | description: 283 | name: shelf 284 | url: "https://pub.dartlang.org" 285 | source: hosted 286 | version: "0.7.5" 287 | shelf_packages_handler: 288 | dependency: transitive 289 | description: 290 | name: shelf_packages_handler 291 | url: "https://pub.dartlang.org" 292 | source: hosted 293 | version: "1.0.4" 294 | shelf_static: 295 | dependency: transitive 296 | description: 297 | name: shelf_static 298 | url: "https://pub.dartlang.org" 299 | source: hosted 300 | version: "0.2.8" 301 | shelf_web_socket: 302 | dependency: transitive 303 | description: 304 | name: shelf_web_socket 305 | url: "https://pub.dartlang.org" 306 | source: hosted 307 | version: "0.2.3" 308 | sky_engine: 309 | dependency: transitive 310 | description: flutter 311 | source: sdk 312 | version: "0.0.99" 313 | source_map_stack_trace: 314 | dependency: transitive 315 | description: 316 | name: source_map_stack_trace 317 | url: "https://pub.dartlang.org" 318 | source: hosted 319 | version: "1.1.5" 320 | source_maps: 321 | dependency: transitive 322 | description: 323 | name: source_maps 324 | url: "https://pub.dartlang.org" 325 | source: hosted 326 | version: "0.10.8" 327 | source_span: 328 | dependency: transitive 329 | description: 330 | name: source_span 331 | url: "https://pub.dartlang.org" 332 | source: hosted 333 | version: "1.5.5" 334 | sqflite: 335 | dependency: "direct dev" 336 | description: 337 | name: sqflite 338 | url: "https://pub.dartlang.org" 339 | source: hosted 340 | version: "1.1.6+4" 341 | stack_trace: 342 | dependency: transitive 343 | description: 344 | name: stack_trace 345 | url: "https://pub.dartlang.org" 346 | source: hosted 347 | version: "1.9.3" 348 | stream_channel: 349 | dependency: transitive 350 | description: 351 | name: stream_channel 352 | url: "https://pub.dartlang.org" 353 | source: hosted 354 | version: "2.0.0" 355 | string_scanner: 356 | dependency: transitive 357 | description: 358 | name: string_scanner 359 | url: "https://pub.dartlang.org" 360 | source: hosted 361 | version: "1.0.4" 362 | synchronized: 363 | dependency: transitive 364 | description: 365 | name: synchronized 366 | url: "https://pub.dartlang.org" 367 | source: hosted 368 | version: "2.1.0+1" 369 | term_glyph: 370 | dependency: transitive 371 | description: 372 | name: term_glyph 373 | url: "https://pub.dartlang.org" 374 | source: hosted 375 | version: "1.1.0" 376 | test: 377 | dependency: "direct dev" 378 | description: 379 | name: test 380 | url: "https://pub.dartlang.org" 381 | source: hosted 382 | version: "1.6.3" 383 | test_api: 384 | dependency: transitive 385 | description: 386 | name: test_api 387 | url: "https://pub.dartlang.org" 388 | source: hosted 389 | version: "0.2.5" 390 | test_core: 391 | dependency: transitive 392 | description: 393 | name: test_core 394 | url: "https://pub.dartlang.org" 395 | source: hosted 396 | version: "0.2.5" 397 | typed_data: 398 | dependency: transitive 399 | description: 400 | name: typed_data 401 | url: "https://pub.dartlang.org" 402 | source: hosted 403 | version: "1.1.6" 404 | vector_math: 405 | dependency: transitive 406 | description: 407 | name: vector_math 408 | url: "https://pub.dartlang.org" 409 | source: hosted 410 | version: "2.0.8" 411 | vm_service_client: 412 | dependency: transitive 413 | description: 414 | name: vm_service_client 415 | url: "https://pub.dartlang.org" 416 | source: hosted 417 | version: "0.2.6+3" 418 | watcher: 419 | dependency: transitive 420 | description: 421 | name: watcher 422 | url: "https://pub.dartlang.org" 423 | source: hosted 424 | version: "0.9.7+12" 425 | web_socket_channel: 426 | dependency: transitive 427 | description: 428 | name: web_socket_channel 429 | url: "https://pub.dartlang.org" 430 | source: hosted 431 | version: "1.0.15" 432 | xml: 433 | dependency: transitive 434 | description: 435 | name: xml 436 | url: "https://pub.dartlang.org" 437 | source: hosted 438 | version: "3.5.0" 439 | yaml: 440 | dependency: transitive 441 | description: 442 | name: yaml 443 | url: "https://pub.dartlang.org" 444 | source: hosted 445 | version: "2.1.16" 446 | sdks: 447 | dart: ">=2.4.0 <3.0.0" 448 | flutter: ">=1.5.9-pre.94 <2.0.0" 449 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: shopper 2 | description: A shopping app sample that uses Provider for state management. 3 | 4 | version: 1.0.0+1 5 | 6 | environment: 7 | sdk: ">=2.3.0 <3.0.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | 13 | # Import the provider package. 14 | provider: ^3.0.0 15 | 16 | dev_dependencies: 17 | flutter_test: 18 | sdk: flutter 19 | 20 | test: ^1.5.1 21 | sqflite: ^1.1.0 22 | path_provider: ^0.5.0+1 23 | flutter_svg: ^0.14.0 24 | badges: ^1.1.0 25 | 26 | flutter: 27 | uses-material-design: true 28 | 29 | fonts: 30 | - family: YaHei 31 | fonts: 32 | - asset: fonts/YaHei/Microsoft-YaHei.ttf 33 | weight: 700 34 | 35 | assets: 36 | #https://www.svgrepo.com/svg/50532/shoes 37 | - assets/ 38 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Flutter team. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter_test/flutter_test.dart'; 7 | import 'package:shopper/main.dart'; 8 | 9 | void main() { 10 | testWidgets('smoke test', (tester) async { 11 | // Build our app and trigger a frame. 12 | await tester.pumpWidget(MyApp()); 13 | 14 | // Check that shopping cart is empty at start. 15 | await tester.tap(find.byIcon(Icons.shopping_cart)); 16 | await tester.pumpAndSettle(); 17 | expect(find.text('\$0'), findsOneWidget); 18 | 19 | // Buy an item. 20 | await tester.pageBack(); 21 | await tester.pumpAndSettle(); 22 | await tester.tap(find.text('ADD').first); 23 | 24 | // Check that the shopping cart is not empty anymore. 25 | await tester.tap(find.byIcon(Icons.shopping_cart)); 26 | await tester.pumpAndSettle(); 27 | expect(find.text('\$0'), findsNothing); 28 | }); 29 | } 30 | --------------------------------------------------------------------------------