├── .gitignore
├── .metadata
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── nicomama
│ │ │ │ └── flutter_sample
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable-v21
│ │ │ └── launch_background.xml
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── values-night
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-App-1024x1024@1x.png
│ │ ├── Icon-App-20x20@1x.png
│ │ ├── Icon-App-20x20@2x.png
│ │ ├── Icon-App-20x20@3x.png
│ │ ├── Icon-App-29x29@1x.png
│ │ ├── Icon-App-29x29@2x.png
│ │ ├── Icon-App-29x29@3x.png
│ │ ├── Icon-App-40x40@1x.png
│ │ ├── Icon-App-40x40@2x.png
│ │ ├── Icon-App-40x40@3x.png
│ │ ├── Icon-App-60x60@2x.png
│ │ ├── Icon-App-60x60@3x.png
│ │ ├── Icon-App-76x76@1x.png
│ │ ├── Icon-App-76x76@2x.png
│ │ └── Icon-App-83.5x83.5@2x.png
│ └── LaunchImage.imageset
│ │ ├── Contents.json
│ │ ├── LaunchImage.png
│ │ ├── LaunchImage@2x.png
│ │ ├── LaunchImage@3x.png
│ │ └── README.md
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ └── Runner-Bridging-Header.h
├── lib
├── bottom_input
│ ├── input_dialog.dart
│ └── input_widget.dart
├── eventbus
│ ├── eventbus_demo_widget1.dart
│ ├── eventbus_demo_widget2.dart
│ └── my_event_bus.dart
├── generated
│ └── json
│ │ └── base
│ │ └── json_filed.dart
├── generated_plugin_registrant.dart
├── main.dart
├── main_bottom_input.dart
├── main_eventbus.dart
├── main_provider.dart
├── provider
│ ├── post
│ │ ├── base
│ │ │ ├── eventbus_x.dart
│ │ │ ├── item_refresher.dart
│ │ │ └── slide_page_route.dart
│ │ ├── data
│ │ │ ├── post_bean.dart
│ │ │ └── post_server.dart
│ │ ├── detail
│ │ │ ├── post_detail_model.dart
│ │ │ └── post_detail_widget.dart
│ │ └── list
│ │ │ ├── post_item_notifier.dart
│ │ │ ├── post_item_widget.dart
│ │ │ ├── post_item_widget2.dart
│ │ │ ├── post_list_model.dart
│ │ │ └── post_list_widget.dart
│ ├── provider_demo_widget1.dart
│ ├── provider_demo_widget2.dart
│ ├── provider_demo_widget3.dart
│ ├── provider_demo_widget4.dart
│ ├── selector
│ │ └── selector_demo_widget.dart
│ └── set_state_demo_widget.dart
├── statemanager
│ ├── bloc_rxdart_widget.dart
│ ├── bloc_widget.dart
│ ├── inherited_notifier_widget.dart
│ ├── inherited_widget.dart
│ ├── provider_widget.dart
│ ├── redux_widget.dart
│ └── scoped_model_widget.dart
└── stream
│ ├── main_stream.dart
│ ├── stream1_simple_use.dart
│ ├── stream2_create_stream_by_future.dart
│ ├── stream3_create_stream_by_streamcontroller.dart
│ ├── stream4_receving_stream_by_await_for.dart
│ ├── stream5_two_kind_stream.dart
│ ├── stream6_stream_to_future.dart
│ ├── stream7_stream_to_stream.dart
│ └── stream8_stream_transformer.dart
├── macos
├── .gitignore
├── Flutter
│ ├── Flutter-Debug.xcconfig
│ ├── Flutter-Release.xcconfig
│ └── GeneratedPluginRegistrant.swift
├── Podfile
├── Podfile.lock
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── app_icon_1024.png
│ │ ├── app_icon_128.png
│ │ ├── app_icon_16.png
│ │ ├── app_icon_256.png
│ │ ├── app_icon_32.png
│ │ ├── app_icon_512.png
│ │ └── app_icon_64.png
│ ├── Base.lproj
│ └── MainMenu.xib
│ ├── Configs
│ ├── AppInfo.xcconfig
│ ├── Debug.xcconfig
│ ├── Release.xcconfig
│ └── Warnings.xcconfig
│ ├── DebugProfile.entitlements
│ ├── Info.plist
│ ├── MainFlutterWindow.swift
│ └── Release.entitlements
├── pubspec.yaml
├── test
└── widget_test.dart
└── web
├── favicon.png
├── index.html
└── manifest.json
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .packages
28 | .pub-cache/
29 | .pub/
30 | /build/
31 |
32 | # Android related
33 | **/android/**/gradle-wrapper.jar
34 | **/android/.gradle
35 | **/android/captures/
36 | **/android/gradlew
37 | **/android/gradlew.bat
38 | **/android/local.properties
39 | **/android/**/GeneratedPluginRegistrant.java
40 |
41 | # iOS/XCode related
42 | **/ios/**/*.mode1v3
43 | **/ios/**/*.mode2v3
44 | **/ios/**/*.moved-aside
45 | **/ios/**/*.pbxuser
46 | **/ios/**/*.perspectivev3
47 | **/ios/**/*sync/
48 | **/ios/**/.sconsign.dblite
49 | **/ios/**/.tags*
50 | **/ios/**/.vagrant/
51 | **/ios/**/DerivedData/
52 | **/ios/**/Icon?
53 | **/ios/**/Pods/
54 | **/ios/**/.symlinks/
55 | **/ios/**/profile
56 | **/ios/**/xcuserdata
57 | **/ios/.generated/
58 | **/ios/Flutter/App.framework
59 | **/ios/Flutter/Flutter.framework
60 | **/ios/Flutter/Generated.xcconfig
61 | **/ios/Flutter/app.flx
62 | **/ios/Flutter/app.zip
63 | **/ios/Flutter/flutter_assets/
64 | **/ios/Flutter/flutter_export_environment.sh
65 | **/ios/ServiceDefinitions.json
66 | **/ios/Runner/GeneratedPluginRegistrant.*
67 |
68 | # Exceptions to above rules.
69 | !**/ios/**/default.mode1v3
70 | !**/ios/**/default.mode2v3
71 | !**/ios/**/default.pbxuser
72 | !**/ios/**/default.perspectivev3
73 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
74 |
75 |
76 | *.pyc
77 | *sync/
78 | Icon?
79 | .tags*
80 |
81 | build/
82 | .android/
83 | .ios/
84 | .flutter-plugins
85 | .gradle/
86 |
87 |
88 | *.iml
89 | *.iml
90 |
91 | local.properties
92 | pubspec.lock
93 | local.properties
94 | flutter_page.iml
95 | .flutter-plugins-dependencies
96 | .vscode
--------------------------------------------------------------------------------
/.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: c382b8e990b6976f610764179f94e0416d82c057
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # flutter_sample
2 |
3 | 提供一些Flutter实用的案例代码
4 |
5 | ## 介绍链接
6 |
7 | - [输入框和键盘处理]( https://juejin.im/post/5e7c164ae51d455c7275d353 )
8 | 入口:main_bottom_input.dart
9 | - [Flutter视频库chewie的使用]( https://juejin.im/post/5e814fd9518825738e215f0f )
10 | 入口:main_video.dart
11 |
12 | - [Flutter状态管理Provider(一) 简易使用](https://juejin.im/post/5e859b39f265da47c06ebaf1)
13 | 入口:main_provider.dart
14 |
15 | - [Flutter状态管理Provider(二) 源码分析](https://juejin.im/post/5e89ad7a6fb9a03c4e64697d)
16 | 入口:main_provider.dart
17 |
18 | - [Flutter状态管理Provider(三)基于Provider的开发应用](https://juejin.im/post/5e931f41e51d4547153d174e)
19 | 入口:main_provider.dart
20 |
21 | - [Flutter状态管理Provider(四) Selector使用](https://juejin.im/post/5eabb46be51d454dbd1fd30a)
22 | 入口:main_provider.dart
23 |
24 | - [Flutter事件总线EventBus](https://juejin.im/post/5eb3973ae51d4525602d34ac)
25 | 入口:main_eventbus.dart
26 |
27 | - [Flutter之Stream(一)介绍](https://juejin.im/post/5eba0e9051882558dc24cadc)
28 | 入口:main_Stream.dart
29 |
30 |
31 | ## 待补充:
32 | - 自定义圆角widget y
33 | - 图片swiper组件 y
34 | - 模糊使用 y
35 | - OverScrollBehavior y
36 | - 自定义Route:SlidePageRoute,TransparentModalRoute... y
37 | - 横竖屏切换问题 m
38 | - 1.12.13 新的build aar m
39 | - 固定尺寸GirdItem SliverGridDelegateWithFixedSize m
40 | - Widget与Element关系 m
41 | - fish-redux 源码解析 m
42 | - stream 源码解析 m
43 | - 混合栈 flutter_thrio flutter_boost
44 |
45 |
46 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion flutter.compileSdkVersion
30 |
31 | compileOptions {
32 | sourceCompatibility JavaVersion.VERSION_1_8
33 | targetCompatibility JavaVersion.VERSION_1_8
34 | }
35 |
36 | kotlinOptions {
37 | jvmTarget = '1.8'
38 | }
39 |
40 | sourceSets {
41 | main.java.srcDirs += 'src/main/kotlin'
42 | }
43 |
44 | defaultConfig {
45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
46 | applicationId "com.nicomama.flutter_sample"
47 | minSdkVersion flutter.minSdkVersion
48 | targetSdkVersion flutter.targetSdkVersion
49 | versionCode flutterVersionCode.toInteger()
50 | versionName flutterVersionName
51 | }
52 |
53 | buildTypes {
54 | release {
55 | // TODO: Add your own signing config for the release build.
56 | // Signing with the debug keys for now, so `flutter run --release` works.
57 | signingConfig signingConfigs.debug
58 | }
59 | }
60 | }
61 |
62 | flutter {
63 | source '../..'
64 | }
65 |
66 | dependencies {
67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
68 | }
69 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
15 |
19 |
23 |
24 |
25 |
26 |
27 |
28 |
30 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/nicomama/flutter_sample/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.nicomama.flutter_sample
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:4.1.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | mavenCentral()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #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-6.7-all.zip
7 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
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 | 9.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def parse_KV_file(file, separator='=')
14 | file_abs_path = File.expand_path(file)
15 | if !File.exists? file_abs_path
16 | return [];
17 | end
18 | generated_key_values = {}
19 | skip_line_start_symbols = ["#", "/"]
20 | File.foreach(file_abs_path) do |line|
21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
22 | plugin = line.split(pattern=separator)
23 | if plugin.length == 2
24 | podname = plugin[0].strip()
25 | path = plugin[1].strip()
26 | podpath = File.expand_path("#{path}", file_abs_path)
27 | generated_key_values[podname] = podpath
28 | else
29 | puts "Invalid plugin specification: #{line}"
30 | end
31 | end
32 | generated_key_values
33 | end
34 |
35 | target 'Runner' do
36 | use_frameworks!
37 | use_modular_headers!
38 |
39 | # Flutter Pod
40 |
41 | copied_flutter_dir = File.join(__dir__, 'Flutter')
42 | copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
43 | copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
44 | unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
45 | # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
46 | # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
47 | # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
48 |
49 | generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
50 | unless File.exist?(generated_xcode_build_settings_path)
51 | raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
52 | end
53 | generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
54 | cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
55 |
56 | unless File.exist?(copied_framework_path)
57 | FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
58 | end
59 | unless File.exist?(copied_podspec_path)
60 | FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
61 | end
62 | end
63 |
64 | # Keep pod path relative so it can be checked into Podfile.lock.
65 | pod 'Flutter', :path => 'Flutter'
66 |
67 | # Plugin Pods
68 |
69 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
70 | # referring to absolute paths on developers' machines.
71 | system('rm -rf .symlinks')
72 | system('mkdir -p .symlinks/plugins')
73 | plugin_pods = parse_KV_file('../.flutter-plugins')
74 | plugin_pods.each do |name, path|
75 | symlink = File.join('.symlinks', 'plugins', name)
76 | File.symlink(path, symlink)
77 | pod name, :path => File.join(symlink, 'ios')
78 | end
79 | end
80 |
81 | # Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
82 | install! 'cocoapods', :disable_input_output_paths => true
83 |
84 | post_install do |installer|
85 | installer.pods_project.targets.each do |target|
86 | target.build_configurations.each do |config|
87 | config.build_settings['ENABLE_BITCODE'] = 'NO'
88 | end
89 | end
90 | end
91 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
13 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
14 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
15 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
16 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
17 | /* End PBXBuildFile section */
18 |
19 | /* Begin PBXCopyFilesBuildPhase section */
20 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
21 | isa = PBXCopyFilesBuildPhase;
22 | buildActionMask = 2147483647;
23 | dstPath = "";
24 | dstSubfolderSpec = 10;
25 | files = (
26 | );
27 | name = "Embed Frameworks";
28 | runOnlyForDeploymentPostprocessing = 0;
29 | };
30 | /* End PBXCopyFilesBuildPhase section */
31 |
32 | /* Begin PBXFileReference section */
33 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
34 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
35 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
36 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
37 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
38 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
39 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
40 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
41 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
42 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
43 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
44 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
45 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
46 | /* End PBXFileReference section */
47 |
48 | /* Begin PBXFrameworksBuildPhase section */
49 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
50 | isa = PBXFrameworksBuildPhase;
51 | buildActionMask = 2147483647;
52 | files = (
53 | );
54 | runOnlyForDeploymentPostprocessing = 0;
55 | };
56 | /* End PBXFrameworksBuildPhase section */
57 |
58 | /* Begin PBXGroup section */
59 | 9740EEB11CF90186004384FC /* Flutter */ = {
60 | isa = PBXGroup;
61 | children = (
62 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
63 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
64 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
65 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
66 | );
67 | name = Flutter;
68 | sourceTree = "";
69 | };
70 | 97C146E51CF9000F007C117D = {
71 | isa = PBXGroup;
72 | children = (
73 | 9740EEB11CF90186004384FC /* Flutter */,
74 | 97C146F01CF9000F007C117D /* Runner */,
75 | 97C146EF1CF9000F007C117D /* Products */,
76 | );
77 | sourceTree = "";
78 | };
79 | 97C146EF1CF9000F007C117D /* Products */ = {
80 | isa = PBXGroup;
81 | children = (
82 | 97C146EE1CF9000F007C117D /* Runner.app */,
83 | );
84 | name = Products;
85 | sourceTree = "";
86 | };
87 | 97C146F01CF9000F007C117D /* Runner */ = {
88 | isa = PBXGroup;
89 | children = (
90 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
91 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
92 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
93 | 97C147021CF9000F007C117D /* Info.plist */,
94 | 97C146F11CF9000F007C117D /* Supporting Files */,
95 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
96 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
97 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
98 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
99 | );
100 | path = Runner;
101 | sourceTree = "";
102 | };
103 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
104 | isa = PBXGroup;
105 | children = (
106 | );
107 | name = "Supporting Files";
108 | sourceTree = "";
109 | };
110 | /* End PBXGroup section */
111 |
112 | /* Begin PBXNativeTarget section */
113 | 97C146ED1CF9000F007C117D /* Runner */ = {
114 | isa = PBXNativeTarget;
115 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
116 | buildPhases = (
117 | 9740EEB61CF901F6004384FC /* Run Script */,
118 | 97C146EA1CF9000F007C117D /* Sources */,
119 | 97C146EB1CF9000F007C117D /* Frameworks */,
120 | 97C146EC1CF9000F007C117D /* Resources */,
121 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
122 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
123 | );
124 | buildRules = (
125 | );
126 | dependencies = (
127 | );
128 | name = Runner;
129 | productName = Runner;
130 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
131 | productType = "com.apple.product-type.application";
132 | };
133 | /* End PBXNativeTarget section */
134 |
135 | /* Begin PBXProject section */
136 | 97C146E61CF9000F007C117D /* Project object */ = {
137 | isa = PBXProject;
138 | attributes = {
139 | LastUpgradeCheck = 1300;
140 | ORGANIZATIONNAME = "The Chromium Authors";
141 | TargetAttributes = {
142 | 97C146ED1CF9000F007C117D = {
143 | CreatedOnToolsVersion = 7.3.1;
144 | LastSwiftMigration = 0910;
145 | };
146 | };
147 | };
148 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
149 | compatibilityVersion = "Xcode 3.2";
150 | developmentRegion = en;
151 | hasScannedForEncodings = 0;
152 | knownRegions = (
153 | en,
154 | Base,
155 | );
156 | mainGroup = 97C146E51CF9000F007C117D;
157 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
158 | projectDirPath = "";
159 | projectRoot = "";
160 | targets = (
161 | 97C146ED1CF9000F007C117D /* Runner */,
162 | );
163 | };
164 | /* End PBXProject section */
165 |
166 | /* Begin PBXResourcesBuildPhase section */
167 | 97C146EC1CF9000F007C117D /* Resources */ = {
168 | isa = PBXResourcesBuildPhase;
169 | buildActionMask = 2147483647;
170 | files = (
171 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
172 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
173 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
174 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
175 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
176 | );
177 | runOnlyForDeploymentPostprocessing = 0;
178 | };
179 | /* End PBXResourcesBuildPhase section */
180 |
181 | /* Begin PBXShellScriptBuildPhase section */
182 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
183 | isa = PBXShellScriptBuildPhase;
184 | buildActionMask = 2147483647;
185 | files = (
186 | );
187 | inputPaths = (
188 | );
189 | name = "Thin Binary";
190 | outputPaths = (
191 | );
192 | runOnlyForDeploymentPostprocessing = 0;
193 | shellPath = /bin/sh;
194 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
195 | };
196 | 9740EEB61CF901F6004384FC /* Run Script */ = {
197 | isa = PBXShellScriptBuildPhase;
198 | buildActionMask = 2147483647;
199 | files = (
200 | );
201 | inputPaths = (
202 | );
203 | name = "Run Script";
204 | outputPaths = (
205 | );
206 | runOnlyForDeploymentPostprocessing = 0;
207 | shellPath = /bin/sh;
208 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
209 | };
210 | /* End PBXShellScriptBuildPhase section */
211 |
212 | /* Begin PBXSourcesBuildPhase section */
213 | 97C146EA1CF9000F007C117D /* Sources */ = {
214 | isa = PBXSourcesBuildPhase;
215 | buildActionMask = 2147483647;
216 | files = (
217 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
218 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
219 | );
220 | runOnlyForDeploymentPostprocessing = 0;
221 | };
222 | /* End PBXSourcesBuildPhase section */
223 |
224 | /* Begin PBXVariantGroup section */
225 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
226 | isa = PBXVariantGroup;
227 | children = (
228 | 97C146FB1CF9000F007C117D /* Base */,
229 | );
230 | name = Main.storyboard;
231 | sourceTree = "";
232 | };
233 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
234 | isa = PBXVariantGroup;
235 | children = (
236 | 97C147001CF9000F007C117D /* Base */,
237 | );
238 | name = LaunchScreen.storyboard;
239 | sourceTree = "";
240 | };
241 | /* End PBXVariantGroup section */
242 |
243 | /* Begin XCBuildConfiguration section */
244 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
245 | isa = XCBuildConfiguration;
246 | buildSettings = {
247 | ALWAYS_SEARCH_USER_PATHS = NO;
248 | CLANG_ANALYZER_NONNULL = YES;
249 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
250 | CLANG_CXX_LIBRARY = "libc++";
251 | CLANG_ENABLE_MODULES = YES;
252 | CLANG_ENABLE_OBJC_ARC = YES;
253 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
254 | CLANG_WARN_BOOL_CONVERSION = YES;
255 | CLANG_WARN_COMMA = YES;
256 | CLANG_WARN_CONSTANT_CONVERSION = YES;
257 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
258 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
259 | CLANG_WARN_EMPTY_BODY = YES;
260 | CLANG_WARN_ENUM_CONVERSION = YES;
261 | CLANG_WARN_INFINITE_RECURSION = YES;
262 | CLANG_WARN_INT_CONVERSION = YES;
263 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
264 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
265 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
266 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
267 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
268 | CLANG_WARN_STRICT_PROTOTYPES = YES;
269 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
270 | CLANG_WARN_UNREACHABLE_CODE = YES;
271 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
272 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
273 | COPY_PHASE_STRIP = NO;
274 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
275 | ENABLE_NS_ASSERTIONS = NO;
276 | ENABLE_STRICT_OBJC_MSGSEND = YES;
277 | GCC_C_LANGUAGE_STANDARD = gnu99;
278 | GCC_NO_COMMON_BLOCKS = YES;
279 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
280 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
281 | GCC_WARN_UNDECLARED_SELECTOR = YES;
282 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
283 | GCC_WARN_UNUSED_FUNCTION = YES;
284 | GCC_WARN_UNUSED_VARIABLE = YES;
285 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
286 | MTL_ENABLE_DEBUG_INFO = NO;
287 | SDKROOT = iphoneos;
288 | TARGETED_DEVICE_FAMILY = "1,2";
289 | VALIDATE_PRODUCT = YES;
290 | };
291 | name = Profile;
292 | };
293 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
294 | isa = XCBuildConfiguration;
295 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
296 | buildSettings = {
297 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
298 | CLANG_ENABLE_MODULES = YES;
299 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
300 | ENABLE_BITCODE = NO;
301 | FRAMEWORK_SEARCH_PATHS = (
302 | "$(inherited)",
303 | "$(PROJECT_DIR)/Flutter",
304 | );
305 | INFOPLIST_FILE = Runner/Info.plist;
306 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
307 | LIBRARY_SEARCH_PATHS = (
308 | "$(inherited)",
309 | "$(PROJECT_DIR)/Flutter",
310 | );
311 | PRODUCT_BUNDLE_IDENTIFIER = com.nicomama.flutterSample;
312 | PRODUCT_NAME = "$(TARGET_NAME)";
313 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
314 | SWIFT_VERSION = 4.0;
315 | VERSIONING_SYSTEM = "apple-generic";
316 | };
317 | name = Profile;
318 | };
319 | 97C147031CF9000F007C117D /* Debug */ = {
320 | isa = XCBuildConfiguration;
321 | buildSettings = {
322 | ALWAYS_SEARCH_USER_PATHS = NO;
323 | CLANG_ANALYZER_NONNULL = YES;
324 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
325 | CLANG_CXX_LIBRARY = "libc++";
326 | CLANG_ENABLE_MODULES = YES;
327 | CLANG_ENABLE_OBJC_ARC = YES;
328 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
329 | CLANG_WARN_BOOL_CONVERSION = YES;
330 | CLANG_WARN_COMMA = YES;
331 | CLANG_WARN_CONSTANT_CONVERSION = YES;
332 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
333 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
334 | CLANG_WARN_EMPTY_BODY = YES;
335 | CLANG_WARN_ENUM_CONVERSION = YES;
336 | CLANG_WARN_INFINITE_RECURSION = YES;
337 | CLANG_WARN_INT_CONVERSION = YES;
338 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
339 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
340 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
341 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
342 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
343 | CLANG_WARN_STRICT_PROTOTYPES = YES;
344 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
345 | CLANG_WARN_UNREACHABLE_CODE = YES;
346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
347 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
348 | COPY_PHASE_STRIP = NO;
349 | DEBUG_INFORMATION_FORMAT = dwarf;
350 | ENABLE_STRICT_OBJC_MSGSEND = YES;
351 | ENABLE_TESTABILITY = YES;
352 | GCC_C_LANGUAGE_STANDARD = gnu99;
353 | GCC_DYNAMIC_NO_PIC = NO;
354 | GCC_NO_COMMON_BLOCKS = YES;
355 | GCC_OPTIMIZATION_LEVEL = 0;
356 | GCC_PREPROCESSOR_DEFINITIONS = (
357 | "DEBUG=1",
358 | "$(inherited)",
359 | );
360 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
361 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
362 | GCC_WARN_UNDECLARED_SELECTOR = YES;
363 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
364 | GCC_WARN_UNUSED_FUNCTION = YES;
365 | GCC_WARN_UNUSED_VARIABLE = YES;
366 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
367 | MTL_ENABLE_DEBUG_INFO = YES;
368 | ONLY_ACTIVE_ARCH = YES;
369 | SDKROOT = iphoneos;
370 | TARGETED_DEVICE_FAMILY = "1,2";
371 | };
372 | name = Debug;
373 | };
374 | 97C147041CF9000F007C117D /* Release */ = {
375 | isa = XCBuildConfiguration;
376 | buildSettings = {
377 | ALWAYS_SEARCH_USER_PATHS = NO;
378 | CLANG_ANALYZER_NONNULL = YES;
379 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
380 | CLANG_CXX_LIBRARY = "libc++";
381 | CLANG_ENABLE_MODULES = YES;
382 | CLANG_ENABLE_OBJC_ARC = YES;
383 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
384 | CLANG_WARN_BOOL_CONVERSION = YES;
385 | CLANG_WARN_COMMA = YES;
386 | CLANG_WARN_CONSTANT_CONVERSION = YES;
387 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
388 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
389 | CLANG_WARN_EMPTY_BODY = YES;
390 | CLANG_WARN_ENUM_CONVERSION = YES;
391 | CLANG_WARN_INFINITE_RECURSION = YES;
392 | CLANG_WARN_INT_CONVERSION = YES;
393 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
394 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
395 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
396 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
397 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
398 | CLANG_WARN_STRICT_PROTOTYPES = YES;
399 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
400 | CLANG_WARN_UNREACHABLE_CODE = YES;
401 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
402 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
403 | COPY_PHASE_STRIP = NO;
404 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
405 | ENABLE_NS_ASSERTIONS = NO;
406 | ENABLE_STRICT_OBJC_MSGSEND = YES;
407 | GCC_C_LANGUAGE_STANDARD = gnu99;
408 | GCC_NO_COMMON_BLOCKS = YES;
409 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
410 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
411 | GCC_WARN_UNDECLARED_SELECTOR = YES;
412 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
413 | GCC_WARN_UNUSED_FUNCTION = YES;
414 | GCC_WARN_UNUSED_VARIABLE = YES;
415 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
416 | MTL_ENABLE_DEBUG_INFO = NO;
417 | SDKROOT = iphoneos;
418 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
419 | TARGETED_DEVICE_FAMILY = "1,2";
420 | VALIDATE_PRODUCT = YES;
421 | };
422 | name = Release;
423 | };
424 | 97C147061CF9000F007C117D /* Debug */ = {
425 | isa = XCBuildConfiguration;
426 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
427 | buildSettings = {
428 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
429 | CLANG_ENABLE_MODULES = YES;
430 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
431 | ENABLE_BITCODE = NO;
432 | FRAMEWORK_SEARCH_PATHS = (
433 | "$(inherited)",
434 | "$(PROJECT_DIR)/Flutter",
435 | );
436 | INFOPLIST_FILE = Runner/Info.plist;
437 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
438 | LIBRARY_SEARCH_PATHS = (
439 | "$(inherited)",
440 | "$(PROJECT_DIR)/Flutter",
441 | );
442 | PRODUCT_BUNDLE_IDENTIFIER = com.nicomama.flutterSample;
443 | PRODUCT_NAME = "$(TARGET_NAME)";
444 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
445 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
446 | SWIFT_VERSION = 4.0;
447 | VERSIONING_SYSTEM = "apple-generic";
448 | };
449 | name = Debug;
450 | };
451 | 97C147071CF9000F007C117D /* Release */ = {
452 | isa = XCBuildConfiguration;
453 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
454 | buildSettings = {
455 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
456 | CLANG_ENABLE_MODULES = YES;
457 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
458 | ENABLE_BITCODE = NO;
459 | FRAMEWORK_SEARCH_PATHS = (
460 | "$(inherited)",
461 | "$(PROJECT_DIR)/Flutter",
462 | );
463 | INFOPLIST_FILE = Runner/Info.plist;
464 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
465 | LIBRARY_SEARCH_PATHS = (
466 | "$(inherited)",
467 | "$(PROJECT_DIR)/Flutter",
468 | );
469 | PRODUCT_BUNDLE_IDENTIFIER = com.nicomama.flutterSample;
470 | PRODUCT_NAME = "$(TARGET_NAME)";
471 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
472 | SWIFT_VERSION = 4.0;
473 | VERSIONING_SYSTEM = "apple-generic";
474 | };
475 | name = Release;
476 | };
477 | /* End XCBuildConfiguration section */
478 |
479 | /* Begin XCConfigurationList section */
480 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
481 | isa = XCConfigurationList;
482 | buildConfigurations = (
483 | 97C147031CF9000F007C117D /* Debug */,
484 | 97C147041CF9000F007C117D /* Release */,
485 | 249021D3217E4FDB00AE95B9 /* Profile */,
486 | );
487 | defaultConfigurationIsVisible = 0;
488 | defaultConfigurationName = Release;
489 | };
490 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
491 | isa = XCConfigurationList;
492 | buildConfigurations = (
493 | 97C147061CF9000F007C117D /* Debug */,
494 | 97C147071CF9000F007C117D /* Release */,
495 | 249021D4217E4FDB00AE95B9 /* Profile */,
496 | );
497 | defaultConfigurationIsVisible = 0;
498 | defaultConfigurationName = Release;
499 | };
500 | /* End XCConfigurationList section */
501 |
502 | };
503 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
504 | }
505 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/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 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/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/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/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/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/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/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/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/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/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/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/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/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/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/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/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/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/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/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/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/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/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/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/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/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/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/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/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/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/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/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlvinScrp/flutter_sample/64952595e6f2796f18e5f3c0d502ce9b7a8817e8/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | flutter_sample
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
--------------------------------------------------------------------------------
/lib/bottom_input/input_dialog.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | import 'input_widget.dart';
5 |
6 | class InputDialog {
7 | static Future show(BuildContext context) async {
8 | return Navigator.of(context).push(InputOverlay());
9 | }
10 | }
11 |
12 | class InputOverlay extends ModalRoute {
13 | @override
14 | Duration get transitionDuration => Duration(milliseconds: 200);
15 |
16 | @override
17 | bool get opaque => false;
18 |
19 | @override
20 | bool get barrierDismissible => true;
21 |
22 | @override
23 | Color get barrierColor => const Color(0x01000000);
24 |
25 | @override
26 | String get barrierLabel => "";
27 |
28 | @override
29 | bool get maintainState => true;
30 |
31 | @override
32 | Widget buildPage(
33 | BuildContext context,
34 | Animation animation,
35 | Animation secondaryAnimation,
36 | ) {
37 | return InputWidget();
38 | }
39 |
40 | @override
41 | Widget buildTransitions(BuildContext context, Animation animation,
42 | Animation secondaryAnimation, Widget child) {
43 | return FadeTransition(
44 | opacity: CurvedAnimation(
45 | parent: animation,
46 | curve: Curves.easeOut,
47 | ),
48 | child: child,
49 | );
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/lib/bottom_input/input_widget.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/services.dart';
3 |
4 | class InputWidget extends StatefulWidget {
5 | InputWidget({Key? key}) : super(key: key);
6 |
7 | @override
8 | _InputWidgetState createState() => _InputWidgetState();
9 | }
10 |
11 | class _InputWidgetState extends State {
12 | @override
13 | Widget build(BuildContext context) {
14 | TextEditingController editingController = TextEditingController();
15 |
16 | return Scaffold(
17 | backgroundColor: Colors.transparent,
18 | // resizeToAvoidBottomInset: false,
19 | body: Container(
20 | child: Column(
21 | mainAxisSize: MainAxisSize.min,
22 | children: [
23 | Expanded(
24 | child: GestureDetector(
25 | onTapDown: (_) => Navigator.of(context).pop(),
26 | child: Container(
27 | color: Colors.transparent,
28 | )),
29 | ),
30 | SafeArea(
31 | child: Container(
32 | color: Colors.white,
33 | child: Row(
34 | children: [
35 | Container(
36 | width: 20,
37 | ),
38 | Expanded(
39 | child: Container(
40 | margin: const EdgeInsets.only(top: 10, bottom: 10),
41 | decoration:const BoxDecoration(
42 | color: Color(0xfff6f8fb),
43 | borderRadius:
44 | BorderRadius.all(Radius.circular(20))),
45 | alignment: Alignment.center,
46 | child: TextField(
47 | autofocus: true,
48 | inputFormatters: [
49 | LengthLimitingTextInputFormatter(200)
50 | ],
51 | controller: editingController,
52 | decoration:const InputDecoration(
53 | isDense: true,
54 | contentPadding: EdgeInsets.only(
55 | left: 10, right: 10, top: 5, bottom: 5),
56 | border: InputBorder.none,
57 | hintStyle: TextStyle(color: Color(0xffcccccc)),
58 | hintText: "说点什么吧"),
59 | ),
60 | ),
61 | ),
62 | GestureDetector(
63 | onTap: (() {
64 | var text = editingController.text.trim();
65 | if (text.isNotEmpty) {
66 | Navigator.pop(context, text);
67 | }
68 | }),
69 | child: Container(
70 | padding: const EdgeInsets.only(
71 | left: 10, right: 10, top: 10, bottom: 10),
72 | alignment: Alignment.center,
73 | child:const Text(
74 | "发送",
75 | style: TextStyle(color: Color(0xff00BBBB)),
76 | ),
77 | ),
78 | )
79 | ],
80 | ),
81 | ),
82 | ),
83 | ],
84 | ),
85 | ),
86 | );
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/lib/eventbus/eventbus_demo_widget1.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_sample/eventbus/my_event_bus.dart';
3 | import 'package:flutter_sample/provider/post/base/eventbus_x.dart';
4 |
5 | final String eventBusDemo1Title = "自定义EventBus";
6 | MyEventBus1 _eventBus = new MyEventBus1();
7 |
8 | class EventBusDemoWidget1 extends StatefulWidget {
9 | EventBusDemoWidget1({Key? key}) : super(key: key);
10 |
11 | @override
12 | _EventBusDemoWidget1State createState() => _EventBusDemoWidget1State();
13 | }
14 |
15 | class _EventBusDemoWidget1State extends State {
16 | @override
17 | Widget build(BuildContext context) {
18 | return Scaffold(
19 | appBar: AppBar(
20 | title: Text(eventBusDemo1Title),
21 | ),
22 | body: Container(
23 | child: Column(
24 | children: [
25 | Row(
26 | children: [
27 | new ButtonWidget(event: new EventA()),
28 | new TextWidget(),
29 | new TextWidget()
30 | ],
31 | ),
32 | Divider(
33 | color: Colors.grey,
34 | ),
35 | Row(
36 | children: [
37 | new ButtonWidget(event: new EventB()),
38 | new TextWidget(),
39 | new TextWidget()
40 | ],
41 | )
42 | ],
43 | ),
44 | ),
45 | );
46 | }
47 | }
48 |
49 | class BaseEvent {
50 | int count = 0;
51 | }
52 |
53 | class EventA extends BaseEvent {}
54 |
55 | class EventB extends BaseEvent {}
56 |
57 | class ButtonWidget extends StatelessWidget {
58 | late T? event ;
59 |
60 | ButtonWidget({Key? key, this.event}) : super(key: key);
61 |
62 | @override
63 | Widget build(BuildContext context) {
64 | return ElevatedButton(
65 | child: Text("increment"),
66 | onPressed: _increment,
67 | );
68 | }
69 |
70 | void _increment() {
71 | if (event != null) {
72 | event?.count++;
73 | print(event?.count);
74 | _eventBus.post(event);
75 | }
76 | }
77 | }
78 |
79 | class TextWidget extends StatefulWidget {
80 | @override
81 | _TextWidgetState createState() {
82 | return _TextWidgetState();
83 | }
84 | }
85 |
86 | class _TextWidgetState extends State> {
87 | int _count = 0;
88 | late ISubscriber _subscriber;
89 |
90 | @override
91 | void initState() {
92 | super.initState();
93 |
94 | _subscriber =
95 | (event) => setState(() => _count = (event as BaseEvent).count);
96 | _eventBus.register(_subscriber);
97 | }
98 |
99 | @override
100 | Widget build(BuildContext context) {
101 | print(typeOf());
102 | return Text(
103 | " $_count ",
104 | style: TextStyle(fontSize: 18),
105 | );
106 | }
107 |
108 | @override
109 | void dispose() {
110 | super.dispose();
111 | _eventBus.unregister(_subscriber);
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/lib/eventbus/eventbus_demo_widget2.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:event_bus/event_bus.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:flutter_sample/eventbus/my_event_bus.dart';
6 | import 'package:flutter_sample/provider/post/base/eventbus_x.dart';
7 |
8 | final String eventBusDemo2Title = "EventBus(pub.dev)使用";
9 | EventBus _eventBus = new EventBus();
10 |
11 | class EventBusDemoWidget2 extends StatefulWidget {
12 | EventBusDemoWidget2({Key? key}) : super(key: key);
13 |
14 | @override
15 | _EventBusDemoWidget2State createState() => _EventBusDemoWidget2State();
16 | }
17 |
18 | class _EventBusDemoWidget2State extends State {
19 | @override
20 | Widget build(BuildContext context) {
21 | return Scaffold(
22 | appBar: AppBar(
23 | title: Text(eventBusDemo2Title),
24 | ),
25 | body: Container(
26 | child: Column(
27 | children: [
28 | Row(
29 | children: [
30 | new ButtonWidget(event: new EventA()),
31 | new TextWidget(),
32 | new TextWidget()
33 | ],
34 | ),
35 | Divider(
36 | color: Colors.grey,
37 | ),
38 | Row(
39 | children: [
40 | new ButtonWidget(event: new EventB()),
41 | new TextWidget(),
42 | new TextWidget()
43 | ],
44 | )
45 | ],
46 | ),
47 | ),
48 | );
49 | }
50 | }
51 |
52 | class BaseEvent {
53 | int count = 0;
54 | }
55 |
56 | class EventA extends BaseEvent {}
57 |
58 | class EventB extends BaseEvent {}
59 |
60 | class ButtonWidget extends StatelessWidget {
61 | final T? event;
62 |
63 | ButtonWidget({Key? key, this.event}) : super(key: key);
64 |
65 | @override
66 | Widget build(BuildContext context) {
67 | return ElevatedButton(
68 | child: Text("increment"),
69 | onPressed: _increment,
70 | );
71 | }
72 |
73 | void _increment() {
74 | if (event != null) {
75 | event?.count++;
76 | print(event?.count);
77 | _eventBus.fire(event);
78 | // _eventBus.post(event);
79 | }
80 | }
81 | }
82 |
83 | class TextWidget extends StatefulWidget {
84 | @override
85 | _TextWidgetState createState() {
86 | return _TextWidgetState();
87 | }
88 | }
89 |
90 | class _TextWidgetState extends State> {
91 | int _count = 0;
92 | // ISubscriber _subscriber;
93 | late StreamSubscription _subscriber;
94 |
95 | @override
96 | void initState() {
97 | super.initState();
98 | // _subscriber =
99 | // (event) => setState(() => _count = (event as BaseEvent).count);
100 | // _eventBus.register(_subscriber);
101 | Stream stream = _eventBus.on();
102 | _subscriber = stream
103 | .listen((event) => setState(() => _count = (event as BaseEvent).count));
104 | }
105 |
106 | @override
107 | Widget build(BuildContext context) {
108 | print(typeOf());
109 | return Text(
110 | " $_count ",
111 | style: TextStyle(fontSize: 18),
112 | );
113 | }
114 |
115 | @override
116 | void dispose() {
117 | super.dispose();
118 | // _eventBus.unregister(_subscriber);
119 | _subscriber.cancel();
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/lib/eventbus/my_event_bus.dart:
--------------------------------------------------------------------------------
1 | abstract class IPublisher {
2 | void post(T event);
3 | }
4 |
5 | typedef ISubscriber = void Function(T event);
6 |
7 | abstract class IEventBus extends IPublisher {
8 | void register(ISubscriber subscriber);
9 |
10 | void unregister(ISubscriber subscriber);
11 | }
12 |
13 | Type typeOf() => T;
14 |
15 | class MyEventBus1 implements IEventBus {
16 | Map> map = new Map();
17 |
18 | @override
19 | void register(ISubscriber subscriber) {
20 | Type type = typeOf();
21 | if (!map.containsKey(type)) {
22 | map[type] = List.empty(growable: true);
23 | }
24 | map[type]?.add(subscriber);
25 | }
26 |
27 | @override
28 | void unregister(ISubscriber subscriber) {
29 | Type type = typeOf();
30 | if (map.containsKey(type)) {
31 | map[type]?.remove(subscriber);
32 | }
33 | }
34 |
35 | @override
36 | void post(T event) {
37 | Type type = typeOf();
38 | if (map.containsKey(type)) {
39 | var subscribers = map[type];
40 | subscribers?.forEach((subscriber) => subscriber.call(event));
41 | }
42 | }
43 | }
44 |
45 | class MyEventBus2 implements IEventBus {
46 | List subscribers = List.empty(growable: true);
47 |
48 | @override
49 | register(ISubscriber subscriber) {
50 | if (!subscribers.contains(subscriber)) {
51 | subscribers.add(subscriber);
52 | }
53 | }
54 |
55 | @override
56 | unregister(ISubscriber subscriber) {
57 | if (subscribers.contains(subscriber)) {
58 | subscribers.remove(subscriber);
59 | }
60 | }
61 |
62 | @override
63 | post(T event) {
64 | var ints = subscribers.whereType>();
65 | for (var subscriber in ints) {
66 | subscriber.call(event);
67 | }
68 | }
69 | }
70 |
71 | class EventX {}
72 |
73 | class EventY {}
74 |
75 | //main() {
76 | // testEventBus(new MyEventBus1());
77 | // print("--------------------");
78 | // testEventBus(new MyEventBus2());
79 | //}
80 | //
81 | //void testEventBus(IEventBus eventBus) {
82 | // ISubscriber subscriber1 = (event) => print(event.toString());
83 | // ISubscriber subscriber2 = (event) => print(event.toString());
84 | // eventBus.register(subscriber1);
85 | // eventBus.register(subscriber2);
86 | // eventBus.unregister(subscriber1);
87 | //
88 | // ISubscriber subscriber3 = (event) => print(event.toString());
89 | // ISubscriber subscriber4 = (event) => print(event.toString());
90 | // eventBus.register(subscriber3);
91 | // eventBus.register(subscriber4);
92 | //
93 | // eventBus.post(new EventX());
94 | // eventBus.post(new EventY());
95 | //}
96 |
--------------------------------------------------------------------------------
/lib/generated/json/base/json_filed.dart:
--------------------------------------------------------------------------------
1 | // ignore_for_file: non_constant_identifier_names
2 | // ignore_for_file: camel_case_types
3 | // ignore_for_file: prefer_single_quotes
4 |
5 | // This file is automatically generated. DO NOT EDIT, all your changes would be lost.
6 |
7 | class JSONField {
8 | final String name;
9 |
10 | const JSONField(this.name);
11 | }
12 |
--------------------------------------------------------------------------------
/lib/generated_plugin_registrant.dart:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // ignore_for_file: directives_ordering
6 | // ignore_for_file: lines_longer_than_80_chars
7 |
8 | import 'package:video_player_web/video_player_web.dart';
9 |
10 | import 'package:flutter_web_plugins/flutter_web_plugins.dart';
11 |
12 | // ignore: public_member_api_docs
13 | void registerPlugins(Registrar registrar) {
14 | VideoPlayerPlugin.registerWith(registrar);
15 | registrar.registerMessageHandler();
16 | }
17 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'provider/post/list/post_list_widget.dart';
4 | import 'provider/provider_demo_widget1.dart';
5 | import 'provider/provider_demo_widget2.dart';
6 | import 'provider/provider_demo_widget3.dart';
7 | import 'provider/provider_demo_widget4.dart';
8 | import 'provider/selector/selector_demo_widget.dart';
9 | import 'provider/set_state_demo_widget.dart';
10 |
11 | void main() => runApp(MyApp());
12 |
13 | class MyApp extends StatelessWidget {
14 | // This widget is the root of your application.
15 | @override
16 | Widget build(BuildContext context) {
17 | return MaterialApp(
18 | title: 'Flutter Demo',
19 | home: MyHomePage(title: 'Flutter Demo Home Page'),
20 | );
21 | }
22 | }
23 |
24 | class MyHomePage extends StatefulWidget {
25 | MyHomePage({Key? key, required this.title}) : super(key: key);
26 | final String title;
27 |
28 | @override
29 | _MyHomePageState createState() => _MyHomePageState();
30 | }
31 |
32 | class _MyHomePageState extends State {
33 | @override
34 | Widget build(BuildContext context) {
35 | return Scaffold(
36 | appBar: AppBar(
37 | title: Text(widget.title),
38 | ),
39 | body: Column(
40 | children: [
41 | _build(context, setStateDemoTitle, SetStateDemoWidget()),
42 | _build(context, providerDemoTitle1, const ProviderDemoWidget1()),
43 | _build(context, providerDemoTitle2, ProviderDemoWidget2()),
44 | _build(context, providerDemoTitle3, ProviderDemoWidget3()),
45 | _build(context, providerDemoTitle4, ProviderDemoWidget4()),
46 | _build(context, "代码应用(简易社区)", PostListWidget()),
47 | _build(context, "Selector使用", SelectorDemoWidget()),
48 | ],
49 | ));
50 | }
51 |
52 | Widget _build(BuildContext context, String text, Widget newRouteWidget) {
53 | return ElevatedButton(
54 | child: Text(text),
55 | onPressed: () => Navigator.of(context).push(MaterialPageRoute(
56 | builder: (context) => newRouteWidget,
57 | )),
58 | );
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/lib/main_bottom_input.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'bottom_input/input_dialog.dart';
3 |
4 | void main() => runApp(MaterialApp(home: InputHomeWidget()));
5 |
6 | class InputHomeWidget extends StatefulWidget {
7 | @override
8 | _InputHomeWidgetState createState() => _InputHomeWidgetState();
9 | }
10 |
11 | class _InputHomeWidgetState extends State {
12 | String _inputString = "";
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | return Scaffold(
17 | /**弹出键盘会导致bottomInset值变化,可以通过MediaQuery获取到各种值。
18 | resizeToAvoidBottomInset:true(默认值),
19 | 表示根据变化重新Build,页面会被顶到键盘上,当然也可以通过scollView处理 **/
20 | resizeToAvoidBottomInset: false,
21 | appBar: AppBar(
22 | title: Text("底部输入框"),
23 | ),
24 | body: Column(
25 | mainAxisSize: MainAxisSize.min,
26 | children: [
27 | FlatButton(
28 | color: Colors.yellow,
29 | onPressed: _input,
30 | child: Text("弹出底部输入框"),
31 | ),
32 | Expanded(child: Text("结果:$_inputString")),
33 | Text("底部文案"),
34 | Container(
35 | height: 100,
36 | width: 20,
37 | )
38 | ],
39 | ),
40 | );
41 | }
42 |
43 | void _input() {
44 | InputDialog.show(context).then((value) {
45 | setState(() {
46 | _inputString = value??"";
47 | });
48 | });
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/lib/main_eventbus.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'eventbus/eventbus_demo_widget1.dart';
4 | import 'eventbus/eventbus_demo_widget2.dart';
5 |
6 | void main() => runApp(MaterialApp(
7 | home: Scaffold(
8 | appBar: AppBar(
9 | title: const Text("EventBus"),
10 | ),
11 | body: MainEventBusWidget(),
12 | ),
13 | ));
14 |
15 | class MainEventBusWidget extends StatefulWidget {
16 | const MainEventBusWidget({Key? key}) : super(key: key);
17 |
18 | @override
19 | _MainEventBusWidgetState createState() => _MainEventBusWidgetState();
20 | }
21 |
22 | class _MainEventBusWidgetState extends State {
23 | @override
24 | Widget build(BuildContext context) {
25 | return Center(
26 | child: Column(
27 | mainAxisAlignment: MainAxisAlignment.center,
28 | children: [
29 | _build(context, eventBusDemo1Title, EventBusDemoWidget1()),
30 | _build(context, eventBusDemo2Title, EventBusDemoWidget2()),
31 | ],
32 | ),
33 | );
34 | }
35 |
36 | Widget _build(BuildContext context, String text, Widget newRouteWidget) {
37 | return ElevatedButton(
38 | child: Text(text),
39 | onPressed: () => Navigator.of(context).push(MaterialPageRoute(
40 | builder: (context) => newRouteWidget,
41 | )),
42 | );
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/lib/main_provider.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_sample/provider/provider_demo_widget1.dart';
3 | import 'package:flutter_sample/provider/provider_demo_widget2.dart';
4 | import 'package:flutter_sample/provider/provider_demo_widget3.dart';
5 | import 'package:flutter_sample/provider/provider_demo_widget4.dart';
6 | import 'package:flutter_sample/provider/selector/selector_demo_widget.dart';
7 | import 'package:flutter_sample/provider/set_state_demo_widget.dart';
8 |
9 | import 'provider/post/list/post_list_widget.dart';
10 |
11 | ///
12 | ///Provider V3
13 | ///官方推荐库
14 | ///待优化
15 | ///
16 | void main() => runApp(MaterialApp(
17 | home: Scaffold(
18 | appBar: AppBar(
19 | title: const Text("Provider"),
20 | ),
21 | body: MainProviderWidget(),
22 | ),
23 | ));
24 |
25 | class MainProviderWidget extends StatefulWidget {
26 | @override
27 | _MainProviderWidgetState createState() => new _MainProviderWidgetState();
28 | }
29 |
30 | class _MainProviderWidgetState extends State {
31 | @override
32 | Widget build(BuildContext context) {
33 | return Center(
34 | child: Column(
35 | mainAxisAlignment: MainAxisAlignment.center,
36 | children: [
37 | _build(context, setStateDemoTitle, SetStateDemoWidget()),
38 | _build(context, providerDemoTitle1, const ProviderDemoWidget1()),
39 | _build(context, providerDemoTitle2, ProviderDemoWidget2()),
40 | _build(context, providerDemoTitle3, ProviderDemoWidget3()),
41 | _build(context, providerDemoTitle4, ProviderDemoWidget4()),
42 | _build(context, "代码应用(简易社区)", PostListWidget()),
43 | _build(context, "Selector使用", SelectorDemoWidget()),
44 | ],
45 | ),
46 | );
47 | }
48 |
49 | Widget _build(BuildContext context, String text, Widget newRouteWidget) {
50 | return ElevatedButton(
51 | child: Text(text),
52 | onPressed: () => Navigator.of(context).push(MaterialPageRoute(
53 | builder: (context) => newRouteWidget,
54 | )),
55 | );
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/lib/provider/post/base/eventbus_x.dart:
--------------------------------------------------------------------------------
1 | import 'package:event_bus/event_bus.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | EventBus eventBus = EventBus();
5 |
6 | class BaseEvent {
7 | void fire() {
8 | eventBus.fire(this);
9 | }
10 | }
11 |
12 | class PostLikeEvent extends BaseEvent {
13 | int id;
14 | bool isLike;
15 |
16 | PostLikeEvent(this.id, this.isLike);
17 | }
18 |
--------------------------------------------------------------------------------
/lib/provider/post/base/item_refresher.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:provider/provider.dart';
3 | import 'package:provider/single_child_widget.dart';
4 |
5 | typedef ShouldRebuild = bool Function(A notifier, T value);
6 |
7 | class ItemRefresher extends SingleChildStatefulWidget {
8 | final ShouldRebuild _shouldRebuild;
9 | final T value;
10 |
11 | ItemRefresher({
12 | Key? key,
13 | required this.value,
14 | required ShouldRebuild shouldRebuild,
15 | required this.builder,
16 | Widget? child,
17 | }) : assert(builder != null),
18 | _shouldRebuild = shouldRebuild,
19 | super(key: key, child: child);
20 |
21 | final ValueWidgetBuilder builder;
22 |
23 | @override
24 | _ItemRefresherState createState() => _ItemRefresherState();
25 | }
26 |
27 | class _ItemRefresherState extends SingleChildState> {
28 | Widget? cache;
29 | Widget? oldWidget;
30 |
31 | @override
32 | Widget buildWithChild(BuildContext context, Widget? child) {
33 | A notifier = Provider.of(context);
34 | var shouldInvalidateCache = oldWidget != widget ||
35 | (widget._shouldRebuild != null &&
36 | notifier != null &&
37 | widget._shouldRebuild.call(notifier, widget.value));
38 | if (shouldInvalidateCache) {
39 | oldWidget = widget;
40 | cache = widget.builder(
41 | context,
42 | widget.value,
43 | child,
44 | );
45 | }
46 | return cache!;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/lib/provider/post/base/slide_page_route.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 |
3 | class SlidePageRoute extends PageRouteBuilder {
4 | final Widget widget;
5 |
6 | SlidePageRoute({required this.widget})
7 | : super(
8 | transitionDuration: const Duration(milliseconds: 300), //设置动画时长500毫秒
9 | pageBuilder: (BuildContext context, Animation animation1,
10 | Animation animation2) {
11 | return widget;
12 | },
13 | transitionsBuilder: (BuildContext context,
14 | Animation animation1,
15 | Animation animation2,
16 | Widget child) {
17 | //渐变过渡
18 | return SlideTransition(
19 | position: Tween(
20 | begin: Offset(1.0, 0.0), end: Offset(0.0, 0.0))
21 | .animate(CurvedAnimation(
22 | parent: animation1, curve: Curves.fastOutSlowIn)),
23 | child: child,
24 | );
25 | //翻转缩放
26 | },
27 | maintainState: true,
28 | opaque: false);
29 | }
30 |
--------------------------------------------------------------------------------
/lib/provider/post/data/post_bean.dart:
--------------------------------------------------------------------------------
1 | /// id : 1
2 | /// content : "sdsdsd"
3 | /// isLike : false
4 |
5 | class PostBean {
6 | int id = 0;
7 | String content = "";
8 | bool isLike = false;
9 |
10 | PostBean.value(this.id, this.isLike, this.content);
11 |
12 | PostBean(this.id, this.content, this.isLike);
13 |
14 | PostBean.map(dynamic obj) {
15 | id = obj["id"];
16 | content = obj["content"];
17 | isLike = obj["isLike"];
18 | }
19 |
20 | Map toMap() {
21 | var map = {};
22 | map["id"] = id;
23 | map["content"] = content;
24 | map["isLike"] = isLike;
25 | return map;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lib/provider/post/data/post_server.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_sample/provider/post/data/post_bean.dart';
2 | import 'package:collection/collection.dart';
3 |
4 | class PostServer {
5 | var posts = List.empty(growable: true);
6 | static PostServer? _instance;
7 |
8 | static PostServer instance() {
9 | _instance ??= PostServer._();
10 | return _instance!;
11 | }
12 |
13 | PostServer._() {
14 | posts = List.empty(growable: true);
15 | posts.add(PostBean.value(
16 | 0,
17 | true,
18 | """
19 | 水调歌头·明月几时有
20 | 明月几时有?把酒问青天。不知天上宫阙,今夕是何年。我欲乘风归去,又恐琼楼玉宇,高处不胜寒。起舞弄清影,何似在人间。(何似 一作:何时;又恐 一作:惟 / 唯恐)
21 | 转朱阁,低绮户,照无眠。不应有恨,何事长向别时圆?人有悲欢离合,月有阴晴圆缺,此事古难全。但愿人长久,千里共婵娟。(长向 一作:偏向) """,
22 | ));
23 | posts.add(PostBean.value(
24 | 1,
25 | true,
26 | """
27 | 声声慢·寻寻觅觅
28 | 寻寻觅觅,冷冷清清,凄凄惨惨戚戚。乍暖还寒时候,最难将息。三杯两盏淡酒,怎敌他、晚来风急!雁过也,正伤心,却是旧时相识。
29 | 满地黄花堆积,憔悴损,如今有谁堪摘?守着窗儿,独自怎生得黑!梧桐更兼细雨,到黄昏、点点滴滴。这次第,怎一个愁字了得!(守着窗儿 一作:守著窗儿)
30 | """,
31 | ));
32 | posts.add(PostBean.value(
33 | 2,
34 | true,
35 | """
36 | 凤凰台上忆吹箫·香冷金猊
37 | 香冷金猊,被翻红浪,起来慵自梳头。任宝奁尘满,日上帘钩。生怕离怀别苦,多少事、欲说还休。新来瘦,非干病酒,不是悲秋。
38 | 休休,这回去也,千万遍《阳关》,也则难留。念武陵人远,烟锁秦楼。惟有楼前流水,应念我、终日凝眸。凝眸处,从今又添,一段新愁。(版本一)
39 |
40 | 香冷金猊,被翻红浪,起来人未梳头。任宝奁闲掩,日上帘钩。生怕闲愁暗恨,多少事、欲说还休。今年瘦,非干病酒,不是悲秋。
41 | 明朝,者回去也,千万遍阳关,也即难留。念武陵春晚,云锁重楼。记取楼前绿水,应念我、终日凝眸。凝眸处,从今更数,几段新愁。(版本二)
42 | """,
43 | ));
44 | posts.add(PostBean.value(
45 | 3,
46 | true,
47 | """
48 | 绮寮怨·上马人扶残醉
49 | 上马人扶残醉,晓风吹未醒。映水曲、翠瓦朱檐,垂杨里、乍见津亭。当时曾题败壁,蛛丝罩、淡墨苔晕青。念去来、岁月如流,徘徊久、叹息愁思盈。
50 | 去去倦寻路程。江陵旧事,何曾再问杨琼。旧曲凄清。敛愁黛、与谁听。尊前故人如在,想念我、最关情。何须渭城。歌声未尽处,先泪零。 """,
51 | ));
52 | posts.add(PostBean.value(
53 | 4,
54 | true,
55 | """
56 | 满江红·小院深深
57 | 小院深深,悄镇日、阴晴无据。春未足,闺愁难寄,琴心谁与?曲径穿花寻蛱蝶,虚阑傍日教鹦鹉。笑十三杨柳女儿腰,东风舞。
58 | 云外月,风前絮。情与恨,长如许。想绮窗今夜,为谁凝伫?洛浦梦回留佩客,秦楼声断吹箫侣。正黄昏时候杏花寒,廉纤雨。""",
59 | ));
60 | posts.add(PostBean.value(
61 | 5,
62 | true,
63 | """
64 | 花心动·春词
65 | 仙苑春浓,小桃开,枝枝已堪攀折。乍雨乍晴,轻暖轻寒,渐近赏花时节。柳摇台榭东风软,帘栊静,幽禽调舌。断魂远,闲寻翠径,顿成愁结。
66 | 此恨无人共说。还立尽黄昏,寸心空切。强整绣衾,独掩朱扉,枕簟为谁铺设。夜长更漏传声远,纱窗映、银缸明灭。梦回处,梅梢半笼残月。
67 | """,
68 | ));
69 | posts.add(PostBean.value(
70 | 6,
71 | true,
72 | """
73 | 安公子·远岸收残雨
74 | 远岸收残雨。雨残稍觉江天暮。拾翠汀洲人寂静,立双双鸥鹭。望几点、渔灯隐映蒹葭浦。停画桡、两两舟人语。道去程今夜,遥指前村烟树。
75 | 游宦成羁旅。短樯吟倚闲凝伫。万水千山迷远近,想乡关何处。自别后、风亭月榭孤欢聚。刚断肠、惹得离情苦。听杜宇声声,劝人不如归去。
76 | """,
77 | ));
78 | }
79 |
80 | Future>> loadPosts() async {
81 | await Future.delayed(const Duration(milliseconds: 300));
82 | return posts.map(((post) => post.toMap())).toList();
83 | }
84 |
85 | Future