├── .gitignore ├── .metadata ├── README.md ├── android ├── app │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── gen │ │ └── com │ │ │ └── example │ │ │ └── myapp │ │ │ ├── BuildConfig.java │ │ │ ├── Manifest.java │ │ │ └── R.java │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── myapp │ │ │ └── MainActivity.java │ │ └── res │ │ ├── drawable │ │ └── launch_background.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ └── values │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── demo ├── 01.png └── 02.jpg ├── ios ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings ├── Runner │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ └── main.m └── xcode_backend.sh ├── lib ├── app.dart ├── main.dart ├── pages │ ├── cart │ │ ├── cart_item.dart │ │ ├── data.dart │ │ └── shopping_cart.dart │ ├── home │ │ ├── data.dart │ │ ├── goods_item.dart │ │ ├── home.dart │ │ ├── swiper.dart │ │ ├── top_address.dart │ │ └── top_nav.dart │ ├── order │ │ └── order_list.dart │ └── user │ │ └── user_center.dart └── utils │ ├── adapt.dart │ ├── config.dart │ └── util.dart ├── pubspec.yaml └── test └── widget_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.lock 4 | *.log 5 | *.pyc 6 | *.swp 7 | .DS_Store 8 | .atom/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # Visual Studio Code related 20 | .vscode/ 21 | 22 | # Flutter/Dart/Pub related 23 | **/doc/api/ 24 | .dart_tool/ 25 | .flutter-plugins 26 | .packages 27 | .pub-cache/ 28 | .pub/ 29 | build/ 30 | 31 | # Android related 32 | **/android/**/gradle-wrapper.jar 33 | **/android/.gradle 34 | **/android/captures/ 35 | **/android/gradlew 36 | **/android/gradlew.bat 37 | **/android/local.properties 38 | **/android/**/GeneratedPluginRegistrant.java 39 | 40 | # iOS/XCode related 41 | **/ios/**/*.mode1v3 42 | **/ios/**/*.mode2v3 43 | **/ios/**/*.moved-aside 44 | **/ios/**/*.pbxuser 45 | **/ios/**/*.perspectivev3 46 | **/ios/**/*sync/ 47 | **/ios/**/.sconsign.dblite 48 | **/ios/**/.tags* 49 | **/ios/**/.vagrant/ 50 | **/ios/**/DerivedData/ 51 | **/ios/**/Icon? 52 | **/ios/**/Pods/ 53 | **/ios/**/.symlinks/ 54 | **/ios/**/profile 55 | **/ios/**/xcuserdata 56 | **/ios/.generated/ 57 | **/ios/Flutter/App.framework 58 | **/ios/Flutter/Flutter.framework 59 | **/ios/Flutter/Generated.xcconfig 60 | **/ios/Flutter/app.flx 61 | **/ios/Flutter/app.zip 62 | **/ios/Flutter/flutter_assets/ 63 | **/ios/ServiceDefinitions.json 64 | **/ios/Runner/GeneratedPluginRegistrant.* 65 | 66 | # Exceptions to above rules. 67 | !**/ios/**/default.mode1v3 68 | !**/ios/**/default.mode2v3 69 | !**/ios/**/default.pbxuser 70 | !**/ios/**/default.perspectivev3 71 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 72 | -------------------------------------------------------------------------------- /.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: 5391447fae6209bb21a89e6a5a6583cac1af9b4b 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lean Flutter and make an App Demo. 2 | Learn to use Flutter basic grammar. make an simple App. 3 | 4 | ## Getting Started 5 | ``` 6 | git clone https://github.com/wangweianger/FlutterApp.git 7 | 8 | install packages 9 | 10 | flutter run 11 | ``` 12 | 13 | ## utils/adapt.dart 14 | 手机屏幕适配,设计原稿默认750px 15 | 16 | ## Flutter - Beautiful native apps in record time 17 | https://flutter.io/ 18 | 19 | ## Flutter中文网 20 | https://flutterchina.club/ 21 | 22 | ## Flutter icons reference link. 23 | https://material.io/tools/icons/?style=baseline 24 | 25 | ## Dart Packages 26 | https://pub.dartlang.org/ 27 | 28 | ### DEMO图片 29 | ### iphone效果 30 | ![](https://github.com/wangweianger/FlutterApp/blob/master/demo/01.png "") 31 | ### android真机效果 32 | ![](https://github.com/wangweianger/FlutterApp/blob/master/demo/02.jpg "") -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 27 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.example.myapp" 37 | minSdkVersion 16 38 | targetSdkVersion 27 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 61 | } 62 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /android/app/src/main/gen/com/example/myapp/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /*___Generated_by_IDEA___*/ 2 | 3 | package com.example.myapp; 4 | 5 | /* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ 6 | public final class BuildConfig { 7 | public final static boolean DEBUG = Boolean.parseBoolean(null); 8 | } -------------------------------------------------------------------------------- /android/app/src/main/gen/com/example/myapp/Manifest.java: -------------------------------------------------------------------------------- 1 | /*___Generated_by_IDEA___*/ 2 | 3 | package com.example.myapp; 4 | 5 | /* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ 6 | public final class Manifest { 7 | } -------------------------------------------------------------------------------- /android/app/src/main/gen/com/example/myapp/R.java: -------------------------------------------------------------------------------- 1 | /*___Generated_by_IDEA___*/ 2 | 3 | package com.example.myapp; 4 | 5 | /* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ 6 | public final class R { 7 | } -------------------------------------------------------------------------------- /android/app/src/main/java/com/example/myapp/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.myapp; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.2.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /android/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 | -------------------------------------------------------------------------------- /demo/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/demo/01.png -------------------------------------------------------------------------------- /demo/02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/demo/02.jpg -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.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 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; }; 12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 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 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 19 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 20 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 21 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 22 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXCopyFilesBuildPhase section */ 26 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 27 | isa = PBXCopyFilesBuildPhase; 28 | buildActionMask = 2147483647; 29 | dstPath = ""; 30 | dstSubfolderSpec = 10; 31 | files = ( 32 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 33 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 34 | ); 35 | name = "Embed Frameworks"; 36 | runOnlyForDeploymentPostprocessing = 0; 37 | }; 38 | /* End PBXCopyFilesBuildPhase section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 42 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 43 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; 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 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 47 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 48 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 49 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 50 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 51 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 52 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 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 | /* End PBXFileReference section */ 59 | 60 | /* Begin PBXFrameworksBuildPhase section */ 61 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 66 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 67 | ); 68 | runOnlyForDeploymentPostprocessing = 0; 69 | }; 70 | /* End PBXFrameworksBuildPhase section */ 71 | 72 | /* Begin PBXGroup section */ 73 | 9740EEB11CF90186004384FC /* Flutter */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, 77 | 3B80C3931E831B6300D905FE /* App.framework */, 78 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 79 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 80 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 81 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 82 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 83 | ); 84 | name = Flutter; 85 | sourceTree = ""; 86 | }; 87 | 97C146E51CF9000F007C117D = { 88 | isa = PBXGroup; 89 | children = ( 90 | 9740EEB11CF90186004384FC /* Flutter */, 91 | 97C146F01CF9000F007C117D /* Runner */, 92 | 97C146EF1CF9000F007C117D /* Products */, 93 | ); 94 | sourceTree = ""; 95 | }; 96 | 97C146EF1CF9000F007C117D /* Products */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 97C146EE1CF9000F007C117D /* Runner.app */, 100 | ); 101 | name = Products; 102 | sourceTree = ""; 103 | }; 104 | 97C146F01CF9000F007C117D /* Runner */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 108 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 109 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 110 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 111 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 112 | 97C147021CF9000F007C117D /* Info.plist */, 113 | 97C146F11CF9000F007C117D /* Supporting Files */, 114 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 115 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 116 | ); 117 | path = Runner; 118 | sourceTree = ""; 119 | }; 120 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 97C146F21CF9000F007C117D /* main.m */, 124 | ); 125 | name = "Supporting Files"; 126 | sourceTree = ""; 127 | }; 128 | /* End PBXGroup section */ 129 | 130 | /* Begin PBXNativeTarget section */ 131 | 97C146ED1CF9000F007C117D /* Runner */ = { 132 | isa = PBXNativeTarget; 133 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 134 | buildPhases = ( 135 | 9740EEB61CF901F6004384FC /* Run Script */, 136 | 97C146EA1CF9000F007C117D /* Sources */, 137 | 97C146EB1CF9000F007C117D /* Frameworks */, 138 | 97C146EC1CF9000F007C117D /* Resources */, 139 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 140 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 141 | ); 142 | buildRules = ( 143 | ); 144 | dependencies = ( 145 | ); 146 | name = Runner; 147 | productName = Runner; 148 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 149 | productType = "com.apple.product-type.application"; 150 | }; 151 | /* End PBXNativeTarget section */ 152 | 153 | /* Begin PBXProject section */ 154 | 97C146E61CF9000F007C117D /* Project object */ = { 155 | isa = PBXProject; 156 | attributes = { 157 | LastUpgradeCheck = 0910; 158 | ORGANIZATIONNAME = "The Chromium Authors"; 159 | TargetAttributes = { 160 | 97C146ED1CF9000F007C117D = { 161 | CreatedOnToolsVersion = 7.3.1; 162 | DevelopmentTeam = MNAQH5JU72; 163 | }; 164 | }; 165 | }; 166 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 167 | compatibilityVersion = "Xcode 3.2"; 168 | developmentRegion = English; 169 | hasScannedForEncodings = 0; 170 | knownRegions = ( 171 | en, 172 | Base, 173 | ); 174 | mainGroup = 97C146E51CF9000F007C117D; 175 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 176 | projectDirPath = ""; 177 | projectRoot = ""; 178 | targets = ( 179 | 97C146ED1CF9000F007C117D /* Runner */, 180 | ); 181 | }; 182 | /* End PBXProject section */ 183 | 184 | /* Begin PBXResourcesBuildPhase section */ 185 | 97C146EC1CF9000F007C117D /* Resources */ = { 186 | isa = PBXResourcesBuildPhase; 187 | buildActionMask = 2147483647; 188 | files = ( 189 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 190 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 191 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 192 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 193 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, 194 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | }; 198 | /* End PBXResourcesBuildPhase section */ 199 | 200 | /* Begin PBXShellScriptBuildPhase section */ 201 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 202 | isa = PBXShellScriptBuildPhase; 203 | buildActionMask = 2147483647; 204 | files = ( 205 | ); 206 | inputPaths = ( 207 | ); 208 | name = "Thin Binary"; 209 | outputPaths = ( 210 | ); 211 | runOnlyForDeploymentPostprocessing = 0; 212 | shellPath = /bin/sh; 213 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 214 | }; 215 | 9740EEB61CF901F6004384FC /* Run Script */ = { 216 | isa = PBXShellScriptBuildPhase; 217 | buildActionMask = 2147483647; 218 | files = ( 219 | ); 220 | inputPaths = ( 221 | ); 222 | name = "Run Script"; 223 | outputPaths = ( 224 | ); 225 | runOnlyForDeploymentPostprocessing = 0; 226 | shellPath = /bin/sh; 227 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 228 | }; 229 | /* End PBXShellScriptBuildPhase section */ 230 | 231 | /* Begin PBXSourcesBuildPhase section */ 232 | 97C146EA1CF9000F007C117D /* Sources */ = { 233 | isa = PBXSourcesBuildPhase; 234 | buildActionMask = 2147483647; 235 | files = ( 236 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 237 | 97C146F31CF9000F007C117D /* main.m in Sources */, 238 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | }; 242 | /* End PBXSourcesBuildPhase section */ 243 | 244 | /* Begin PBXVariantGroup section */ 245 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 246 | isa = PBXVariantGroup; 247 | children = ( 248 | 97C146FB1CF9000F007C117D /* Base */, 249 | ); 250 | name = Main.storyboard; 251 | sourceTree = ""; 252 | }; 253 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 254 | isa = PBXVariantGroup; 255 | children = ( 256 | 97C147001CF9000F007C117D /* Base */, 257 | ); 258 | name = LaunchScreen.storyboard; 259 | sourceTree = ""; 260 | }; 261 | /* End PBXVariantGroup section */ 262 | 263 | /* Begin XCBuildConfiguration section */ 264 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 265 | isa = XCBuildConfiguration; 266 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 267 | buildSettings = { 268 | ALWAYS_SEARCH_USER_PATHS = NO; 269 | CLANG_ANALYZER_NONNULL = YES; 270 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 271 | CLANG_CXX_LIBRARY = "libc++"; 272 | CLANG_ENABLE_MODULES = YES; 273 | CLANG_ENABLE_OBJC_ARC = YES; 274 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 275 | CLANG_WARN_BOOL_CONVERSION = YES; 276 | CLANG_WARN_COMMA = YES; 277 | CLANG_WARN_CONSTANT_CONVERSION = YES; 278 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 279 | CLANG_WARN_EMPTY_BODY = YES; 280 | CLANG_WARN_ENUM_CONVERSION = YES; 281 | CLANG_WARN_INFINITE_RECURSION = YES; 282 | CLANG_WARN_INT_CONVERSION = YES; 283 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 284 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 285 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 286 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 287 | CLANG_WARN_STRICT_PROTOTYPES = YES; 288 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 289 | CLANG_WARN_UNREACHABLE_CODE = YES; 290 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 291 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 292 | COPY_PHASE_STRIP = NO; 293 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 294 | ENABLE_NS_ASSERTIONS = NO; 295 | ENABLE_STRICT_OBJC_MSGSEND = YES; 296 | GCC_C_LANGUAGE_STANDARD = gnu99; 297 | GCC_NO_COMMON_BLOCKS = YES; 298 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 299 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 300 | GCC_WARN_UNDECLARED_SELECTOR = YES; 301 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 302 | GCC_WARN_UNUSED_FUNCTION = YES; 303 | GCC_WARN_UNUSED_VARIABLE = YES; 304 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 305 | MTL_ENABLE_DEBUG_INFO = NO; 306 | SDKROOT = iphoneos; 307 | TARGETED_DEVICE_FAMILY = "1,2"; 308 | VALIDATE_PRODUCT = YES; 309 | }; 310 | name = Profile; 311 | }; 312 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 313 | isa = XCBuildConfiguration; 314 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 315 | buildSettings = { 316 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 317 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 318 | DEVELOPMENT_TEAM = MNAQH5JU72; 319 | ENABLE_BITCODE = NO; 320 | FRAMEWORK_SEARCH_PATHS = ( 321 | "$(inherited)", 322 | "$(PROJECT_DIR)/Flutter", 323 | ); 324 | INFOPLIST_FILE = Runner/Info.plist; 325 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 326 | LIBRARY_SEARCH_PATHS = ( 327 | "$(inherited)", 328 | "$(PROJECT_DIR)/Flutter", 329 | ); 330 | PRODUCT_BUNDLE_IDENTIFIER = com.zane.myapp; 331 | PRODUCT_NAME = "$(TARGET_NAME)"; 332 | VERSIONING_SYSTEM = "apple-generic"; 333 | }; 334 | name = Profile; 335 | }; 336 | 97C147031CF9000F007C117D /* Debug */ = { 337 | isa = XCBuildConfiguration; 338 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 339 | buildSettings = { 340 | ALWAYS_SEARCH_USER_PATHS = NO; 341 | CLANG_ANALYZER_NONNULL = YES; 342 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 343 | CLANG_CXX_LIBRARY = "libc++"; 344 | CLANG_ENABLE_MODULES = YES; 345 | CLANG_ENABLE_OBJC_ARC = YES; 346 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 347 | CLANG_WARN_BOOL_CONVERSION = YES; 348 | CLANG_WARN_COMMA = YES; 349 | CLANG_WARN_CONSTANT_CONVERSION = YES; 350 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 351 | CLANG_WARN_EMPTY_BODY = YES; 352 | CLANG_WARN_ENUM_CONVERSION = YES; 353 | CLANG_WARN_INFINITE_RECURSION = YES; 354 | CLANG_WARN_INT_CONVERSION = YES; 355 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 356 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 357 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 358 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 359 | CLANG_WARN_STRICT_PROTOTYPES = YES; 360 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 361 | CLANG_WARN_UNREACHABLE_CODE = YES; 362 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 363 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 364 | COPY_PHASE_STRIP = NO; 365 | DEBUG_INFORMATION_FORMAT = dwarf; 366 | ENABLE_STRICT_OBJC_MSGSEND = YES; 367 | ENABLE_TESTABILITY = YES; 368 | GCC_C_LANGUAGE_STANDARD = gnu99; 369 | GCC_DYNAMIC_NO_PIC = NO; 370 | GCC_NO_COMMON_BLOCKS = YES; 371 | GCC_OPTIMIZATION_LEVEL = 0; 372 | GCC_PREPROCESSOR_DEFINITIONS = ( 373 | "DEBUG=1", 374 | "$(inherited)", 375 | ); 376 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 377 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 378 | GCC_WARN_UNDECLARED_SELECTOR = YES; 379 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 380 | GCC_WARN_UNUSED_FUNCTION = YES; 381 | GCC_WARN_UNUSED_VARIABLE = YES; 382 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 383 | MTL_ENABLE_DEBUG_INFO = YES; 384 | ONLY_ACTIVE_ARCH = YES; 385 | SDKROOT = iphoneos; 386 | TARGETED_DEVICE_FAMILY = "1,2"; 387 | }; 388 | name = Debug; 389 | }; 390 | 97C147041CF9000F007C117D /* Release */ = { 391 | isa = XCBuildConfiguration; 392 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 393 | buildSettings = { 394 | ALWAYS_SEARCH_USER_PATHS = NO; 395 | CLANG_ANALYZER_NONNULL = YES; 396 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 397 | CLANG_CXX_LIBRARY = "libc++"; 398 | CLANG_ENABLE_MODULES = YES; 399 | CLANG_ENABLE_OBJC_ARC = YES; 400 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 401 | CLANG_WARN_BOOL_CONVERSION = YES; 402 | CLANG_WARN_COMMA = YES; 403 | CLANG_WARN_CONSTANT_CONVERSION = YES; 404 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 405 | CLANG_WARN_EMPTY_BODY = YES; 406 | CLANG_WARN_ENUM_CONVERSION = YES; 407 | CLANG_WARN_INFINITE_RECURSION = YES; 408 | CLANG_WARN_INT_CONVERSION = YES; 409 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 410 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 411 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 412 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 413 | CLANG_WARN_STRICT_PROTOTYPES = YES; 414 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 415 | CLANG_WARN_UNREACHABLE_CODE = YES; 416 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 417 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 418 | COPY_PHASE_STRIP = NO; 419 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 420 | ENABLE_NS_ASSERTIONS = NO; 421 | ENABLE_STRICT_OBJC_MSGSEND = YES; 422 | GCC_C_LANGUAGE_STANDARD = gnu99; 423 | GCC_NO_COMMON_BLOCKS = YES; 424 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 425 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 426 | GCC_WARN_UNDECLARED_SELECTOR = YES; 427 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 428 | GCC_WARN_UNUSED_FUNCTION = YES; 429 | GCC_WARN_UNUSED_VARIABLE = YES; 430 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 431 | MTL_ENABLE_DEBUG_INFO = NO; 432 | SDKROOT = iphoneos; 433 | TARGETED_DEVICE_FAMILY = "1,2"; 434 | VALIDATE_PRODUCT = YES; 435 | }; 436 | name = Release; 437 | }; 438 | 97C147061CF9000F007C117D /* Debug */ = { 439 | isa = XCBuildConfiguration; 440 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 441 | buildSettings = { 442 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 443 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 444 | DEVELOPMENT_TEAM = MNAQH5JU72; 445 | ENABLE_BITCODE = NO; 446 | FRAMEWORK_SEARCH_PATHS = ( 447 | "$(inherited)", 448 | "$(PROJECT_DIR)/Flutter", 449 | ); 450 | INFOPLIST_FILE = Runner/Info.plist; 451 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 452 | LIBRARY_SEARCH_PATHS = ( 453 | "$(inherited)", 454 | "$(PROJECT_DIR)/Flutter", 455 | ); 456 | PRODUCT_BUNDLE_IDENTIFIER = com.zane.myapp; 457 | PRODUCT_NAME = "$(TARGET_NAME)"; 458 | VERSIONING_SYSTEM = "apple-generic"; 459 | }; 460 | name = Debug; 461 | }; 462 | 97C147071CF9000F007C117D /* Release */ = { 463 | isa = XCBuildConfiguration; 464 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 465 | buildSettings = { 466 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 467 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 468 | DEVELOPMENT_TEAM = MNAQH5JU72; 469 | ENABLE_BITCODE = NO; 470 | FRAMEWORK_SEARCH_PATHS = ( 471 | "$(inherited)", 472 | "$(PROJECT_DIR)/Flutter", 473 | ); 474 | INFOPLIST_FILE = Runner/Info.plist; 475 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 476 | LIBRARY_SEARCH_PATHS = ( 477 | "$(inherited)", 478 | "$(PROJECT_DIR)/Flutter", 479 | ); 480 | PRODUCT_BUNDLE_IDENTIFIER = com.zane.myapp; 481 | PRODUCT_NAME = "$(TARGET_NAME)"; 482 | VERSIONING_SYSTEM = "apple-generic"; 483 | }; 484 | name = Release; 485 | }; 486 | /* End XCBuildConfiguration section */ 487 | 488 | /* Begin XCConfigurationList section */ 489 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 490 | isa = XCConfigurationList; 491 | buildConfigurations = ( 492 | 97C147031CF9000F007C117D /* Debug */, 493 | 97C147041CF9000F007C117D /* Release */, 494 | 249021D3217E4FDB00AE95B9 /* Profile */, 495 | ); 496 | defaultConfigurationIsVisible = 0; 497 | defaultConfigurationName = Release; 498 | }; 499 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 500 | isa = XCConfigurationList; 501 | buildConfigurations = ( 502 | 97C147061CF9000F007C117D /* Debug */, 503 | 97C147071CF9000F007C117D /* Release */, 504 | 249021D4217E4FDB00AE95B9 /* Profile */, 505 | ); 506 | defaultConfigurationIsVisible = 0; 507 | defaultConfigurationName = Release; 508 | }; 509 | /* End XCConfigurationList section */ 510 | }; 511 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 512 | } 513 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/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/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/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/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/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/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/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/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/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/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/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/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/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/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/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/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/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/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/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/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/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/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/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/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/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/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/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/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/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/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangweianger/FlutterApp/b7468c7b7679b49f9d8fc2b135ca001790e30e8a/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 | myapp 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ios/xcode_backend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 The Chromium Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | RunCommand() { 7 | if [[ -n "$VERBOSE_SCRIPT_LOGGING" ]]; then 8 | echo "♦ $*" 9 | fi 10 | "$@" 11 | return $? 12 | } 13 | 14 | # When provided with a pipe by the host Flutter build process, output to the 15 | # pipe goes to stdout of the Flutter build process directly. 16 | StreamOutput() { 17 | if [[ -n "$SCRIPT_OUTPUT_STREAM_FILE" ]]; then 18 | echo "$1" > $SCRIPT_OUTPUT_STREAM_FILE 19 | fi 20 | } 21 | 22 | EchoError() { 23 | echo "$@" 1>&2 24 | } 25 | 26 | AssertExists() { 27 | if [[ ! -e "$1" ]]; then 28 | if [[ -h "$1" ]]; then 29 | EchoError "The path $1 is a symlink to a path that does not exist" 30 | else 31 | EchoError "The path $1 does not exist" 32 | fi 33 | exit -1 34 | fi 35 | return 0 36 | } 37 | 38 | BuildApp() { 39 | local project_path="${SOURCE_ROOT}/.." 40 | if [[ -n "$FLUTTER_APPLICATION_PATH" ]]; then 41 | project_path="${FLUTTER_APPLICATION_PATH}" 42 | fi 43 | 44 | local target_path="lib/main.dart" 45 | if [[ -n "$FLUTTER_TARGET" ]]; then 46 | target_path="${FLUTTER_TARGET}" 47 | fi 48 | 49 | # Use FLUTTER_BUILD_MODE if it's set, otherwise use the Xcode build configuration name 50 | # This means that if someone wants to use an Xcode build config other than Debug/Profile/Release, 51 | # they _must_ set FLUTTER_BUILD_MODE so we know what type of artifact to build. 52 | local build_mode="$(echo "${FLUTTER_BUILD_MODE:-${CONFIGURATION}}" | tr "[:upper:]" "[:lower:]")" 53 | local artifact_variant="unknown" 54 | case "$build_mode" in 55 | release*) build_mode="release"; artifact_variant="ios-release";; 56 | profile*) build_mode="profile"; artifact_variant="ios-profile";; 57 | debug*) build_mode="debug"; artifact_variant="ios";; 58 | *) 59 | EchoError "========================================================================" 60 | EchoError "ERROR: Unknown FLUTTER_BUILD_MODE: ${build_mode}." 61 | EchoError "Valid values are 'Debug', 'Profile', or 'Release' (case insensitive)." 62 | EchoError "This is controlled by the FLUTTER_BUILD_MODE environment varaible." 63 | EchoError "If that is not set, the CONFIGURATION environment variable is used." 64 | EchoError "" 65 | EchoError "You can fix this by either adding an appropriately named build" 66 | EchoError "configuration, or adding an appriate value for FLUTTER_BUILD_MODE to the" 67 | EchoError ".xcconfig file for the current build configuration (${CONFIGURATION})." 68 | EchoError "========================================================================" 69 | exit -1;; 70 | esac 71 | 72 | # Archive builds (ACTION=install) should always run in release mode. 73 | if [[ "$ACTION" == "install" && "$build_mode" != "release" ]]; then 74 | EchoError "========================================================================" 75 | EchoError "ERROR: Flutter archive builds must be run in Release mode." 76 | EchoError "" 77 | EchoError "To correct, ensure FLUTTER_BUILD_MODE is set to release or run:" 78 | EchoError "flutter build ios --release" 79 | EchoError "" 80 | EchoError "then re-run Archive from Xcode." 81 | EchoError "========================================================================" 82 | exit -1 83 | fi 84 | 85 | local framework_path="${FLUTTER_ROOT}/bin/cache/artifacts/engine/${artifact_variant}" 86 | 87 | AssertExists "${framework_path}" 88 | AssertExists "${project_path}" 89 | 90 | local derived_dir="${SOURCE_ROOT}/Flutter" 91 | if [[ -e "${project_path}/.ios" ]]; then 92 | derived_dir="${project_path}/.ios/Flutter" 93 | fi 94 | RunCommand mkdir -p -- "$derived_dir" 95 | AssertExists "$derived_dir" 96 | 97 | RunCommand rm -rf -- "${derived_dir}/App.framework" 98 | 99 | local local_engine_flag="" 100 | local flutter_framework="${framework_path}/Flutter.framework" 101 | local flutter_podspec="${framework_path}/Flutter.podspec" 102 | 103 | if [[ -n "$LOCAL_ENGINE" ]]; then 104 | if [[ $(echo "$LOCAL_ENGINE" | tr "[:upper:]" "[:lower:]") != *"$build_mode"* ]]; then 105 | EchoError "========================================================================" 106 | EchoError "ERROR: Requested build with Flutter local engine at '${LOCAL_ENGINE}'" 107 | EchoError "This engine is not compatible with FLUTTER_BUILD_MODE: '${build_mode}'." 108 | EchoError "You can fix this by updating the LOCAL_ENGINE environment variable, or" 109 | EchoError "by running:" 110 | EchoError " flutter build ios --local-engine=ios_${build_mode}" 111 | EchoError "or" 112 | EchoError " flutter build ios --local-engine=ios_${build_mode}_unopt" 113 | EchoError "========================================================================" 114 | exit -1 115 | fi 116 | local_engine_flag="--local-engine=${LOCAL_ENGINE}" 117 | flutter_framework="${LOCAL_ENGINE}/Flutter.framework" 118 | flutter_podspec="${LOCAL_ENGINE}/Flutter.podspec" 119 | fi 120 | 121 | if [[ -e "${project_path}/.ios" ]]; then 122 | RunCommand rm -rf -- "${derived_dir}/engine" 123 | mkdir "${derived_dir}/engine" 124 | RunCommand cp -r -- "${flutter_podspec}" "${derived_dir}/engine" 125 | RunCommand cp -r -- "${flutter_framework}" "${derived_dir}/engine" 126 | RunCommand find "${derived_dir}/engine/Flutter.framework" -type f -exec chmod a-w "{}" \; 127 | else 128 | RunCommand rm -rf -- "${derived_dir}/Flutter.framework" 129 | RunCommand cp -r -- "${flutter_framework}" "${derived_dir}" 130 | RunCommand find "${derived_dir}/Flutter.framework" -type f -exec chmod a-w "{}" \; 131 | fi 132 | 133 | RunCommand pushd "${project_path}" > /dev/null 134 | 135 | AssertExists "${target_path}" 136 | 137 | local verbose_flag="" 138 | if [[ -n "$VERBOSE_SCRIPT_LOGGING" ]]; then 139 | verbose_flag="--verbose" 140 | fi 141 | 142 | local build_dir="${FLUTTER_BUILD_DIR:-build}" 143 | 144 | local track_widget_creation_flag="" 145 | if [[ -n "$TRACK_WIDGET_CREATION" ]]; then 146 | track_widget_creation_flag="--track-widget-creation" 147 | fi 148 | 149 | if [[ "${build_mode}" != "debug" ]]; then 150 | StreamOutput " ├─Building Dart code..." 151 | # Transform ARCHS to comma-separated list of target architectures. 152 | local archs="${ARCHS// /,}" 153 | if [[ $archs =~ .*i386.* || $archs =~ .*x86_64.* ]]; then 154 | EchoError "========================================================================" 155 | EchoError "ERROR: Flutter does not support running in profile or release mode on" 156 | EchoError "the Simulator (this build was: '$build_mode')." 157 | EchoError "You can ensure Flutter runs in Debug mode with your host app in release" 158 | EchoError "mode by setting FLUTTER_BUILD_MODE=debug in the .xcconfig associated" 159 | EchoError "with the ${CONFIGURATION} build configuration." 160 | EchoError "========================================================================" 161 | exit -1 162 | fi 163 | RunCommand "${FLUTTER_ROOT}/bin/flutter" --suppress-analytics \ 164 | ${verbose_flag} \ 165 | build aot \ 166 | --output-dir="${build_dir}/aot" \ 167 | --target-platform=ios \ 168 | --target="${target_path}" \ 169 | --${build_mode} \ 170 | --ios-arch="${archs}" \ 171 | ${local_engine_flag} \ 172 | ${track_widget_creation_flag} 173 | 174 | if [[ $? -ne 0 ]]; then 175 | EchoError "Failed to build ${project_path}." 176 | exit -1 177 | fi 178 | StreamOutput "done" 179 | 180 | local app_framework="${build_dir}/aot/App.framework" 181 | 182 | RunCommand cp -r -- "${app_framework}" "${derived_dir}" 183 | 184 | StreamOutput " ├─Generating dSYM file..." 185 | # Xcode calls `symbols` during app store upload, which uses Spotlight to 186 | # find dSYM files for embedded frameworks. When it finds the dSYM file for 187 | # `App.framework` it throws an error, which aborts the app store upload. 188 | # To avoid this, we place the dSYM files in a folder ending with ".noindex", 189 | # which hides it from Spotlight, https://github.com/flutter/flutter/issues/22560. 190 | RunCommand mkdir -p -- "${build_dir}/dSYMs.noindex" 191 | RunCommand xcrun dsymutil -o "${build_dir}/dSYMs.noindex/App.framework.dSYM" "${app_framework}/App" 192 | if [[ $? -ne 0 ]]; then 193 | EchoError "Failed to generate debug symbols (dSYM) file for ${app_framework}/App." 194 | exit -1 195 | fi 196 | StreamOutput "done" 197 | 198 | StreamOutput " ├─Stripping debug symbols..." 199 | RunCommand xcrun strip -x -S "${derived_dir}/App.framework/App" 200 | if [[ $? -ne 0 ]]; then 201 | EchoError "Failed to strip ${derived_dir}/App.framework/App." 202 | exit -1 203 | fi 204 | StreamOutput "done" 205 | 206 | else 207 | RunCommand mkdir -p -- "${derived_dir}/App.framework" 208 | 209 | # Build stub for all requested architectures. 210 | local arch_flags="" 211 | read -r -a archs <<< "$ARCHS" 212 | for arch in "${archs[@]}"; do 213 | arch_flags="${arch_flags}-arch $arch " 214 | done 215 | 216 | RunCommand eval "$(echo "static const int Moo = 88;" | xcrun clang -x c \ 217 | ${arch_flags} \ 218 | -dynamiclib \ 219 | -Xlinker -rpath -Xlinker '@executable_path/Frameworks' \ 220 | -Xlinker -rpath -Xlinker '@loader_path/Frameworks' \ 221 | -install_name '@rpath/App.framework/App' \ 222 | -o "${derived_dir}/App.framework/App" -)" 223 | fi 224 | 225 | local plistPath="${project_path}/ios/Flutter/AppFrameworkInfo.plist" 226 | if [[ -e "${project_path}/.ios" ]]; then 227 | plistPath="${project_path}/.ios/Flutter/AppFrameworkInfo.plist" 228 | fi 229 | 230 | RunCommand cp -- "$plistPath" "${derived_dir}/App.framework/Info.plist" 231 | 232 | local precompilation_flag="" 233 | if [[ "$CURRENT_ARCH" != "x86_64" ]] && [[ "$build_mode" != "debug" ]]; then 234 | precompilation_flag="--precompiled" 235 | fi 236 | 237 | StreamOutput " ├─Assembling Flutter resources..." 238 | RunCommand "${FLUTTER_ROOT}/bin/flutter" --suppress-analytics \ 239 | ${verbose_flag} \ 240 | build bundle \ 241 | --target-platform=ios \ 242 | --target="${target_path}" \ 243 | --${build_mode} \ 244 | --depfile="${build_dir}/snapshot_blob.bin.d" \ 245 | --asset-dir="${derived_dir}/flutter_assets" \ 246 | ${precompilation_flag} \ 247 | ${local_engine_flag} \ 248 | ${track_widget_creation_flag} 249 | 250 | if [[ $? -ne 0 ]]; then 251 | EchoError "Failed to package ${project_path}." 252 | exit -1 253 | fi 254 | StreamOutput "done" 255 | StreamOutput " └─Compiling, linking and signing..." 256 | 257 | RunCommand popd > /dev/null 258 | 259 | echo "Project ${project_path} built and packaged successfully." 260 | return 0 261 | } 262 | 263 | # Returns the CFBundleExecutable for the specified framework directory. 264 | GetFrameworkExecutablePath() { 265 | local framework_dir="$1" 266 | 267 | local plist_path="${framework_dir}/Info.plist" 268 | local executable="$(defaults read "${plist_path}" CFBundleExecutable)" 269 | echo "${framework_dir}/${executable}" 270 | } 271 | 272 | # Destructively thins the specified executable file to include only the 273 | # specified architectures. 274 | LipoExecutable() { 275 | local executable="$1" 276 | shift 277 | # Split $@ into an array. 278 | read -r -a archs <<< "$@" 279 | 280 | # Extract architecture-specific framework executables. 281 | local all_executables=() 282 | for arch in "${archs[@]}"; do 283 | local output="${executable}_${arch}" 284 | local lipo_info="$(lipo -info "${executable}")" 285 | if [[ "${lipo_info}" == "Non-fat file:"* ]]; then 286 | if [[ "${lipo_info}" != *"${arch}" ]]; then 287 | echo "Non-fat binary ${executable} is not ${arch}. Running lipo -info:" 288 | echo "${lipo_info}" 289 | exit 1 290 | fi 291 | else 292 | lipo -output "${output}" -extract "${arch}" "${executable}" 293 | if [[ $? == 0 ]]; then 294 | all_executables+=("${output}") 295 | else 296 | echo "Failed to extract ${arch} for ${executable}. Running lipo -info:" 297 | lipo -info "${executable}" 298 | exit 1 299 | fi 300 | fi 301 | done 302 | 303 | # Generate a merged binary from the architecture-specific executables. 304 | # Skip this step for non-fat executables. 305 | if [[ ${#all_executables[@]} > 0 ]]; then 306 | local merged="${executable}_merged" 307 | lipo -output "${merged}" -create "${all_executables[@]}" 308 | 309 | cp -f -- "${merged}" "${executable}" > /dev/null 310 | rm -f -- "${merged}" "${all_executables[@]}" 311 | fi 312 | } 313 | 314 | # Destructively thins the specified framework to include only the specified 315 | # architectures. 316 | ThinFramework() { 317 | local framework_dir="$1" 318 | shift 319 | 320 | local plist_path="${framework_dir}/Info.plist" 321 | local executable="$(GetFrameworkExecutablePath "${framework_dir}")" 322 | LipoExecutable "${executable}" "$@" 323 | } 324 | 325 | ThinAppFrameworks() { 326 | local app_path="${TARGET_BUILD_DIR}/${WRAPPER_NAME}" 327 | local frameworks_dir="${app_path}/Frameworks" 328 | 329 | [[ -d "$frameworks_dir" ]] || return 0 330 | find "${app_path}" -type d -name "*.framework" | while read framework_dir; do 331 | ThinFramework "$framework_dir" "$ARCHS" 332 | done 333 | } 334 | 335 | # Adds the App.framework as an embedded binary and the flutter_assets as 336 | # resources. 337 | EmbedFlutterFrameworks() { 338 | AssertExists "${FLUTTER_APPLICATION_PATH}" 339 | 340 | # Prefer the hidden .ios folder, but fallback to a visible ios folder if .ios 341 | # doesn't exist. 342 | local flutter_ios_out_folder="${FLUTTER_APPLICATION_PATH}/.ios/Flutter" 343 | local flutter_ios_engine_folder="${FLUTTER_APPLICATION_PATH}/.ios/Flutter/engine" 344 | if [[ ! -d ${flutter_ios_out_folder} ]]; then 345 | flutter_ios_out_folder="${FLUTTER_APPLICATION_PATH}/ios/Flutter" 346 | flutter_ios_engine_folder="${FLUTTER_APPLICATION_PATH}/ios/Flutter" 347 | fi 348 | 349 | AssertExists "${flutter_ios_out_folder}" 350 | 351 | # Copy the flutter_assets to the Application's resources. 352 | AssertExists "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/" 353 | RunCommand cp -r -- "${flutter_ios_out_folder}/flutter_assets" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/" 354 | 355 | # Embed App.framework from Flutter into the app (after creating the Frameworks directory 356 | # if it doesn't already exist). 357 | local xcode_frameworks_dir=${BUILT_PRODUCTS_DIR}"/"${PRODUCT_NAME}".app/Frameworks" 358 | RunCommand mkdir -p -- "${xcode_frameworks_dir}" 359 | RunCommand cp -Rv -- "${flutter_ios_out_folder}/App.framework" "${xcode_frameworks_dir}" 360 | 361 | # Embed the actual Flutter.framework that the Flutter app expects to run against, 362 | # which could be a local build or an arch/type specific build. 363 | # Remove it first since Xcode might be trying to hold some of these files - this way we're 364 | # sure to get a clean copy. 365 | RunCommand rm -rf -- "${xcode_frameworks_dir}/Flutter.framework" 366 | RunCommand cp -Rv -- "${flutter_ios_engine_folder}/Flutter.framework" "${xcode_frameworks_dir}/" 367 | 368 | # Sign the binaries we moved. 369 | local identity="${EXPANDED_CODE_SIGN_IDENTITY_NAME:-$CODE_SIGN_IDENTITY}" 370 | if [[ -n "$identity" && "$identity" != "\"\"" ]]; then 371 | RunCommand codesign --force --verbose --sign "${identity}" -- "${xcode_frameworks_dir}/App.framework/App" 372 | RunCommand codesign --force --verbose --sign "${identity}" -- "${xcode_frameworks_dir}/Flutter.framework/Flutter" 373 | fi 374 | } 375 | 376 | # Main entry point. 377 | 378 | # TODO(cbracken): improve error handling, then enable set -e 379 | 380 | if [[ $# == 0 ]]; then 381 | # Backwards-compatibility: if no args are provided, build. 382 | BuildApp 383 | else 384 | case $1 in 385 | "build") 386 | BuildApp ;; 387 | "thin") 388 | ThinAppFrameworks ;; 389 | "embed") 390 | EmbedFlutterFrameworks ;; 391 | esac 392 | fi 393 | -------------------------------------------------------------------------------- /lib/app.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'pages/home/home.dart'; 3 | import 'pages/cart/shopping_cart.dart'; 4 | import 'pages/order/order_list.dart'; 5 | import 'pages/user/user_center.dart'; 6 | 7 | class MyAppBar extends StatefulWidget { 8 | @override 9 | State createState() => new _MyAppBarState(); 10 | } 11 | 12 | class _MyAppBarState extends State { 13 | int _currentIndex = 0; 14 | List _pageList; 15 | StatefulWidget _currentPage; 16 | 17 | @override 18 | void initState(){ 19 | super.initState(); 20 | _pageList = [ 21 | new HomePage(), 22 | new SgoppingCart(), 23 | new OrderList(), 24 | new UserCenter(), 25 | ]; 26 | _currentPage = _pageList[_currentIndex]; 27 | } 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | final BottomNavigationBar bottomNavigationBar = new BottomNavigationBar( 32 | items: [ 33 | new BottomNavigationBarItem( 34 | icon: Icon(Icons.home),title: new Text('首页'), 35 | ), 36 | new BottomNavigationBarItem( 37 | icon: Icon(Icons.shopping_cart), title: new Text('购物车') 38 | ), 39 | new BottomNavigationBarItem( 40 | icon: Icon(Icons.assignment_ind,size:26.0), title: new Text('订单') 41 | ), 42 | new BottomNavigationBarItem( 43 | icon: Icon(Icons.person), title: new Text('我的') 44 | ), 45 | ], 46 | type: BottomNavigationBarType.fixed, 47 | currentIndex: _currentIndex, 48 | iconSize: 30.0, 49 | fixedColor:Colors.red, 50 | onTap: (int index) { 51 | setState((){ 52 | _currentIndex = index; 53 | _currentPage = _pageList[_currentIndex]; 54 | }); 55 | }, 56 | ); 57 | return new MaterialApp( 58 | theme: new ThemeData( 59 | primarySwatch: Colors.red, 60 | ), 61 | home:new Scaffold( 62 | body: new Container( 63 | child:_currentPage, 64 | ), 65 | bottomNavigationBar: bottomNavigationBar, 66 | ) 67 | ); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'app.dart'; 3 | 4 | void main() => runApp(new MyApp()); 5 | 6 | class MyApp extends StatelessWidget { 7 | @override 8 | Widget build (BuildContext context){ 9 | return new MaterialApp( 10 | title:'MyApp', 11 | theme: new ThemeData( 12 | primarySwatch: Colors.red, 13 | ), 14 | home: new MyAppBar(), 15 | ); 16 | } 17 | } 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /lib/pages/cart/cart_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../../utils/adapt.dart'; 3 | 4 | class Item extends StatefulWidget { 5 | Item({Key key, this.item}) : super(key: key); 6 | 7 | final Map item; 8 | 9 | @override 10 | State createState() => new __ItemState(); 11 | } 12 | class __ItemState extends State{ 13 | Map item = {}; 14 | 15 | @override 16 | void initState() { 17 | super.initState(); 18 | item = widget.item; 19 | } 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return new Container( 24 | padding:EdgeInsets.all(Adapt.px(30)), 25 | child: new Row( 26 | crossAxisAlignment: CrossAxisAlignment.center, 27 | children: [ 28 | new GestureDetector( 29 | onTap: (){}, 30 | child: new Image.network( 31 | 'https://img.allpyra.com/17763f04-254b-46ae-9cec-a5e48ab14394.png?imageslim', 32 | width:Adapt.px(46), 33 | height:Adapt.px(46), 34 | ), 35 | ), 36 | new GestureDetector( 37 | onTap: (){}, 38 | child: new Container( 39 | margin:EdgeInsets.only(left:Adapt.px(10),right:Adapt.px(15)), 40 | child: new Image.network( 41 | item['pImgIndex'], 42 | width:Adapt.px(200), 43 | height:Adapt.px(200), 44 | fit: BoxFit.cover, 45 | ), 46 | ), 47 | ), 48 | Expanded( 49 | child: new Column( 50 | crossAxisAlignment: CrossAxisAlignment.start, 51 | children: [ 52 | new GestureDetector( 53 | onTap: (){}, 54 | child: new Text( 55 | '${item['pName']}', 56 | style: TextStyle( 57 | fontSize: Adapt.px(30), 58 | color:Colors.black, 59 | ), 60 | ), 61 | ), 62 | new Container( 63 | height:Adapt.px(40), 64 | margin:EdgeInsets.only(top:Adapt.px(24),bottom:Adapt.px(24)), 65 | child: new Text( 66 | '${item['paramNames']}', 67 | style: TextStyle( 68 | color:Colors.grey[600], 69 | fontSize: Adapt.px(24), 70 | ), 71 | ), 72 | ), 73 | new Row( 74 | children: [ 75 | new Text( 76 | '¥${item['realPrice']}', 77 | style: TextStyle( 78 | color:Colors.red, 79 | fontSize: Adapt.px(36), 80 | ), 81 | ), 82 | new Container( 83 | margin:EdgeInsets.only(left:Adapt.px(15),right:Adapt.px(55)), 84 | child: new Text( 85 | '¥${item['originalPrice']}', 86 | style: TextStyle( 87 | color:Colors.grey[600], 88 | fontSize: Adapt.px(24), 89 | decoration: TextDecoration.lineThrough, 90 | decorationStyle: TextDecorationStyle.solid, 91 | decorationColor: Colors.grey, 92 | ), 93 | ), 94 | ), 95 | new GestureDetector( 96 | onTap: (){}, 97 | child: new Image.network( 98 | 'https://img.allpyra.com/72adf8f0-ccd3-4a23-afe8-d7512af82f64.png?imageslim', 99 | width:Adapt.px(40), 100 | height:Adapt.px(40), 101 | ), 102 | ), 103 | new Container( 104 | width:Adapt.px(50), 105 | alignment: Alignment.center, 106 | child: new Text( 107 | '${item['quantity']}', 108 | style: TextStyle( 109 | fontSize: Adapt.px(30), 110 | ), 111 | ), 112 | ), 113 | new GestureDetector( 114 | onTap: (){}, 115 | child: new Container( 116 | margin: EdgeInsets.only(right:Adapt.px(10)), 117 | child: new Image.network( 118 | 'https://img.allpyra.com/0b8c2f90-3267-4eef-a8b5-fe5052de7896.png?imageslim', 119 | width:Adapt.px(40), 120 | height:Adapt.px(40), 121 | ), 122 | ), 123 | ), 124 | new GestureDetector( 125 | onTap: (){}, 126 | child: new Image.network( 127 | 'https://img.allpyra.com/eefc448d-211e-4794-b32d-78518c89bb73.png?imageslim', 128 | width:Adapt.px(40), 129 | height:Adapt.px(40), 130 | ), 131 | ), 132 | ], 133 | ), 134 | ], 135 | ), 136 | ), 137 | ], 138 | ) 139 | ); 140 | } 141 | } 142 | 143 | -------------------------------------------------------------------------------- /lib/pages/cart/data.dart: -------------------------------------------------------------------------------- 1 | 2 | // 购物车列表 3 | List shoppingList = [ 4 | { 5 | "activityCode":"Act18122013453748756", 6 | "consumerOpenId":"oulgi0W0ZAQ_GNQ4ccvfpEPgcQ1w", 7 | "id":"Act18122013453748756_oulgi0W0ZAQ_GNQ4ccvfpEPgcQ1w", 8 | "opc":"sz_gz", 9 | "originalPrice":118, 10 | "pImgIndex":"https://img.allpyra.com/f4cc04c5-e21c-4c0f-a269-d70b8f17d8cd.jpg", 11 | "pName":"(超级秒杀)泰国鳄鱼牌椰青(9个箱,900g以上/1个)", 12 | "paramNames":"500g*4盒", 13 | "quantity":1, 14 | "realPrice":59.9, 15 | "saleTitle":"满10减5元", 16 | }, 17 | { 18 | "activityCode":"Act18122013453748756", 19 | "consumerOpenId":"oulgi0W0ZAQ_GNQ4ccvfpEPgcQ1w", 20 | "id":"Act18122013453748756_oulgi0W0ZAQ_GNQ4ccvfpEPgcQ1w", 21 | "opc":"sz_gz", 22 | "originalPrice":118, 23 | "pImgIndex":"https://img.allpyra.com/f4cc04c5-e21c-4c0f-a269-d70b8f17d8cd.jpg", 24 | "pName":"(超级秒杀)泰国鳄鱼牌椰青(9个箱,900g以上/1个)", 25 | "paramNames":"500g*4盒", 26 | "quantity":1, 27 | "realPrice":59.9, 28 | "saleTitle":"满10减5元", 29 | }, 30 | { 31 | "activityCode":"Act18122013453748756", 32 | "consumerOpenId":"oulgi0W0ZAQ_GNQ4ccvfpEPgcQ1w", 33 | "id":"Act18122013453748756_oulgi0W0ZAQ_GNQ4ccvfpEPgcQ1w", 34 | "opc":"sz_gz", 35 | "originalPrice":118, 36 | "pImgIndex":"https://img.allpyra.com/f4cc04c5-e21c-4c0f-a269-d70b8f17d8cd.jpg", 37 | "pName":"(超级秒杀)泰国鳄鱼牌椰青(9个箱,900g以上/1个)", 38 | "paramNames":"500g*4盒", 39 | "quantity":1, 40 | "realPrice":59.9, 41 | "saleTitle":"满10减5元", 42 | }, 43 | ]; -------------------------------------------------------------------------------- /lib/pages/cart/shopping_cart.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../../utils/adapt.dart'; 3 | import '../../utils/util.dart'; 4 | import 'cart_item.dart'; 5 | 6 | import 'data.dart'; 7 | 8 | class SgoppingCart extends StatefulWidget { 9 | @override 10 | State createState() => new __SgoppingCartState(); 11 | } 12 | class __SgoppingCartState extends State{ 13 | @override 14 | Widget build(BuildContext context) { 15 | return new MaterialApp( 16 | theme: new ThemeData( 17 | primarySwatch: Colors.red, 18 | ), 19 | home:new Scaffold( 20 | appBar: AppBar( 21 | title: Text('购物车'), 22 | ), 23 | body:new Column( 24 | children: [ 25 | Expanded(child: new ItemList()), 26 | new Container(margin:EdgeInsets.only(left:Adapt.px(30)),child: new SubmitBottom()), 27 | ], 28 | ), 29 | ), 30 | ); 31 | } 32 | } 33 | 34 | class SubmitBottom extends StatefulWidget { 35 | @override 36 | State createState() => new __SubmitBottomState(); 37 | } 38 | class __SubmitBottomState extends State{ 39 | double totalPrice = 0; 40 | @override 41 | Widget build(BuildContext context) { 42 | return new Row( 43 | children: [ 44 | Expanded( 45 | child: new Row( 46 | children: [ 47 | new GestureDetector( 48 | onTap: (){}, 49 | child: new Image.network( 50 | 'https://img.allpyra.com/17763f04-254b-46ae-9cec-a5e48ab14394.png?imageslim', 51 | width:Adapt.px(46), 52 | height:Adapt.px(46), 53 | ), 54 | ), 55 | new Text( 56 | '全选', 57 | style: TextStyle( 58 | fontSize: Adapt.px(40), 59 | color:Colors.black 60 | ), 61 | ), 62 | ], 63 | ), 64 | ), 65 | Expanded( 66 | child: new Text( 67 | '合计¥$totalPrice', 68 | style:TextStyle( 69 | color:Colors.red, 70 | fontSize: Adapt.px(30) 71 | ) 72 | ), 73 | ), 74 | new Container( 75 | width:Adapt.px(235), 76 | height:Adapt.px(90), 77 | color:Colors.red, 78 | child: new FlatButton( 79 | // color: Color.fromARGB(0,139, 98, 254), 80 | highlightColor: Colors.blue[700], 81 | colorBrightness: Brightness.dark, 82 | splashColor: Colors.grey, 83 | child: Text("去结算",style:TextStyle(color:Colors.white,fontSize: Adapt.px(30))), 84 | onPressed: (){}, 85 | ) 86 | ), 87 | ], 88 | ); 89 | } 90 | } 91 | 92 | class ItemList extends StatefulWidget { 93 | @override 94 | State createState() => new __ItemListState(); 95 | } 96 | class __ItemListState extends State{ 97 | List dataList = []; 98 | 99 | void _getDatas(){ 100 | setState(() { 101 | // 300ms 之后获得数据 102 | new Future.delayed(const Duration(milliseconds: 300)).then((val) { 103 | setState(() { 104 | dataList = shoppingList; 105 | }); 106 | }); 107 | }); 108 | } 109 | 110 | @override 111 | void initState() { 112 | super.initState(); 113 | _getDatas(); 114 | } 115 | 116 | @override 117 | Widget build(BuildContext context) { 118 | int len = dataList.length; 119 | if(len == 0){ 120 | return new Loading(); 121 | } 122 | for (var i = 0; i < len; i++) { 123 | dataList[i]['isSelected'] = true; 124 | } 125 | return new ListView.builder( 126 | itemCount:len, 127 | itemBuilder:(context, i){ 128 | return new Item(item:dataList[i]); 129 | } 130 | ); 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /lib/pages/home/data.dart: -------------------------------------------------------------------------------- 1 | 2 | // top nav 3 | List topNavList = [ 4 | { 5 | 'name':'热卖', 6 | 'isActive':true, 7 | 'acode':'ADBD' 8 | }, 9 | { 10 | 'name':'水果', 11 | 'isActive':false, 12 | 'acode':'ADBD' 13 | }, 14 | { 15 | 'name':'生鲜', 16 | 'isActive':false, 17 | 'acode':'ADBD' 18 | }, 19 | { 20 | 'name':'日用', 21 | 'isActive':false, 22 | 'acode':'ADBD' 23 | }, 24 | { 25 | 'name':'食品', 26 | 'isActive':false, 27 | 'acode':'ADBD' 28 | }, 29 | { 30 | 'name':'粮油', 31 | 'isActive':false, 32 | 'acode':'ADBD' 33 | }, 34 | ]; 35 | 36 | // banner list 37 | List bannerList = [ 38 | { 39 | 'url':'https://img.allpyra.com/eb1de7d2-ac63-4a3b-a76e-24ec76e39732.jpg?imageView2/2/w/750', 40 | }, 41 | { 42 | 'url':'https://img.allpyra.com/3e762819-83fa-40b8-96cb-0fd1674ff26c.png?imageView2/2/w/750' 43 | }, 44 | ]; 45 | 46 | // goods list 47 | List itemListDatas = [ 48 | {}, 49 | { 50 | 'pImg':'https://img.allpyra.com/0aecf8bb-5623-44ec-a4f3-04273b8a0bb9.png?imageView2/2/w/300', 51 | 'label':'爆款', 52 | 'title':'(秒杀)【精品贝贝小南瓜】*2斤±2两', 53 | 'desc':'秒杀商品,美味多汁。', 54 | 'totalCount':2500, 55 | 'haveCount':1100, 56 | 'costPrice':199, 57 | 'realPrice':99, 58 | }, 59 | { 60 | 'pImg':'https://img.allpyra.com/d00f6039-e6bf-403c-969b-ad466ac3afca.png?imageView2/2/w/300', 61 | 'label':'秒杀', 62 | 'title':'广州增城杨桃(2斤±2两)', 63 | 'desc':'', 64 | 'totalCount':200, 65 | 'haveCount':100, 66 | 'costPrice':20, 67 | 'realPrice':9.9, 68 | }, 69 | { 70 | 'pImg':'https://img.allpyra.com/0c8b7f36-6654-4ea1-be62-5a3914e58c2d.jpg?imageView2/2/w/300', 71 | 'label':'爆款', 72 | 'title':'坛香肉(聚广源)450g/包', 73 | 'desc':'真的好香喔!', 74 | 'totalCount':300, 75 | 'haveCount':110, 76 | 'costPrice':30.9, 77 | 'realPrice':20.9, 78 | }, 79 | { 80 | 'pImg':'https://img.allpyra.com/d00f6039-e6bf-403c-969b-ad466ac3afca.png?imageView2/2/w/300', 81 | 'label':'秒杀', 82 | 'title':'广州增城杨桃(2斤±2两)', 83 | 'desc':'非常好吃!', 84 | 'totalCount':200, 85 | 'haveCount':100, 86 | 'costPrice':20, 87 | 'realPrice':9.9, 88 | }, 89 | { 90 | 'pImg':'https://img.allpyra.com/0aecf8bb-5623-44ec-a4f3-04273b8a0bb9.png?imageView2/2/w/300', 91 | 'label':'爆款', 92 | 'title':'(秒杀)【精品贝贝小南瓜】*2斤±2两', 93 | 'desc':'秒杀商品,美味多汁。', 94 | 'totalCount':2500, 95 | 'haveCount':1100, 96 | 'costPrice':199, 97 | 'realPrice':99, 98 | }, 99 | { 100 | 'pImg':'https://img.allpyra.com/0aecf8bb-5623-44ec-a4f3-04273b8a0bb9.png?imageView2/2/w/300', 101 | 'label':'爆款', 102 | 'title':'(秒杀)【精品贝贝小南瓜】*2斤±2两', 103 | 'desc':'秒杀商品,美味多汁。', 104 | 'totalCount':2500, 105 | 'haveCount':1100, 106 | 'costPrice':199, 107 | 'realPrice':99, 108 | }, 109 | { 110 | 'pImg':'https://img.allpyra.com/d00f6039-e6bf-403c-969b-ad466ac3afca.png?imageView2/2/w/300', 111 | 'label':'秒杀', 112 | 'title':'广州增城杨桃(2斤±2两)', 113 | 'desc':'', 114 | 'totalCount':200, 115 | 'haveCount':100, 116 | 'costPrice':20, 117 | 'realPrice':9.9, 118 | }, 119 | { 120 | 'pImg':'https://img.allpyra.com/0c8b7f36-6654-4ea1-be62-5a3914e58c2d.jpg?imageView2/2/w/300', 121 | 'label':'爆款', 122 | 'title':'坛香肉(聚广源)450g/包', 123 | 'desc':'真的好香喔!', 124 | 'totalCount':300, 125 | 'haveCount':110, 126 | 'costPrice':30.9, 127 | 'realPrice':20.9, 128 | }, 129 | { 130 | 'pImg':'https://img.allpyra.com/d00f6039-e6bf-403c-969b-ad466ac3afca.png?imageView2/2/w/300', 131 | 'label':'秒杀', 132 | 'title':'广州增城杨桃(2斤±2两)', 133 | 'desc':'非常好吃!', 134 | 'totalCount':200, 135 | 'haveCount':100, 136 | 'costPrice':20, 137 | 'realPrice':9.9, 138 | }, 139 | { 140 | 'pImg':'https://img.allpyra.com/0aecf8bb-5623-44ec-a4f3-04273b8a0bb9.png?imageView2/2/w/300', 141 | 'label':'爆款', 142 | 'title':'(秒杀)【精品贝贝小南瓜】*2斤±2两', 143 | 'desc':'秒杀商品,美味多汁。', 144 | 'totalCount':2500, 145 | 'haveCount':1100, 146 | 'costPrice':199, 147 | 'realPrice':99, 148 | }, 149 | { 150 | 'pImg':'https://img.allpyra.com/0aecf8bb-5623-44ec-a4f3-04273b8a0bb9.png?imageView2/2/w/300', 151 | 'label':'爆款', 152 | 'title':'(秒杀)【精品贝贝小南瓜】*2斤±2两', 153 | 'desc':'秒杀商品,美味多汁。', 154 | 'totalCount':2500, 155 | 'haveCount':1100, 156 | 'costPrice':199, 157 | 'realPrice':99, 158 | }, 159 | { 160 | 'pImg':'https://img.allpyra.com/d00f6039-e6bf-403c-969b-ad466ac3afca.png?imageView2/2/w/300', 161 | 'label':'秒杀', 162 | 'title':'广州增城杨桃(2斤±2两)', 163 | 'desc':'', 164 | 'totalCount':200, 165 | 'haveCount':100, 166 | 'costPrice':20, 167 | 'realPrice':9.9, 168 | }, 169 | { 170 | 'pImg':'https://img.allpyra.com/0c8b7f36-6654-4ea1-be62-5a3914e58c2d.jpg?imageView2/2/w/300', 171 | 'label':'爆款', 172 | 'title':'坛香肉(聚广源)450g/包', 173 | 'desc':'真的好香喔!', 174 | 'totalCount':300, 175 | 'haveCount':110, 176 | 'costPrice':30.9, 177 | 'realPrice':20.9, 178 | }, 179 | { 180 | 'pImg':'https://img.allpyra.com/d00f6039-e6bf-403c-969b-ad466ac3afca.png?imageView2/2/w/300', 181 | 'label':'秒杀', 182 | 'title':'广州增城杨桃(2斤±2两)', 183 | 'desc':'非常好吃!', 184 | 'totalCount':200, 185 | 'haveCount':100, 186 | 'costPrice':20, 187 | 'realPrice':9.9, 188 | }, 189 | { 190 | 'pImg':'https://img.allpyra.com/0aecf8bb-5623-44ec-a4f3-04273b8a0bb9.png?imageView2/2/w/300', 191 | 'label':'爆款', 192 | 'title':'(秒杀)【精品贝贝小南瓜】*2斤±2两', 193 | 'desc':'秒杀商品,美味多汁。', 194 | 'totalCount':2500, 195 | 'haveCount':1100, 196 | 'costPrice':199, 197 | 'realPrice':99, 198 | }, 199 | ]; 200 | -------------------------------------------------------------------------------- /lib/pages/home/goods_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../../utils/adapt.dart'; 3 | 4 | // item 5 | class Item extends StatelessWidget { 6 | Item({Key key,this.item}) : super(key: key); 7 | 8 | final Map item; 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | double wdith = Adapt.px(260); 13 | double height = Adapt.px(260); 14 | // item 左侧图片层叠 15 | List stackImg = [new Image.network(item['pImg'],width:wdith,height:height,)]; 16 | if(!item['label'].isEmpty){ 17 | stackImg.add(new Positioned( 18 | left:Adapt.px(10), 19 | top:0, 20 | child: new Image.network( 21 | 'https://img.allpyra.com/7acb5470-9db5-4894-8859-daaaf9e65497.png', 22 | width:Adapt.px(60), 23 | height:Adapt.px(68), 24 | ), 25 | )); 26 | stackImg.add(new Positioned( 27 | left:Adapt.px(20), 28 | top:Adapt.px(10), 29 | child: new Text(item['label'],style:TextStyle(color: Colors.white,fontSize: Adapt.px(20))), 30 | )); 31 | } 32 | return new GestureDetector( 33 | onTap:(){ 34 | print('go to goods detail!'); 35 | }, 36 | child: new Container( 37 | decoration: new BoxDecoration( 38 | border: new Border(bottom:BorderSide(width: Adapt.onepx(),color:item['isLastOne'] ? Colors.white:Colors.grey[300])), 39 | ), 40 | padding:EdgeInsets.only(left:Adapt.px(20),top:Adapt.px(30),right:Adapt.px(20),bottom:Adapt.px(30)), 41 | child:new Row( 42 | crossAxisAlignment: CrossAxisAlignment.start, 43 | children: [ 44 | new Container( 45 | margin: EdgeInsets.only(right:Adapt.px(20)), 46 | width:wdith, 47 | height:height, 48 | child: new Stack( 49 | children: stackImg, 50 | ), 51 | ), 52 | new Container( 53 | width:Adapt.px(425), 54 | height:height, 55 | child: new Column( 56 | crossAxisAlignment: CrossAxisAlignment.start, 57 | children: [ 58 | new Container( 59 | height:Adapt.px(80), 60 | child: new Text( 61 | item['title'], 62 | maxLines: 2, 63 | overflow: TextOverflow.ellipsis, 64 | style:TextStyle( 65 | fontSize: Adapt.px(30), 66 | ) 67 | ), 68 | ), 69 | item['desc'].isEmpty ? 70 | new Container( 71 | height:Adapt.px(60), 72 | ) 73 | : new Container( 74 | height:Adapt.px(60), 75 | alignment: Alignment.centerLeft, 76 | child: new Text( 77 | item['desc'], 78 | maxLines: 1, 79 | overflow: TextOverflow.ellipsis, 80 | style:TextStyle( 81 | fontSize: Adapt.px(22), 82 | color:Color.fromARGB(155, 155, 155, 155), 83 | ) 84 | ), 85 | ), 86 | new Row( 87 | children: [ 88 | new Text("累计销${item['totalCount']}份",style:TextStyle(color: Colors.red,fontSize: Adapt.px(22))), 89 | new Text("/剩余${item['haveCount']}份",style:TextStyle(fontSize: Adapt.px(22))), 90 | ], 91 | ), 92 | new Container( 93 | margin:EdgeInsets.only(top:Adapt.px(10)), 94 | child:new Row( 95 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 96 | children: [ 97 | new Row( 98 | crossAxisAlignment: CrossAxisAlignment.end, 99 | children: [ 100 | new Text("¥${item['realPrice']} ",style:TextStyle( 101 | fontSize: Adapt.px(36), 102 | color: Colors.red, 103 | )), 104 | new Text("¥${item['costPrice']}",style:TextStyle( 105 | fontSize: Adapt.px(24), 106 | color:Colors.grey, 107 | decoration: TextDecoration.lineThrough, 108 | decorationStyle: TextDecorationStyle.solid, 109 | decorationColor: Colors.grey, 110 | )), 111 | ], 112 | ), 113 | new Container( 114 | width:Adapt.px(60), 115 | height:Adapt.px(60), 116 | margin:EdgeInsets.only(top:Adapt.px(15)), 117 | child: RaisedButton( 118 | padding:EdgeInsets.all(Adapt.px(10)), 119 | color: Colors.red, 120 | child: new Icon(Icons.shopping_cart,color:Colors.white,size:Adapt.px(30)), 121 | shape:RoundedRectangleBorder(borderRadius: BorderRadius.circular(Adapt.px(30),)), 122 | onPressed: () { 123 | print(item); 124 | }, 125 | ), 126 | ), 127 | ], 128 | ), 129 | ), 130 | ], 131 | ), 132 | ), 133 | ], 134 | ), 135 | ), 136 | ); 137 | } 138 | } 139 | 140 | -------------------------------------------------------------------------------- /lib/pages/home/home.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import "package:pull_to_refresh/pull_to_refresh.dart"; 3 | import '../../utils/adapt.dart'; 4 | import '../../utils/util.dart'; 5 | import 'top_address.dart'; 6 | import 'swiper.dart'; 7 | import 'goods_item.dart'; 8 | import 'top_nav.dart'; 9 | 10 | import 'data.dart'; 11 | 12 | class HomePage extends StatefulWidget { 13 | @override 14 | State createState() => new __HomePageState(); 15 | } 16 | class __HomePageState extends State{ 17 | @override 18 | Widget build(BuildContext context) { 19 | return new MaterialApp( 20 | theme: new ThemeData( 21 | primarySwatch: Colors.red, 22 | ), 23 | home:new Scaffold( 24 | appBar: AppBar( 25 | title: Text('你我您社区团购'), 26 | ), 27 | body:new Column ( 28 | children: [ 29 | new Address(), 30 | new TopNav(), 31 | new Expanded( 32 | child: new ItemList(), 33 | ) 34 | ], 35 | ) 36 | ), 37 | ); 38 | } 39 | } 40 | 41 | // --------------- 商品列表 ---------------- 42 | class ItemList extends StatefulWidget { 43 | @override 44 | State createState() => new __ItemListState(); 45 | } 46 | class __ItemListState extends State{ 47 | List dataList = []; 48 | List swiperList = []; 49 | 50 | RefreshController _refreshController; 51 | 52 | void _onRefresh(bool up){ 53 | if(up){ 54 | new Future.delayed(const Duration(milliseconds: 2000)).then((val) { 55 | print('up'); 56 | _refreshController.scrollTo(_refreshController.scrollController.offset+50.0); 57 | _refreshController.sendBack(true, RefreshStatus.idle); 58 | setState(() {}); 59 | }); 60 | } 61 | else{ 62 | new Future.delayed(const Duration(milliseconds: 2000)).then((val) { 63 | print('down'); 64 | setState(() {}); 65 | _refreshController.scrollTo(_refreshController.scrollController.offset-50.0); 66 | _refreshController.sendBack(false, RefreshStatus.idle); 67 | }); 68 | } 69 | } 70 | 71 | // 获得渲染数据列表 72 | void _getDatas(){ 73 | // 300ms 之后获得数据 74 | new Future.delayed(const Duration(milliseconds: 300)).then((val) { 75 | setState(() { 76 | dataList = itemListDatas; 77 | swiperList = bannerList; 78 | }); 79 | }); 80 | } 81 | 82 | @override 83 | void initState() { 84 | super.initState(); 85 | _getDatas(); 86 | _refreshController = new RefreshController(); 87 | } 88 | 89 | @override 90 | Widget build(BuildContext context) { 91 | int len = dataList.length; 92 | if(len == 0){ 93 | return new Loading(); 94 | } 95 | 96 | for (var i = 0; i < len; i++) { 97 | dataList[i]['isLastOne'] = i == len-1 ? true : false; 98 | } 99 | 100 | return new SmartRefresher( 101 | enablePullDown: true, 102 | enablePullUp: true, 103 | onRefresh: _onRefresh, 104 | controller: _refreshController, 105 | child:new ListView.builder( 106 | itemCount:len, 107 | itemBuilder:(context, i){ 108 | if(i == 0){ 109 | // banner 110 | return new Container( 111 | height:Adapt.px(300), 112 | child:new HomeSwiper(bannerList:swiperList), 113 | ); 114 | } else { 115 | // item list 116 | return new Item(item:dataList[i]); 117 | } 118 | } 119 | ) 120 | ); 121 | } 122 | } 123 | 124 | -------------------------------------------------------------------------------- /lib/pages/home/swiper.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_swiper/flutter_swiper.dart'; 3 | 4 | class HomeSwiper extends StatelessWidget { 5 | HomeSwiper({Key key, this.bannerList}) : super(key: key); 6 | 7 | final List bannerList; 8 | 9 | @override 10 | Widget build(BuildContext context){ 11 | return new Swiper( 12 | itemBuilder: (BuildContext context,int index){ 13 | String url = bannerList[index]['url']; 14 | return new Image.network(url,fit: BoxFit.fill,); 15 | }, 16 | autoplay:true, 17 | duration:300, 18 | autoplayDelay:5000, 19 | itemCount: bannerList.length, 20 | loop:true, 21 | pagination: new SwiperPagination(), 22 | // control: new SwiperControl( 23 | // color:Colors.white, 24 | // ), 25 | ); 26 | } 27 | } -------------------------------------------------------------------------------- /lib/pages/home/top_address.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../../utils/adapt.dart'; 3 | 4 | // --------------- 头部地址信息 ------------- 5 | class Address extends StatefulWidget { 6 | @override 7 | State
createState() => new _AddressState(); 8 | } 9 | class _AddressState extends State
{ 10 | @override 11 | Widget build(BuildContext context) { 12 | String address = '深圳软件产业基地易思博大厦19-21楼'; 13 | 14 | return new Container( 15 | height:Adapt.px(80), 16 | padding:EdgeInsets.only(left:Adapt.px(30),right:Adapt.px(30)), 17 | alignment: Alignment.centerLeft, 18 | child:new Row( 19 | children: [ 20 | new Image.network( 21 | 'https://img.allpyra.com/225d2135-b3b3-40c6-8e4b-3c820dceb2fe.png?imageslim', 22 | width:Adapt.px(35), 23 | height:Adapt.px(35), 24 | ), 25 | new Container( 26 | width:Adapt.px(320), 27 | child: new Text( 28 | address, 29 | maxLines: 1, 30 | overflow: TextOverflow.ellipsis, 31 | style:TextStyle( 32 | fontSize:Adapt.px(28), 33 | fontWeight:FontWeight.w500, 34 | ), 35 | ), 36 | ), 37 | new Expanded( 38 | child: new Container( 39 | margin:EdgeInsets.only(left:Adapt.px(10)), 40 | height:Adapt.px(60), 41 | decoration: new BoxDecoration( 42 | border: new Border.all(color:Colors.red,style:BorderStyle.solid,width:Adapt.onepx()), 43 | borderRadius: BorderRadius.circular(Adapt.px(60)) 44 | ), 45 | child:TextField( 46 | autofocus: false, 47 | style:TextStyle(color:Colors.red,fontSize: Adapt.px(24)), 48 | decoration: InputDecoration( 49 | hintText: "搜索商品", 50 | hintStyle: TextStyle(color:Colors.red,fontSize: Adapt.px(24)), 51 | prefixIcon: Icon(Icons.search,color:Colors.red,size:Adapt.px(30)), 52 | contentPadding:EdgeInsets.all(Adapt.px(8)), 53 | border:InputBorder.none 54 | ), 55 | ), 56 | ), 57 | ) 58 | ], 59 | ), 60 | ); 61 | } 62 | } -------------------------------------------------------------------------------- /lib/pages/home/top_nav.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../../utils/adapt.dart'; 3 | import 'data.dart'; 4 | 5 | // --------------- 头部地址信息 ------------- 6 | class TopNav extends StatefulWidget { 7 | @override 8 | State createState() => new _TopNavState(); 9 | } 10 | class _TopNavState extends State { 11 | @override 12 | Widget build(BuildContext context) { 13 | return Container( 14 | height:Adapt.px(65), 15 | alignment: Alignment.centerLeft, 16 | padding:EdgeInsets.only(left:Adapt.px(30),right:Adapt.px(30)), 17 | decoration: new BoxDecoration( 18 | border: new Border(bottom:BorderSide(width: Adapt.onepx(),color:Colors.grey[300])), 19 | ), 20 | child: new ListView.builder( 21 | scrollDirection: Axis.horizontal, 22 | itemCount: topNavList.length, 23 | itemBuilder: (context, i){ 24 | return new Container( 25 | height:Adapt.px(65), 26 | padding: EdgeInsets.all(Adapt.px(10)), 27 | margin:EdgeInsets.only(right:10), 28 | decoration: new BoxDecoration( 29 | border: new Border(bottom:BorderSide(width: 3,color:topNavList[i]['isActive'] ? Colors.red : Colors.transparent)), 30 | ), 31 | child: new GestureDetector( 32 | onTap: (){ 33 | setState(() { 34 | topNavList.forEach((item){ 35 | item['isActive'] = false; 36 | }); 37 | topNavList[i]['isActive'] = true; 38 | }); 39 | }, 40 | child: new Text( 41 | topNavList[i]['name'], 42 | style: TextStyle( 43 | fontSize: Adapt.px(30), 44 | color:topNavList[i]['isActive'] ? Colors.red : Colors.grey[600], 45 | ), 46 | ) 47 | ), 48 | ); 49 | } 50 | ), 51 | ); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /lib/pages/order/order_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class OrderList extends StatefulWidget { 4 | @override 5 | State createState() => new __OrderListState(); 6 | } 7 | class __OrderListState extends State{ 8 | @override 9 | Widget build(BuildContext context) { 10 | return new MaterialApp( 11 | home:new Scaffold( 12 | appBar: AppBar( 13 | title: Text('order list.'), 14 | ), 15 | body:new Center( 16 | child:new Text('Order list page!'), 17 | ), 18 | ), 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/pages/user/user_center.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class UserCenter extends StatefulWidget { 4 | @override 5 | State createState() => new __UserCenterState(); 6 | } 7 | class __UserCenterState extends State{ 8 | @override 9 | Widget build(BuildContext context) { 10 | return new MaterialApp( 11 | home:new Scaffold( 12 | appBar: AppBar( 13 | title: Text('User Center'), 14 | ), 15 | body: new Center( 16 | child:new Text('User Center Pages!'), 17 | ), 18 | ), 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/utils/adapt.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'config.dart'; 3 | import 'dart:ui'; 4 | 5 | class Adapt { 6 | static MediaQueryData mediaQuery = MediaQueryData.fromWindow(window); 7 | static double _width = mediaQuery.size.width; 8 | static double _height = mediaQuery.size.height; 9 | static double _topbarH = mediaQuery.padding.top; 10 | static double _botbarH = mediaQuery.padding.bottom; 11 | static double _pixelRatio = mediaQuery.devicePixelRatio; 12 | static var _ratio; 13 | static init(int number){ 14 | int uiwidth = number is int ? number : designWidth; 15 | _ratio = _width / uiwidth; 16 | } 17 | static px(number){ 18 | if(!(_ratio is double || _ratio is int)){Adapt.init(designWidth);} 19 | return number * _ratio; 20 | } 21 | static onepx(){ 22 | return 1/_pixelRatio; 23 | } 24 | static screenW(){ 25 | return _width; 26 | } 27 | static screenH(){ 28 | return _height; 29 | } 30 | static padTopH(){ 31 | return _topbarH; 32 | } 33 | static padBotH(){ 34 | return _botbarH; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/utils/config.dart: -------------------------------------------------------------------------------- 1 | 2 | // 原型设计UI稿宽度 用于做自适应 3 | int designWidth = 750; -------------------------------------------------------------------------------- /lib/utils/util.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'adapt.dart'; 3 | 4 | // Loading 组件 5 | class Loading extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return new Center( 9 | child: new Container( 10 | child: new Text( 11 | '数据加载中...', 12 | style:TextStyle( 13 | fontSize: Adapt.px(35), 14 | ) 15 | ), 16 | ), 17 | ); 18 | } 19 | } 20 | 21 | // 空数据组件 22 | class Empty extends StatelessWidget { 23 | @override 24 | Widget build(BuildContext context) { 25 | return new Center( 26 | child: new Container( 27 | child: new Text( 28 | '暂无数据!', 29 | style:TextStyle( 30 | fontSize: Adapt.px(35), 31 | ) 32 | ), 33 | ), 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: myapp 2 | description: A new Flutter project. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # Read more about versioning at semver.org. 10 | version: 1.0.0+1 11 | 12 | environment: 13 | sdk: ">=2.0.0-dev.68.0 <3.0.0" 14 | 15 | dependencies: 16 | flutter: 17 | sdk: flutter 18 | 19 | # The following adds the Cupertino Icons font to your application. 20 | # Use with the CupertinoIcons class for iOS style icons. 21 | cupertino_icons: ^0.1.2 22 | english_words: ^3.1.5 23 | flutter_swiper : ^1.1.4 24 | pull_to_refresh: ^1.1.6 25 | 26 | dev_dependencies: 27 | flutter_test: 28 | sdk: flutter 29 | 30 | 31 | # For information on the generic Dart part of this file, see the 32 | # following page: https://www.dartlang.org/tools/pub/pubspec 33 | 34 | # The following section is specific to Flutter. 35 | flutter: 36 | 37 | # The following line ensures that the Material Icons font is 38 | # included with your application, so that you can use the icons in 39 | # the material Icons class. 40 | uses-material-design: true 41 | 42 | # To add assets to your application, add an assets section, like this: 43 | # assets: 44 | # - images/a_dot_burr.jpeg 45 | # - images/a_dot_ham.jpeg 46 | 47 | # An image asset can refer to one or more resolution-specific "variants", see 48 | # https://flutter.io/assets-and-images/#resolution-aware. 49 | 50 | # For details regarding adding assets from package dependencies, see 51 | # https://flutter.io/assets-and-images/#from-packages 52 | 53 | # To add custom fonts to your application, add a fonts section here, 54 | # in this "flutter" section. Each entry in this list should have a 55 | # "family" key with the font family name, and a "fonts" key with a 56 | # list giving the asset and other descriptors for the font. For 57 | # example: 58 | # fonts: 59 | # - family: Schyler 60 | # fonts: 61 | # - asset: fonts/Schyler-Regular.ttf 62 | # - asset: fonts/Schyler-Italic.ttf 63 | # style: italic 64 | # - family: Trajan Pro 65 | # fonts: 66 | # - asset: fonts/TrajanPro.ttf 67 | # - asset: fonts/TrajanPro_Bold.ttf 68 | # weight: 700 69 | # 70 | # For details regarding fonts from package dependencies, 71 | # see https://flutter.io/custom-fonts/#from-packages 72 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:myapp/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | --------------------------------------------------------------------------------