├── .DS_Store
├── .flutter-plugins
├── .gitignore
├── .vscode
└── launch.json
├── LICENSE
├── README.md
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── fluttertest01
│ │ │ │ └── MainActivity.java
│ │ └── res
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── fluttertest01_android.iml
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── d.png
├── f.png
├── flutterExample.iml
├── fonts
├── Merriweather-Black.ttf
├── Merriweather-Light.ttf
├── MoultiPass2.ttf
├── Pangolin-Regular.ttf
└── TTGODMB1.TTF
├── img
├── 1.jpeg
├── 2.png
├── 3.5.1-1.png
├── 7.2.1-2.png
├── demo.gif
├── fl.png
├── get_all.gif
└── get_guanxi.png
├── ios
├── .gitignore
├── .ruby-version
├── Flutter
│ ├── .last_build_id
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Podfile.lock
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── .DS_Store
│ ├── 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
│ ├── Contents.json
│ ├── Image.imageset
│ │ ├── Contents.json
│ │ └── 画板.png
│ └── LaunchImage2.imageset
│ │ ├── Contents.json
│ │ ├── README.md
│ │ ├── icon 2.png
│ │ ├── icon 2@2x.png
│ │ └── icon 2@3x.png
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ └── Runner-Bridging-Header.h
├── lib
├── animation
│ ├── base_animaiton.dart
│ ├── base_animation_diy.dart
│ ├── base_animation_switch.dart
│ ├── base_hreo.dart
│ ├── base_pageRoute.dart
│ └── base_tagger_animation.dart
├── baseWidget
│ ├── animation_text_kit.dart
│ ├── baseButtons.dart
│ ├── baseIndicator.dart
│ ├── baseState.dart
│ ├── baseSwitch.dart
│ ├── baseText.dart
│ ├── baseTextField.dart
│ ├── base_page_view.dart
│ ├── base_page_view_page.dart
│ ├── base_rotation.dart
│ ├── base_slider.dart
│ ├── dialog.dart
│ └── imgAndIcon.dart
├── comment
│ └── config.dart
├── container
│ ├── base_bars.dart
│ ├── base_clip.dart
│ ├── base_constraints.dart
│ ├── base_container.dart
│ ├── base_decorateBox.dart
│ ├── base_padding.dart
│ └── base_transform.dart
├── counter.dart
├── custom_animation
│ └── base_custom_animation.dart
├── features
│ ├── base_color_and_theme.dart
│ ├── base_eventbus.dart
│ ├── base_future_stream.dart
│ ├── base_gesturedetetor.dart
│ ├── base_notification.dart
│ ├── base_touch_handle.dart
│ ├── base_will_pop.dart
│ └── share_data.dart
├── file_and_http
│ ├── fileAction.dart
│ ├── http_client.dart
│ ├── http_dio.dart
│ ├── http_socket.dart
│ ├── json_to_model.dart
│ └── model
│ │ ├── git_model.dart
│ │ ├── user.dart
│ │ └── user_entity.dart
├── generated
│ └── json
│ │ ├── base
│ │ ├── json_convert_content.dart
│ │ └── json_filed.dart
│ │ ├── git_model_helper.dart
│ │ └── user_entity_helper.dart
├── layout
│ ├── baseFlex.dart
│ ├── base_align.dart
│ ├── base_flow_and_wrap.dart
│ ├── base_row_and_column.dart
│ └── base_stack.dart
├── main.dart
├── main2
├── main3.dart
├── mainUtil.dart
├── page_view
│ ├── page_view.dart
│ └── page_view_custom.dart
├── scrollview
│ ├── baseCustomScrollview.dart
│ ├── baseGridView.dart
│ ├── baseListView.dart
│ ├── baseListenScrollViewOffset.dart
│ ├── baseSingleChildScrollView.dart
│ ├── scrollview.dart
│ └── swich_page.dart
├── secondPage.dart
├── server
│ └── basic_writer_server.dart
├── test.dart
├── tips
│ ├── .DS_Store
│ ├── Tabbar.dart
│ ├── asyn_and_isolate.dart
│ ├── async_and_async*.dart
│ ├── base_ visibility_detector.dart
│ ├── base_bloc.dart
│ ├── base_connect.dart
│ ├── base_interactive_viewer.dart
│ ├── base_key.dart
│ ├── base_qrcode.dart
│ ├── base_record.dart
│ ├── base_render_tree.dart
│ ├── base_slider.dart
│ ├── base_tabbar.dart
│ ├── bloc
│ │ ├── base_bloc_list.dart
│ │ ├── base_login_cubit.dart
│ │ ├── list_cubit
│ │ │ ├── bloc
│ │ │ │ └── list_bloc.dart
│ │ │ ├── list_events
│ │ │ │ └── list_event.dart
│ │ │ ├── list_status
│ │ │ │ └── list_state.dart
│ │ │ ├── model
│ │ │ │ └── list_data.dart
│ │ │ ├── obs
│ │ │ │ └── post_obs.dart
│ │ │ └── page
│ │ │ │ └── list_bloc_route.dart
│ │ ├── login_bloc
│ │ │ ├── bloc
│ │ │ │ ├── login_bloc.dart
│ │ │ │ ├── login_blocs.dart
│ │ │ │ ├── login_event.dart
│ │ │ │ └── login_state.dart
│ │ │ ├── login_bloc_page.dart
│ │ │ ├── model
│ │ │ │ ├── login2_model.dart
│ │ │ │ └── login_models.dart
│ │ │ └── view
│ │ │ │ └── login2_view.dart
│ │ └── login_cubit
│ │ │ ├── bloc_observer
│ │ │ └── bloc_observer.dart
│ │ │ ├── cubit
│ │ │ ├── base_login_cubit.dart
│ │ │ └── cubit.dart
│ │ │ ├── model
│ │ │ ├── base_login_model.dart
│ │ │ └── login_cubit_models.dart
│ │ │ ├── page
│ │ │ ├── base_login_page.dart
│ │ │ └── login_pages.dart
│ │ │ └── view
│ │ │ ├── base_login_view.dart
│ │ │ └── login_views.dart
│ ├── channel
│ │ └── base_channel.dart
│ ├── fish_redux_page.dart
│ ├── get
│ │ ├── README.md
│ │ ├── get_example.dart
│ │ ├── get_increment_page.dart
│ │ ├── get_list_page.dart
│ │ ├── get_login_page.dart
│ │ ├── get_route.dart
│ │ └── get_store.dart
│ ├── hive
│ │ ├── base_hive.dart
│ │ └── hive_person.dart
│ ├── img
│ │ └── base_img.dart
│ ├── keepStateAlive.dart
│ ├── layout
│ │ └── base_layout.dart
│ ├── page_view.dart
│ ├── page_view_tabbar.dart
│ ├── provider
│ │ ├── base_provider.dart
│ │ ├── base_provider_pan_zan.dart
│ │ └── base_stream_pge.dart
│ ├── redux_page.dart
│ ├── revierpod
│ │ ├── base_river_pod.dart
│ │ └── base_river_pod_list.dart
│ ├── rx_dart
│ │ └── base_rxDart.dart
│ ├── scoped_page.dart
│ ├── touch
│ │ └── base_touch_handle.dart
│ └── wechat_view.dart
├── u3d
│ └── u3d_page.dart
├── util.dart
└── video
│ ├── base_download_file_page.dart
│ ├── base_video_ijk_page.dart
│ └── base_video_page.dart
├── pubspec.lock
├── pubspec.yaml
└── test
└── widget_test.dart
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/.DS_Store
--------------------------------------------------------------------------------
/.flutter-plugins:
--------------------------------------------------------------------------------
1 | # This is a generated file; do not edit or check into version control.
2 | audioplayer=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/audioplayer-0.8.1/
3 | connectivity=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/connectivity-3.0.6/
4 | connectivity_for_web=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/connectivity_for_web-0.4.0/
5 | connectivity_macos=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/connectivity_macos-0.2.0/
6 | flutter_boost=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/flutter_boost-1.33.4/
7 | flutter_ijkplayer=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/flutter_ijkplayer-0.3.5+1/
8 | flutter_inappwebview=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/flutter_inappwebview-5.3.2/
9 | flutter_vlc_player=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/flutter_vlc_player-5.0.5/
10 | fluttertoast=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/fluttertoast-3.1.3/
11 | path_provider=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/path_provider-1.6.24/
12 | path_provider_linux=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/path_provider_linux-0.0.1+2/
13 | path_provider_macos=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/path_provider_macos-0.0.4+8/
14 | path_provider_windows=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/path_provider_windows-0.0.5/
15 | permission_handler=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/permission_handler-5.0.1+x/
16 | qr_code_scanner=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/qr_code_scanner-0.5.2/
17 | record_mp3=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/record_mp3-2.1.0/
18 | url_launcher=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/url_launcher-5.5.0/
19 | url_launcher_linux=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/url_launcher_linux-0.0.1+4/
20 | url_launcher_macos=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/url_launcher_macos-0.0.1+9/
21 | url_launcher_web=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/url_launcher_web-0.1.4+1/
22 | video_player=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/video_player-2.1.12/
23 | video_player_web=/Users/fanguangyong450/.fvm/versions/2.2.1-stable/.pub-cache/hosted/nest.hellobike.cn/video_player_web-2.0.2/
24 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | build/
2 | .dart_tool/
3 | .idea/
4 | .packages
5 | .flutter-plugins-dependencies
6 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Flutter",
9 | "request": "launch",
10 | "type": "dart"
11 | }
12 | ]
13 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 FanGuangYong
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
--------------------------------------------------------------------------------
/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 28
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.fluttertest01"
37 | minSdkVersion 16
38 | targetSdkVersion 28
39 | versionCode flutterVersionCode.toInteger()
40 | versionName flutterVersionName
41 | }
42 |
43 | buildTypes {
44 | release {
45 | // TODO: Add your own signing config for the release build.
46 | // Signing with the debug keys for now, so `flutter run --release` works.
47 | signingConfig signingConfigs.debug
48 | }
49 | }
50 | }
51 |
52 | flutter {
53 | source '../..'
54 | }
55 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
8 |
12 |
19 |
23 |
27 |
32 |
36 |
37 |
38 |
39 |
40 |
41 |
43 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/example/fluttertest01/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.fluttertest01;
2 |
3 | import io.flutter.embedding.android.FlutterActivity;
4 |
5 | public class MainActivity extends FlutterActivity {
6 | }
7 |
--------------------------------------------------------------------------------
/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/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/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 | repositories {
3 | google()
4 | jcenter()
5 | }
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:3.5.0'
9 | }
10 | }
11 |
12 | allprojects {
13 | repositories {
14 | google()
15 | jcenter()
16 | }
17 | }
18 |
19 | rootProject.buildDir = '../build'
20 | subprojects {
21 | project.buildDir = "${rootProject.buildDir}/${project.name}"
22 | }
23 | subprojects {
24 | project.evaluationDependsOn(':app')
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/android/fluttertest01_android.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/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-5.6.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 |
--------------------------------------------------------------------------------
/d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/d.png
--------------------------------------------------------------------------------
/f.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/f.png
--------------------------------------------------------------------------------
/flutterExample.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/fonts/Merriweather-Black.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/fonts/Merriweather-Black.ttf
--------------------------------------------------------------------------------
/fonts/Merriweather-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/fonts/Merriweather-Light.ttf
--------------------------------------------------------------------------------
/fonts/MoultiPass2.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/fonts/MoultiPass2.ttf
--------------------------------------------------------------------------------
/fonts/Pangolin-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/fonts/Pangolin-Regular.ttf
--------------------------------------------------------------------------------
/fonts/TTGODMB1.TTF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/fonts/TTGODMB1.TTF
--------------------------------------------------------------------------------
/img/1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/img/1.jpeg
--------------------------------------------------------------------------------
/img/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/img/2.png
--------------------------------------------------------------------------------
/img/3.5.1-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/img/3.5.1-1.png
--------------------------------------------------------------------------------
/img/7.2.1-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/img/7.2.1-2.png
--------------------------------------------------------------------------------
/img/demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/img/demo.gif
--------------------------------------------------------------------------------
/img/fl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/img/fl.png
--------------------------------------------------------------------------------
/img/get_all.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/img/get_all.gif
--------------------------------------------------------------------------------
/img/get_guanxi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/img/get_guanxi.png
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/ios/.ruby-version:
--------------------------------------------------------------------------------
1 | 2.7.3
2 |
--------------------------------------------------------------------------------
/ios/Flutter/.last_build_id:
--------------------------------------------------------------------------------
1 | 1b6b09cea91d89a2f74b90f380a02a80
--------------------------------------------------------------------------------
/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 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | end
36 |
37 | post_install do |installer|
38 | installer.pods_project.targets.each do |target|
39 | flutter_additional_ios_build_settings(target)
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/ios/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 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | let root = self.window.rootViewController as! FlutterViewController
12 | let
13 | channel = FlutterMethodChannel.init(name: "samples.flutter.io/battery", binaryMessenger: root as! FlutterBinaryMessenger)
14 |
15 | channel.setMethodCallHandler { (call: FlutterMethodCall, retult: FlutterResult) in
16 |
17 | if call.method=="getBatteryLevel"{
18 | let ret = self.getBattery()
19 |
20 | if ret == -1{
21 | retult(FlutterError.init(code: "-1", message: "无法获取电池用量", details: nil))
22 | }else{
23 | retult(Int(ret*100))
24 | }
25 | }else{
26 | retult(FlutterMethodNotImplemented)
27 | }
28 | }
29 |
30 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
31 | }
32 | func getBattery() -> Float {
33 | let device = UIDevice.current
34 | device.isBatteryMonitoringEnabled=true
35 | if UIDevice.current.batteryState == UIDevice.BatteryState.unknown
36 | {
37 | return -1
38 | }
39 | return UIDevice.current.batteryLevel;
40 |
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/ios/Runner/Assets.xcassets/.DS_Store
--------------------------------------------------------------------------------
/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/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/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/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/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/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/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/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/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/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/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/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/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/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/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/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/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/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/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/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/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/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/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/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/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/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/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/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/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/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/Image.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "filename" : "画板.png",
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/Image.imageset/画板.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/ios/Runner/Assets.xcassets/Image.imageset/画板.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage2.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "compression-type" : "automatic",
5 | "filename" : "icon 2.png",
6 | "idiom" : "universal",
7 | "scale" : "1x"
8 | },
9 | {
10 | "filename" : "icon 2@2x.png",
11 | "idiom" : "universal",
12 | "scale" : "2x"
13 | },
14 | {
15 | "filename" : "icon 2@3x.png",
16 | "idiom" : "universal",
17 | "scale" : "3x"
18 | }
19 | ],
20 | "info" : {
21 | "author" : "xcode",
22 | "version" : 1
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage2.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/Assets.xcassets/LaunchImage2.imageset/icon 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/ios/Runner/Assets.xcassets/LaunchImage2.imageset/icon 2.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage2.imageset/icon 2@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/ios/Runner/Assets.xcassets/LaunchImage2.imageset/icon 2@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage2.imageset/icon 2@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ifgyong/flutter-example/58679c0bef0de656605e3e2bd5daf7b241ea1baf/ios/Runner/Assets.xcassets/LaunchImage2.imageset/icon 2@3x.png
--------------------------------------------------------------------------------
/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 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/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 | NSAppTransportSecurity
8 |
9 | NSAllowsArbitraryLoads
10 |
11 |
12 | CFBundleExecutable
13 | $(EXECUTABLE_NAME)
14 | CFBundleIdentifier
15 | $(PRODUCT_BUNDLE_IDENTIFIER)
16 | CFBundleInfoDictionaryVersion
17 | 6.0
18 | CFBundleName
19 | fluttertest01
20 | CFBundlePackageType
21 | APPL
22 | CFBundleShortVersionString
23 | $(FLUTTER_BUILD_NAME)
24 | CFBundleSignature
25 | ????
26 | CFBundleVersion
27 | $(FLUTTER_BUILD_NUMBER)
28 | LSRequiresIPhoneOS
29 |
30 | io.flutter.embedded_views_preview
31 |
32 | UILaunchStoryboardName
33 | LaunchScreen
34 | UIMainStoryboardFile
35 | Main
36 | UISupportedInterfaceOrientations
37 |
38 | UIInterfaceOrientationPortrait
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UISupportedInterfaceOrientations~ipad
43 |
44 | UIInterfaceOrientationPortrait
45 | UIInterfaceOrientationPortraitUpsideDown
46 | UIInterfaceOrientationLandscapeLeft
47 | UIInterfaceOrientationLandscapeRight
48 |
49 | UIViewControllerBasedStatusBarAppearance
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/lib/animation/base_hreo.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | ///
5 | /// Created by fgyong on 2020/7/21.
6 | ///
7 |
8 | class BaseHreo extends StatefulWidget {
9 | final String heroKey;
10 | BaseHreo({Key key, this.heroKey}) : super(key: key);
11 |
12 | @override
13 | _BaseHreoState createState() => _BaseHreoState();
14 | }
15 |
16 | class _BaseHreoState extends State {
17 | @override
18 | Widget build(BuildContext context) {
19 | return Scaffold(
20 | appBar: AppBar(
21 | title: Text('Hero 动画'),
22 | ),
23 | body: _body(),
24 | );
25 | }
26 |
27 | Widget _body() {
28 | return Center(
29 | child: Column(
30 | children: [
31 | Hero(
32 | child: Container(
33 | width: 100,
34 | height: 100,
35 | child: Image.asset('img/2.png'),
36 | ),
37 | tag: 'key',
38 | ),
39 | OutlineButton(
40 | child: Text('push'),
41 | onPressed: () {
42 | Navigator.push(
43 | context,
44 | MaterialPageRoute(
45 | builder: (ctx) => _BaseHreo(
46 | heroKey: 'key',
47 | )));
48 | },
49 | )
50 | ],
51 | ),
52 | );
53 | }
54 | }
55 |
56 | class _BaseHreo extends StatelessWidget {
57 | final String heroKey;
58 | _BaseHreo({Key key, this.heroKey}) : super(key: key);
59 | @override
60 | Widget build(BuildContext context) {
61 | return Scaffold(
62 | appBar: AppBar(
63 | title: Text('hero 动画'),
64 | ),
65 | body: _body(),
66 | );
67 | }
68 |
69 | Widget _body() {
70 | return Align(
71 | alignment: Alignment.bottomCenter,
72 | child: Hero(
73 | child: ClipRRect(
74 | child: Container(
75 | width: 300,
76 | height: 300,
77 | child: Image.asset(
78 | 'img/2.png',
79 | fit: BoxFit.fill,
80 | ),
81 | ),
82 | borderRadius: BorderRadius.all(Radius.circular(150)),
83 | ),
84 | tag: heroKey ?? 'key',
85 | ),
86 | );
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/lib/animation/base_tagger_animation.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | ///
5 | /// Created by fgyong on 2020/7/21.
6 |
7 | ///
8 |
9 | class BaseTaggerAnimation extends StatefulWidget {
10 | BaseTaggerAnimation({Key key}) : super(key: key);
11 |
12 | @override
13 | _BaseTaggerAnimationState createState() => _BaseTaggerAnimationState();
14 | }
15 |
16 | class _BaseTaggerAnimationState extends State
17 | with SingleTickerProviderStateMixin {
18 | AnimationController _animationController;
19 | Animation _radius;
20 | Animation _height;
21 | @override
22 | void initState() {
23 | _animationController =
24 | AnimationController(vsync: this, duration: Duration(milliseconds: 4000))
25 | ..repeat();
26 | _radius = Tween(begin: 0, end: 100).animate(CurvedAnimation(
27 | parent: _animationController,
28 | curve: Interval(0, 0.5, curve: Curves.easeIn)));
29 | _height = Tween(begin: 1, end: 0.5).animate(CurvedAnimation(
30 | parent: _animationController,
31 | curve: Interval(0.5, 1.0, curve: Curves.bounceOut),
32 | ));
33 |
34 | super.initState();
35 | }
36 |
37 | @override
38 | Widget build(BuildContext context) {
39 | return Scaffold(
40 | appBar: AppBar(
41 | title: Text('交织动画'),
42 | ),
43 | body: _body(),
44 | );
45 | }
46 |
47 | Widget _body() {
48 | double height = 200;
49 | return AnimatedBuilder(
50 | animation: _animationController,
51 | builder: (ctx, child) {
52 | return Center(
53 | child: ClipRRect(
54 | borderRadius: BorderRadius.all(Radius.circular(_radius.value)),
55 | child: Container(
56 | width: height * _height.value,
57 | height: height * _height.value,
58 | color: Colors.orange,
59 | ),
60 | ),
61 | );
62 | },
63 | );
64 | }
65 |
66 | @override
67 | void dispose() {
68 | _animationController.dispose();
69 | super.dispose();
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/lib/baseWidget/animation_text_kit.dart:
--------------------------------------------------------------------------------
1 | import 'package:animated_text_kit/animated_text_kit.dart';
2 | import 'package:flutter/cupertino.dart';
3 | import 'package:flutter/material.dart';
4 |
5 | class AnimationTextKitPage extends StatefulWidget {
6 | @override
7 | State createState() => _AnimationTextKitState();
8 | static String get routeName => '/AnimationTextKitPage';
9 | }
10 |
11 | class _AnimationTextKitState extends State {
12 | @override
13 | Widget build(BuildContext context) {
14 | return Scaffold(
15 | appBar: AppBar(
16 | title: Text('AnimationTextKit'),
17 | ),
18 | body: Column(
19 | children: [
20 | _item(TypewriterAnimatedText(
21 | 'Hello world!',
22 | textStyle: const TextStyle(
23 | fontSize: 32.0,
24 | fontWeight: FontWeight.bold,
25 | ),
26 | speed: const Duration(milliseconds: 200),
27 | )),
28 | _item(ColorizeAnimatedText('ColorizeAnimatedText ',
29 | textStyle: const TextStyle(
30 | fontSize: 32.0,
31 | fontWeight: FontWeight.bold,
32 | ),
33 | colors: [Colors.red, Colors.blueAccent])),
34 | _item(FadeAnimatedText('FadeAnimatedText')),
35 | _item(FlickerAnimatedText('FadeAnimatedText')),
36 | _item(RotateAnimatedText('RotateAnimatedText')),
37 | _item(ScaleAnimatedText('ScaleAnimatedText')),
38 | TextLiquidFill(text: 'TextLiquidFill'),
39 | _item(TyperAnimatedText('TyperAnimatedText ',
40 | speed: Duration(milliseconds: 400))),
41 | ],
42 | ),
43 | );
44 | }
45 |
46 | Widget _item(AnimatedText text) {
47 | return AnimatedTextKit(
48 | animatedTexts: [text],
49 | totalRepeatCount: 4,
50 | pause: const Duration(milliseconds: 500),
51 | displayFullTextOnTap: true,
52 | stopPauseOnTap: true,
53 | );
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/lib/baseWidget/base_page_view_page.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:flutter/cupertino.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:fluttertest01/baseWidget/base_page_view.dart';
6 |
7 | class BasePageViewPage extends StatefulWidget {
8 | @override
9 | State createState() {
10 | return _BaseSliderPageState();
11 | }
12 |
13 | static String get routeName => '/BasePageViewPage';
14 | }
15 |
16 | class _BaseSliderPageState extends State {
17 | @override
18 | void initState() {
19 | super.initState();
20 | _height = 100;
21 | }
22 |
23 | double _height;
24 |
25 | @override
26 | Widget build(BuildContext context) {
27 | return Scaffold(
28 | appBar: AppBar(
29 | title: Text('BaseSliderPageState'),
30 | ),
31 | body: Center(
32 | child: Column(
33 | mainAxisAlignment: MainAxisAlignment.center,
34 | children: [
35 | Container(
36 | child: Text('滑动渐变pageView'),
37 | ),
38 | Container(
39 | alignment: Alignment.center,
40 | child: HotelPageView(
41 | widgetHeights: [100, 200, 150],
42 | pageCount: 3,
43 | initPage: 0,
44 | freshWidget: (fn) {
45 | if (mounted) {
46 | setState(fn);
47 | }
48 | },
49 | freshHeightCallBack: (height) {
50 | scheduleMicrotask(() {
51 | if (mounted) {
52 | setState(() {
53 | _height = height;
54 | });
55 | }
56 | });
57 | },
58 | itemBuilder: (ctx, index) {
59 | double height = [100.0, 200.0, 160.0][index];
60 |
61 | return Container(
62 | height: height,
63 | child: Container(
64 | color:
65 | Colors.accents[(index + 1) % Colors.accents.length],
66 | height: height,
67 | ),
68 | color: Colors.accents[index % Colors.accents.length],
69 | );
70 | },
71 | ),
72 | height: _height,
73 | width: 200,
74 | )
75 | ],
76 | ),
77 | ),
78 | );
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/lib/baseWidget/base_rotation.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class BaseRotationBoxPage extends StatefulWidget {
5 | @override
6 | State createState() {
7 | return _BaseSliderPageState();
8 | }
9 |
10 | static String get routeName => '/BaseRotationBoxPage';
11 | }
12 |
13 | class _BaseSliderPageState extends State {
14 | @override
15 | void initState() {
16 | super.initState();
17 | }
18 |
19 | int value = 1;
20 |
21 | @override
22 | Widget build(BuildContext context) {
23 | return Scaffold(
24 | appBar: AppBar(
25 | title: Text('BaseSliderPageState'),
26 | ),
27 | body: Center(
28 | child: Column(
29 | mainAxisAlignment: MainAxisAlignment.center,
30 | children: [
31 | Text('点击蓝色文字 看见旋转效果 \n RotatedBox会影响布局,而transform不会影响布局,只会影响绘制。'),
32 | SizedBox(
33 | height: 50,
34 | ),
35 | Row(
36 | mainAxisAlignment: MainAxisAlignment.center,
37 | children: [
38 | TextButton(
39 | child: RotatedBox(
40 | quarterTurns: value,
41 | child: Container(
42 | padding: EdgeInsets.all(20),
43 | decoration: BoxDecoration(
44 | color: Colors.blue,
45 | borderRadius: BorderRadius.all(Radius.circular(10))),
46 | child: Text(
47 | '点我旋转',
48 | style: TextStyle(
49 | fontSize: 20,
50 | fontWeight: FontWeight.bold,
51 | color: Colors.white),
52 | ),
53 | ),
54 | ),
55 | onPressed: () {
56 | setState(() {
57 | value += 1;
58 | value %= 4;
59 | print(value);
60 | });
61 | },
62 | ),
63 | Text('点击左侧按钮 我会移动的'),
64 | ],
65 | )
66 | ],
67 | ),
68 | ),
69 | );
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/lib/baseWidget/base_slider.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class BaseSliderRangPage extends StatefulWidget {
5 | @override
6 | State createState() {
7 | return _BaseSliderPageState();
8 | }
9 |
10 | static String get routeName => '/BaseSliderRangPage';
11 | }
12 |
13 | class _BaseSliderPageState extends State {
14 | double value;
15 | RangeValues rangeValues;
16 | @override
17 | void initState() {
18 | super.initState();
19 | value = 0.5;
20 | rangeValues = RangeValues(1, 10);
21 | }
22 |
23 | @override
24 | Widget build(BuildContext context) {
25 | return Scaffold(
26 | appBar: AppBar(
27 | title: Text('BaseSliderPageState'),
28 | ),
29 | body: Center(
30 | child: Column(
31 | mainAxisAlignment: MainAxisAlignment.center,
32 | children: [
33 | Text('拖动下方slider查看效果'),
34 | SizedBox(
35 | height: 50,
36 | ),
37 | Slider(
38 | value: value,
39 | onChanged: (v) {
40 | setState(() {
41 | value = v;
42 | });
43 | },
44 | label: '$value',
45 | divisions: 100,
46 | activeColor: Colors.redAccent,
47 | ),
48 | RangeSlider(
49 | values: rangeValues,
50 | max: 100,
51 | min: 0,
52 | onChanged: (v) {
53 | setState(() {
54 | rangeValues = v;
55 | });
56 | },
57 | labels: RangeLabels('${rangeValues.start}', '${rangeValues.end}'),
58 | divisions: 100,
59 | activeColor: Colors.redAccent,
60 | ),
61 | ],
62 | ),
63 | ),
64 | );
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/lib/comment/config.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | class ThemeYo {
5 | static TextStyle get textStyle {
6 | return TextStyle(color: Colors.black, fontSize: 25);
7 | }
8 |
9 | static TextStyle get subTileTextStyle {
10 | return TextStyle(color: Colors.black54, fontSize: 15);
11 | }
12 |
13 | static TextStyle get itemTextStyle {
14 | return TextStyle(color: Colors.black45, fontSize: 15);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/lib/container/base_clip.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 |
3 | import 'package:flutter/material.dart';
4 |
5 | class BaseClip extends StatelessWidget {
6 | @override
7 | Widget build(BuildContext context) {
8 | return Scaffold(
9 | appBar: AppBar(
10 | title: Text('裁剪部件'),
11 | ),
12 | body: Center(
13 | child: _body2(),
14 | ),
15 | );
16 | }
17 |
18 | Widget _body() {
19 | Widget avator = Container(
20 | width: 100,
21 | height: 100,
22 | color: Colors.blue,
23 | );
24 | return Column(
25 | mainAxisAlignment: MainAxisAlignment.center,
26 | children: [
27 | Text('ClipOval 剪切圆形'),
28 | ClipOval(
29 | child: avator,
30 | ),
31 | Text('ClipOval 圆角'),
32 | ClipRRect(
33 | borderRadius: BorderRadius.all(Radius.circular(10)),
34 | child: avator,
35 | ),
36 | Text('ClipOval 剪切为原来的1/4'),
37 | ClipRect(
38 | child: Align(
39 | alignment: Alignment.topRight,
40 | widthFactor: 0.5,
41 | heightFactor: 0.5,
42 | child: avator,
43 | ),
44 | )
45 | ],
46 | );
47 | }
48 |
49 | Widget _body2() {
50 | Widget avator = Container(height: 200,width: 200,child: Image.asset('img/1.jpeg',),);
51 | return Column(
52 | mainAxisAlignment: MainAxisAlignment.center,
53 | children: [
54 | ClipPath(
55 | child: avator,
56 | clipper: BaseCustomPath(),
57 | )
58 | ],
59 | );
60 | }
61 | }
62 |
63 | class BaseCustomPath extends CustomClipper {
64 | @override
65 | Path getClip(Size size) {
66 | Path path = Path();
67 | path.moveTo(size.width / 2, 40);
68 | path.lineTo(size.width - 15, size.height - 15);
69 | path.lineTo(15, size.height - 15);
70 |
71 | double p1 = 1 * pi;
72 | path.addArc(Rect.fromLTWH(30,30,30,30),
73 | p1, p1 + 2 * pi);
74 | path.lineTo(15, size.height - 15);
75 | path.addArc(
76 | Rect.fromLTWH(size.width - 30,30,30,30),
77 | p1,
78 | p1 + 2 * pi);
79 | path.lineTo(0, 0);
80 | return path;
81 | }
82 |
83 | @override
84 | bool shouldReclip(CustomClipper oldClipper) {
85 | return this != oldClipper;
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/lib/container/base_constraints.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class BaseConstraints extends StatelessWidget {
4 | @override
5 | Widget build(BuildContext context) {
6 | return Scaffold(
7 | appBar: AppBar(
8 | title: Text('尺寸限制类容器'),
9 | ),
10 | body: _widget(),
11 | );
12 | }
13 |
14 | Widget _redBox() {
15 | return ConstrainedBox(
16 | constraints: BoxConstraints(minHeight: 50, minWidth: 50),
17 | child: Container(
18 | color: Colors.red,
19 | ),
20 | );
21 | }
22 |
23 | Widget _widget() {
24 | return Container(
25 | color: Colors.black12,
26 | constraints: BoxConstraints(
27 | minHeight: 100, minWidth: 100, maxWidth: 200, maxHeight: 200),
28 | child: UnconstrainedBox(
29 | child: _redBox(),
30 | ),
31 | );
32 | }
33 |
34 | Widget _bd() {
35 | return Column(
36 | children: [
37 | Container(
38 | constraints: BoxConstraints(
39 | minWidth: 50, minHeight: 50, maxHeight: 200, maxWidth: 100),
40 | color: Colors.red,
41 | child: Container(
42 | constraints: BoxConstraints(
43 | minWidth: 30, minHeight: 30, maxHeight: 50, maxWidth: 100),
44 | // width: 30,
45 | // height: 30,
46 | color: Colors.blue,
47 | ),
48 | ),
49 | _redBox(),
50 | SizedBox(
51 | height: 10,
52 | ),
53 | // SizedBox(width: 100.0, height: 100.0, child: _redBox()),
54 | Container(
55 | width: 200,
56 | height: 200,
57 | child: ConstrainedBox(
58 | constraints: BoxConstraints(
59 | minHeight: 100,
60 | minWidth: 100,
61 | ),
62 | // color: Colors.black12,
63 | child: _redBox(),
64 | ),
65 | ),
66 | ],
67 | );
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/lib/container/base_container.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 |
3 | import 'package:flutter/cupertino.dart';
4 | import 'package:flutter/material.dart';
5 |
6 | class BaseContainer extends StatefulWidget {
7 | @override
8 | _BaseContainerState createState() => _BaseContainerState();
9 | }
10 |
11 | class _BaseContainerState extends State {
12 | @override
13 | Widget build(BuildContext context) {
14 | return Scaffold(
15 | appBar: AppBar(
16 | title: Text('Container容器'),
17 | ),
18 | body: _body(),
19 | );
20 | }
21 |
22 | Widget _body() {
23 | return Center(
24 | child: Column(
25 | mainAxisAlignment: MainAxisAlignment.center,
26 | crossAxisAlignment: CrossAxisAlignment.center,
27 | children: [
28 | Container(
29 | clipBehavior: Clip.none,
30 | width: 200,
31 | height: 100,
32 | decoration: BoxDecoration(
33 | borderRadius: BorderRadius.all(Radius.circular(10)),
34 | gradient:
35 | LinearGradient(colors: [Colors.orange, Colors.deepOrange])),
36 | transform: Matrix4.identity()..rotateZ(pi / 10),
37 | child: Text(
38 | 'www.flutter.fgyong.cn',
39 | style: TextStyle(fontSize: 18, color: Colors.white),
40 | ),
41 | alignment: Alignment.center,
42 | )
43 | ],
44 | ),
45 | );
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/lib/container/base_padding.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class BasePadding extends StatelessWidget {
4 | @override
5 | Widget build(BuildContext context) {
6 | return Scaffold(
7 | appBar: AppBar(
8 | title: Text('Padding'),
9 | ),
10 | body: _body(),
11 | );
12 | }
13 |
14 | Widget _body() {
15 | return Center(
16 | child: Column(
17 | mainAxisAlignment: MainAxisAlignment.center,
18 | children: [
19 | Container(
20 | color: Colors.black12,
21 | child: Padding(
22 | /// 设置上下左右各10像素 颜色是父级颜色
23 |
24 | padding: EdgeInsets.all(10),
25 | child: Container(
26 | color: Colors.red,
27 | child: Text('设置上下左右各10像素 颜色是父级颜色'),
28 | ),
29 | ),
30 | ),
31 | Container(
32 | color: Colors.black12,
33 | child: Padding(
34 | /// 设置上下20像素 颜色是父级颜色
35 |
36 | padding: EdgeInsets.symmetric(vertical: 20),
37 | child: Container(
38 | color: Colors.blue,
39 | child: Text('设置上下20像素 颜色是父级颜色'),
40 | ),
41 | ),
42 | ),
43 | Container(
44 | color: Colors.black12,
45 | child: Padding(
46 | /// 设置上下左右各30像素 颜色是父级颜色
47 | padding:
48 | EdgeInsets.only(left: 30, top: 30, right: 30, bottom: 30),
49 | child: Container(
50 | color: Colors.orange,
51 | child: Text('设置上下左右各30像素 颜色是父级颜色'),
52 | ),
53 | ),
54 | )
55 | ],
56 | ),
57 | );
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/lib/counter.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 |
3 | class Counter extends ChangeNotifier {
4 | int index = 0;
5 | void add() {
6 | index += 1;
7 | notifyListeners();
8 | }
9 |
10 | void changeValue(int index) {
11 | this.index = index;
12 | notifyListeners();
13 | }
14 | }
15 |
16 | class CounterValue extends ChangeNotifier {
17 | int _index = 0;
18 | int get value => _index;
19 | void add() {
20 | _index += 2;
21 | notifyListeners();
22 | }
23 | }
24 |
25 | class CounterValue2 extends ChangeNotifier {
26 | int _index = 0;
27 | int get value => _index;
28 | void add() {
29 | _index += 2;
30 | notifyListeners();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/lib/custom_animation/base_custom_animation.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | ///
5 | /// Created by fgyong on 2020/8/31.
6 | ///
7 |
8 | class BaseCustomListAnimationPage extends StatelessWidget {
9 | static String get routeName => '/BaseCustomListAnimationPage';
10 | @override
11 | Widget build(BuildContext context) {
12 | return Scaffold(
13 | appBar: AppBar(
14 | title: Text(''),
15 | ),
16 | body: _body(),
17 | );
18 | }
19 |
20 | Widget _body() {
21 | return NestedScrollView(
22 | headerSliverBuilder: _listView,
23 | body: ListView.builder(
24 | itemBuilder: (context, index) {
25 | return ListTile(
26 | title: Text('$index'),
27 | );
28 | },
29 | itemCount: 10,
30 | ));
31 | }
32 |
33 | List _listView(BuildContext context, bool innerBoxIsScrolled) {
34 | return [
35 | SliverAppBar(
36 | title: Text('123'),
37 | floating: false,
38 | )
39 | ];
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/lib/features/base_color_and_theme.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | ///
5 | /// Created by fgyong on 2020/7/8.
6 | ///
7 |
8 | class BaseColorAndTheme extends StatefulWidget {
9 | @override
10 | _BaseColorAndThemeState createState() => _BaseColorAndThemeState();
11 | }
12 |
13 | class _BaseColorAndThemeState extends State {
14 | Color _color;
15 | @override
16 | Widget build(BuildContext context) {
17 | ThemeData themeData = Theme.of(context);
18 |
19 | return Theme(
20 | child: Scaffold(
21 | appBar: AppBar(
22 | title: Text('颜色和主题'),
23 | ),
24 | body: _body(),
25 | ),
26 | data: ThemeData(
27 | primarySwatch: _color,
28 | iconTheme: IconThemeData(color: _color),
29 | textTheme: TextTheme(button: TextStyle(backgroundColor: _color))),
30 | );
31 | }
32 |
33 | Widget _body() {
34 | return Center(
35 | child: Column(
36 | children: [
37 | FlatButton(
38 | child: Text('切换颜色'),
39 | color: Theme.of(context).buttonColor,
40 | onPressed: () {
41 | setState(() {
42 | // _iconColor = Colors.orange;
43 | _color = _color == Colors.orange ? Colors.green : Colors.orange;
44 | });
45 | // Navigator.of(context)
46 | // .push(MaterialPageRoute(builder: (ctx) => _BaseRoutePage()));
47 | },
48 | ),
49 | Row(
50 | children: [
51 | Icon(
52 | Icons.add,
53 | size: 50,
54 | ),
55 | Text('颜色跟随主题')
56 | ],
57 | ),
58 | Theme(
59 | child: Row(
60 | children: [
61 | Icon(
62 | Icons.add,
63 | size: 50,
64 | ),
65 | Text('颜色固定')
66 | ],
67 | ),
68 | data: ThemeData(
69 | iconTheme: IconThemeData(color: Colors.red),
70 | ),
71 | )
72 | ],
73 | ),
74 | );
75 | }
76 |
77 | @override
78 | void initState() {
79 | _color = Colors.teal;
80 |
81 | super.initState();
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/lib/features/base_eventbus.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | ///
5 | /// Created by fgyong on 2020/7/9.
6 | ///
7 |
8 | class BaseEventBus extends StatefulWidget {
9 | @override
10 | _BaseEventBusState createState() => _BaseEventBusState();
11 | }
12 |
13 | class _BaseEventBusState extends State {
14 | @override
15 | Widget build(BuildContext context) {
16 | return Scaffold(
17 | appBar: AppBar(
18 | title: Text('事件总线'),
19 | ),
20 | body: _body(),
21 | );
22 | }
23 |
24 | Widget _body() {
25 | return Center(
26 | child: Column(
27 | children: [
28 | Text(_str),
29 | OutlineButton(
30 | onPressed: () {
31 | // _bus.fire('test', '全局调用了一次哦');
32 |
33 | Navigator.of(context)
34 | .push(MaterialPageRoute(builder: (c) => _Page2()));
35 | },
36 | child: Text('点我push new page'),
37 | )
38 | ],
39 | ),
40 | );
41 | }
42 |
43 | String _str = '';
44 | FYEventBus _bus;
45 | @override
46 | void initState() {
47 | _bus = FYEventBus()
48 | ..on('test', (string) {
49 | setState(() {
50 | _str += string;
51 | });
52 | });
53 | super.initState();
54 | }
55 |
56 | @override
57 | void dispose() {
58 | _bus.off('test', null);
59 | super.dispose();
60 | }
61 | }
62 |
63 | class _Page2 extends StatelessWidget {
64 | @override
65 | Widget build(BuildContext context) {
66 | return Scaffold(
67 | appBar: AppBar(
68 | title: Text('过来传值了'),
69 | ),
70 | body: _body(),
71 | );
72 | }
73 |
74 | FYEventBus _bus = FYEventBus();
75 | Widget _body() {
76 | return Center(
77 | child: Column(
78 | children: [
79 | OutlineButton(
80 | onPressed: () {
81 | _bus.fire('test', '\n点我发送请求A');
82 | },
83 | child: Text('点我发送请求A'),
84 | ),
85 | OutlineButton(
86 | onPressed: () {
87 | _bus.fire('test', '\n点我发送请求B');
88 | },
89 | child: Text('点我发送请求B'),
90 | )
91 | ],
92 | ),
93 | );
94 | }
95 | }
96 |
97 | typedef EventBusCallback = void Function(Object object);
98 |
99 | class FYEventBus {
100 | static FYEventBus _bus = new FYEventBus._();
101 | FYEventBus._();
102 |
103 | /// 工厂构造 单例模式
104 | factory FYEventBus() => _bus;
105 |
106 | //保存全局
107 | var _emap = new Map