├── .flutter-plugins-dependencies
├── .gitignore
├── .metadata
├── .vscode
└── settings.json
├── README.md
├── android
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── flutter_widget
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── settings.gradle
└── settings_aar.gradle
├── assets
├── Filip.flr
├── animation.flr
└── loading_img.gif
├── ios
├── Flutter
│ ├── .last_build_id
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ ├── Flutter.podspec
│ └── Release.xcconfig
├── Podfile
├── Podfile.lock
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── Runner
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── 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
│ ├── AudioplayerPlugin.h
│ ├── AudioplayerPlugin.m
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── ConfigurationHelper.swift
│ ├── Info.plist
│ ├── Runner-Bridging-Header.h
│ └── Runner.entitlements
├── lib
├── flutterApp.dart
├── helpers
│ ├── audio.dart
│ └── flutter_toast.dart
├── main.dart
├── routers
│ ├── Animationted.dart
│ ├── AppLifecycleListen.dart
│ ├── AudioApp.dart
│ ├── CollapseNavigation.dart
│ ├── LoginVideo.dart
│ ├── PlatformChannel.dart
│ ├── SlideDown.dart
│ ├── StackNavBar.dart
│ ├── StickTab.dart
│ ├── Swiper.dart
│ ├── TabBarFixed.dart
│ ├── UnlimitedHighCarousel.dart
│ ├── VideoPictureInPicture.dart
│ ├── carousel_zoom.dart
│ └── fold_list.dart
└── widgets
│ ├── TabContainer.dart
│ ├── stick_render.dart
│ └── stick_widget.dart
├── picture
├── QRCode_258.png
├── Screenrecorder-2020-02-24-14-30-23-661.gif
├── Screenshot_2020-02-24-14-37-21-470_com.android.settings.jpg
├── app_lifecycle_listen.gif
├── auto_height_carousel.gif
├── collapse_navigation.gif
├── login_video_demo.gif
├── stack_navbar.gif
├── swipe.gif
└── tapd_59861796_base64_1589612431_37.png
├── pubspec.lock
├── pubspec.yaml
└── test
└── widget_test.dart
/.flutter-plugins-dependencies:
--------------------------------------------------------------------------------
1 | {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"audioplayers","path":"/Users/aming/Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/audioplayers-0.15.1/","dependencies":["path_provider"]},{"name":"path_provider","path":"/Users/aming/Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/path_provider-1.6.16/","dependencies":[]},{"name":"video_player","path":"/Users/aming/Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/video_player-0.10.11+1/","dependencies":[]},{"name":"wakelock","path":"/Users/aming/Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/wakelock-0.1.4+2/","dependencies":[]}],"android":[{"name":"audioplayers","path":"/Users/aming/Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/audioplayers-0.15.1/","dependencies":["path_provider"]},{"name":"path_provider","path":"/Users/aming/Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/path_provider-1.6.16/","dependencies":[]},{"name":"video_player","path":"/Users/aming/Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/video_player-0.10.11+1/","dependencies":[]},{"name":"wakelock","path":"/Users/aming/Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/wakelock-0.1.4+2/","dependencies":[]}],"macos":[{"name":"audioplayers","path":"/Users/aming/Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/audioplayers-0.15.1/","dependencies":[]},{"name":"path_provider_macos","path":"/Users/aming/Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/path_provider_macos-0.0.4+4/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/aming/Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/path_provider_linux-0.0.1+2/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/aming/Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/path_provider_windows-0.0.3/","dependencies":[]}],"web":[{"name":"audioplayers","path":"/Users/aming/Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/audioplayers-0.15.1/","dependencies":[]},{"name":"video_player_web","path":"/Users/aming/Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/video_player_web-0.1.3+2/","dependencies":[]}]},"dependencyGraph":[{"name":"audioplayers","dependencies":["path_provider"]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"video_player","dependencies":["video_player_web"]},{"name":"video_player_web","dependencies":[]},{"name":"wakelock","dependencies":[]}],"date_created":"2020-12-22 14:55:54.305157","version":"1.22.4"}
--------------------------------------------------------------------------------
/.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 | /picture/ppt/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Generated.xcconfig
62 | **/ios/Flutter/app.flx
63 | **/ios/Flutter/app.zip
64 | **/ios/Flutter/flutter_assets/
65 | **/ios/Flutter/flutter_export_environment.sh
66 | **/ios/ServiceDefinitions.json
67 | **/ios/Runner/GeneratedPluginRegistrant.*
68 |
69 | # Exceptions to above rules.
70 | !**/ios/**/default.mode1v3
71 | !**/ios/**/default.mode2v3
72 | !**/ios/**/default.pbxuser
73 | !**/ios/**/default.perspectivev3
74 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
75 |
--------------------------------------------------------------------------------
/.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: 1aedbb1835bd6eb44550293d57d4d124f19901f0
8 | channel: unknown
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "cSpell.words": [
3 | "audioplayer",
4 | "audioplayers",
5 | "hotfix"
6 | ]
7 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
Flutter 小案例(flutter_widget)
2 |
3 | ## 扫码下载
4 |
5 |
6 |
7 |
8 | ## Flutter版本(要注意版本比如1.20.4的版本跑iOS会报找不到引擎)
9 |
10 | ```dart
11 | Flutter 1.20.4 • channel stable • https://github.com/flutter/flutter.git
12 | Framework • revision fba99f6cf9 (6 days ago) • 2020-09-14 15:32:52 -0700
13 | Engine • revision d1bc06f032
14 | Tools • Dart 2.9.2
15 | ```
16 |
17 | ## 视频背景登录(IOS播放请使用真机调试)
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 | ## App状态监听
45 |
46 |
47 |
48 |
49 | ## 错误信息
50 |
51 | ### 打包IOS程序报错
52 |
53 | ```bash
54 | Warning: CocoaPods installed but not initialized. Skipping pod install.
55 | CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
56 | Without CocoaPods, plugins will not work on iOS or macOS.
57 | For more info, see https://flutter.dev/platform-plugins
58 | To initialize CocoaPods, run:
59 | pod setup
60 | once to finalize CocoaPods' installation.
61 | ```
62 |
63 | ### M1芯片`Podfile`报架构问题
64 |
65 | ```
66 | # M1芯片
67 | installer.pods_project.build_configurations.each do |config|
68 | config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
69 | end
70 | ```
71 |
72 | ### 运行`pod setup`
73 |
74 | ```bash
75 | pod setup
76 | ```
77 |
78 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion 28
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | lintOptions {
36 | disable 'InvalidPackage'
37 | }
38 |
39 | defaultConfig {
40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41 | applicationId "com.example.flutter_widget"
42 | minSdkVersion 16
43 | targetSdkVersion 28
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
47 | }
48 |
49 | buildTypes {
50 | release {
51 | // TODO: Add your own signing config for the release build.
52 | // Signing with the debug keys for now, so `flutter run --release` works.
53 | signingConfig signingConfigs.debug
54 | }
55 | }
56 | }
57 |
58 | flutter {
59 | source '../..'
60 | }
61 |
62 | dependencies {
63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
64 | testImplementation 'junit:junit:4.12'
65 | androidTestImplementation 'androidx.test.ext:junit:1.1.1'
66 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
67 | }
68 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
9 |
10 |
17 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/flutter_widget/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.flutter_widget
2 |
3 | import io.flutter.embedding.android.FlutterActivity;
4 |
5 | class MainActivity: 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/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.2.71'
3 | repositories {
4 | // google()
5 | // jcenter()
6 | maven { url 'https://maven.aliyun.com/repository/google' }
7 | maven { url 'https://maven.aliyun.com/repository/jcenter' }
8 | maven { url "https://maven.aliyun.com/nexus/content/groups/public/" }
9 | }
10 |
11 | dependencies {
12 | classpath 'com.android.tools.build:gradle:3.2.1'
13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | // google()
20 | // jcenter()
21 | maven { url 'https://maven.aliyun.com/repository/google' }
22 | maven { url 'https://maven.aliyun.com/repository/jcenter' }
23 | maven { url "https://maven.aliyun.com/nexus/content/groups/public/" }
24 | }
25 | }
26 |
27 | rootProject.buildDir = '../build'
28 | subprojects {
29 | project.buildDir = "${rootProject.buildDir}/${project.name}"
30 | }
31 | subprojects {
32 | project.evaluationDependsOn(':app')
33 | }
34 |
35 | task clean(type: Delete) {
36 | delete rootProject.buildDir
37 | }
38 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
3 | android.enableR8=true
4 | android.useAndroidX=true
5 | android.enableJetifier=true
6 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
7 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/android/settings_aar.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/assets/Filip.flr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/assets/Filip.flr
--------------------------------------------------------------------------------
/assets/animation.flr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/assets/animation.flr
--------------------------------------------------------------------------------
/assets/loading_img.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/assets/loading_img.gif
--------------------------------------------------------------------------------
/ios/Flutter/.last_build_id:
--------------------------------------------------------------------------------
1 | a5e4acfe164ab6114f29b9c56c79a4b4
--------------------------------------------------------------------------------
/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/Flutter.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # NOTE: This podspec is NOT to be published. It is only used as a local source!
3 | #
4 |
5 | Pod::Spec.new do |s|
6 | s.name = 'Flutter'
7 | s.version = '1.0.0'
8 | s.summary = 'High-performance, high-fidelity mobile apps.'
9 | s.description = <<-DESC
10 | Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS.
11 | DESC
12 | s.homepage = 'https://flutter.io'
13 | s.license = { :type => 'MIT' }
14 | s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
15 | s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
16 | s.ios.deployment_target = '8.0'
17 | s.vendored_frameworks = 'Flutter.framework'
18 | end
19 |
--------------------------------------------------------------------------------
/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/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - audioplayers (0.0.1):
3 | - Flutter
4 | - Flutter (1.0.0)
5 | - path_provider (0.0.1):
6 | - Flutter
7 | - video_player (0.0.1):
8 | - Flutter
9 | - wakelock (0.0.1):
10 | - Flutter
11 |
12 | DEPENDENCIES:
13 | - audioplayers (from `.symlinks/plugins/audioplayers/ios`)
14 | - Flutter (from `Flutter`)
15 | - path_provider (from `.symlinks/plugins/path_provider/ios`)
16 | - video_player (from `.symlinks/plugins/video_player/ios`)
17 | - wakelock (from `.symlinks/plugins/wakelock/ios`)
18 |
19 | EXTERNAL SOURCES:
20 | audioplayers:
21 | :path: ".symlinks/plugins/audioplayers/ios"
22 | Flutter:
23 | :path: Flutter
24 | path_provider:
25 | :path: ".symlinks/plugins/path_provider/ios"
26 | video_player:
27 | :path: ".symlinks/plugins/video_player/ios"
28 | wakelock:
29 | :path: ".symlinks/plugins/wakelock/ios"
30 |
31 | SPEC CHECKSUMS:
32 | audioplayers: 84f968cea3f2deab00ec4f8ff53358b3c0b3992c
33 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
34 | path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
35 | video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e
36 | wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4
37 |
38 | PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
39 |
40 | COCOAPODS: 1.8.4
41 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 31EB1B16C1FC2FF1E00B4150 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1CD7E9ADAA6E473663EAECC8 /* Pods_Runner.framework */; };
12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
13 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
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 | 144794647118CA68283DCB5C /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
34 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
35 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
36 | 1CD7E9ADAA6E473663EAECC8 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
37 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
38 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
39 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
40 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
41 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
42 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
43 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
44 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
45 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
46 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
47 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
48 | C5903CB79AFF3A14E3193499 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
49 | E2CA68044BE6867A7EBF5451 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
50 | /* End PBXFileReference section */
51 |
52 | /* Begin PBXFrameworksBuildPhase section */
53 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
54 | isa = PBXFrameworksBuildPhase;
55 | buildActionMask = 2147483647;
56 | files = (
57 | 31EB1B16C1FC2FF1E00B4150 /* Pods_Runner.framework in Frameworks */,
58 | );
59 | runOnlyForDeploymentPostprocessing = 0;
60 | };
61 | /* End PBXFrameworksBuildPhase section */
62 |
63 | /* Begin PBXGroup section */
64 | 1FDB99D1BAFA6B1A3F95B6CC /* Pods */ = {
65 | isa = PBXGroup;
66 | children = (
67 | E2CA68044BE6867A7EBF5451 /* Pods-Runner.debug.xcconfig */,
68 | 144794647118CA68283DCB5C /* Pods-Runner.release.xcconfig */,
69 | C5903CB79AFF3A14E3193499 /* Pods-Runner.profile.xcconfig */,
70 | );
71 | path = Pods;
72 | sourceTree = "";
73 | };
74 | 3A0113B75112EAC3C7B41AB7 /* Frameworks */ = {
75 | isa = PBXGroup;
76 | children = (
77 | 1CD7E9ADAA6E473663EAECC8 /* Pods_Runner.framework */,
78 | );
79 | name = Frameworks;
80 | sourceTree = "";
81 | };
82 | 9740EEB11CF90186004384FC /* Flutter */ = {
83 | isa = PBXGroup;
84 | children = (
85 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
86 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
87 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
88 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
89 | );
90 | name = Flutter;
91 | sourceTree = "";
92 | };
93 | 97C146E51CF9000F007C117D = {
94 | isa = PBXGroup;
95 | children = (
96 | 9740EEB11CF90186004384FC /* Flutter */,
97 | 97C146F01CF9000F007C117D /* Runner */,
98 | 97C146EF1CF9000F007C117D /* Products */,
99 | 1FDB99D1BAFA6B1A3F95B6CC /* Pods */,
100 | 3A0113B75112EAC3C7B41AB7 /* Frameworks */,
101 | );
102 | sourceTree = "";
103 | };
104 | 97C146EF1CF9000F007C117D /* Products */ = {
105 | isa = PBXGroup;
106 | children = (
107 | 97C146EE1CF9000F007C117D /* Runner.app */,
108 | );
109 | name = Products;
110 | sourceTree = "";
111 | };
112 | 97C146F01CF9000F007C117D /* Runner */ = {
113 | isa = PBXGroup;
114 | children = (
115 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
116 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
117 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
118 | 97C147021CF9000F007C117D /* Info.plist */,
119 | 97C146F11CF9000F007C117D /* Supporting Files */,
120 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
121 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
122 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
123 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
124 | );
125 | path = Runner;
126 | sourceTree = "";
127 | };
128 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
129 | isa = PBXGroup;
130 | children = (
131 | );
132 | name = "Supporting Files";
133 | sourceTree = "";
134 | };
135 | /* End PBXGroup section */
136 |
137 | /* Begin PBXNativeTarget section */
138 | 97C146ED1CF9000F007C117D /* Runner */ = {
139 | isa = PBXNativeTarget;
140 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
141 | buildPhases = (
142 | 1F36C6A693058B0D41F364F8 /* [CP] Check Pods Manifest.lock */,
143 | 9740EEB61CF901F6004384FC /* Run Script */,
144 | 97C146EA1CF9000F007C117D /* Sources */,
145 | 97C146EB1CF9000F007C117D /* Frameworks */,
146 | 97C146EC1CF9000F007C117D /* Resources */,
147 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
148 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
149 | C3C1695C34390AF2055460FB /* [CP] Embed Pods Frameworks */,
150 | );
151 | buildRules = (
152 | );
153 | dependencies = (
154 | );
155 | name = Runner;
156 | productName = Runner;
157 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
158 | productType = "com.apple.product-type.application";
159 | };
160 | /* End PBXNativeTarget section */
161 |
162 | /* Begin PBXProject section */
163 | 97C146E61CF9000F007C117D /* Project object */ = {
164 | isa = PBXProject;
165 | attributes = {
166 | LastUpgradeCheck = 1030;
167 | ORGANIZATIONNAME = "The Chromium Authors";
168 | TargetAttributes = {
169 | 97C146ED1CF9000F007C117D = {
170 | CreatedOnToolsVersion = 7.3.1;
171 | DevelopmentTeam = XXB3A2BN5T;
172 | LastSwiftMigration = 0910;
173 | };
174 | };
175 | };
176 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
177 | compatibilityVersion = "Xcode 3.2";
178 | developmentRegion = en;
179 | hasScannedForEncodings = 0;
180 | knownRegions = (
181 | en,
182 | Base,
183 | );
184 | mainGroup = 97C146E51CF9000F007C117D;
185 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
186 | projectDirPath = "";
187 | projectRoot = "";
188 | targets = (
189 | 97C146ED1CF9000F007C117D /* Runner */,
190 | );
191 | };
192 | /* End PBXProject section */
193 |
194 | /* Begin PBXResourcesBuildPhase section */
195 | 97C146EC1CF9000F007C117D /* Resources */ = {
196 | isa = PBXResourcesBuildPhase;
197 | buildActionMask = 2147483647;
198 | files = (
199 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
200 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
201 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
202 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
203 | );
204 | runOnlyForDeploymentPostprocessing = 0;
205 | };
206 | /* End PBXResourcesBuildPhase section */
207 |
208 | /* Begin PBXShellScriptBuildPhase section */
209 | 1F36C6A693058B0D41F364F8 /* [CP] Check Pods Manifest.lock */ = {
210 | isa = PBXShellScriptBuildPhase;
211 | buildActionMask = 2147483647;
212 | files = (
213 | );
214 | inputFileListPaths = (
215 | );
216 | inputPaths = (
217 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
218 | "${PODS_ROOT}/Manifest.lock",
219 | );
220 | name = "[CP] Check Pods Manifest.lock";
221 | outputFileListPaths = (
222 | );
223 | outputPaths = (
224 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
225 | );
226 | runOnlyForDeploymentPostprocessing = 0;
227 | shellPath = /bin/sh;
228 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
229 | showEnvVarsInLog = 0;
230 | };
231 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
232 | isa = PBXShellScriptBuildPhase;
233 | buildActionMask = 2147483647;
234 | files = (
235 | );
236 | inputPaths = (
237 | );
238 | name = "Thin Binary";
239 | outputPaths = (
240 | );
241 | runOnlyForDeploymentPostprocessing = 0;
242 | shellPath = /bin/sh;
243 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
244 | };
245 | 9740EEB61CF901F6004384FC /* Run Script */ = {
246 | isa = PBXShellScriptBuildPhase;
247 | buildActionMask = 2147483647;
248 | files = (
249 | );
250 | inputPaths = (
251 | );
252 | name = "Run Script";
253 | outputPaths = (
254 | );
255 | runOnlyForDeploymentPostprocessing = 0;
256 | shellPath = /bin/sh;
257 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
258 | };
259 | C3C1695C34390AF2055460FB /* [CP] Embed Pods Frameworks */ = {
260 | isa = PBXShellScriptBuildPhase;
261 | buildActionMask = 2147483647;
262 | files = (
263 | );
264 | inputPaths = (
265 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
266 | "${PODS_ROOT}/../Flutter/Flutter.framework",
267 | "${BUILT_PRODUCTS_DIR}/audioplayers/audioplayers.framework",
268 | "${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework",
269 | "${BUILT_PRODUCTS_DIR}/video_player/video_player.framework",
270 | "${BUILT_PRODUCTS_DIR}/wakelock/wakelock.framework",
271 | );
272 | name = "[CP] Embed Pods Frameworks";
273 | outputPaths = (
274 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
275 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/audioplayers.framework",
276 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework",
277 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player.framework",
278 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wakelock.framework",
279 | );
280 | runOnlyForDeploymentPostprocessing = 0;
281 | shellPath = /bin/sh;
282 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
283 | showEnvVarsInLog = 0;
284 | };
285 | /* End PBXShellScriptBuildPhase section */
286 |
287 | /* Begin PBXSourcesBuildPhase section */
288 | 97C146EA1CF9000F007C117D /* Sources */ = {
289 | isa = PBXSourcesBuildPhase;
290 | buildActionMask = 2147483647;
291 | files = (
292 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
293 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
294 | );
295 | runOnlyForDeploymentPostprocessing = 0;
296 | };
297 | /* End PBXSourcesBuildPhase section */
298 |
299 | /* Begin PBXVariantGroup section */
300 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
301 | isa = PBXVariantGroup;
302 | children = (
303 | 97C146FB1CF9000F007C117D /* Base */,
304 | );
305 | name = Main.storyboard;
306 | sourceTree = "";
307 | };
308 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
309 | isa = PBXVariantGroup;
310 | children = (
311 | 97C147001CF9000F007C117D /* Base */,
312 | );
313 | name = LaunchScreen.storyboard;
314 | sourceTree = "";
315 | };
316 | /* End PBXVariantGroup section */
317 |
318 | /* Begin XCBuildConfiguration section */
319 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
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-with-dsym";
350 | ENABLE_NS_ASSERTIONS = NO;
351 | ENABLE_STRICT_OBJC_MSGSEND = YES;
352 | GCC_C_LANGUAGE_STANDARD = gnu99;
353 | GCC_NO_COMMON_BLOCKS = YES;
354 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
355 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
356 | GCC_WARN_UNDECLARED_SELECTOR = YES;
357 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
358 | GCC_WARN_UNUSED_FUNCTION = YES;
359 | GCC_WARN_UNUSED_VARIABLE = YES;
360 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
361 | MTL_ENABLE_DEBUG_INFO = NO;
362 | SDKROOT = iphoneos;
363 | TARGETED_DEVICE_FAMILY = "1,2";
364 | VALIDATE_PRODUCT = YES;
365 | };
366 | name = Profile;
367 | };
368 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
369 | isa = XCBuildConfiguration;
370 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
371 | buildSettings = {
372 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
373 | CLANG_ENABLE_MODULES = YES;
374 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
375 | DEVELOPMENT_TEAM = XXB3A2BN5T;
376 | ENABLE_BITCODE = NO;
377 | FRAMEWORK_SEARCH_PATHS = (
378 | "$(inherited)",
379 | "$(PROJECT_DIR)/Flutter",
380 | );
381 | INFOPLIST_FILE = Runner/Info.plist;
382 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
383 | LIBRARY_SEARCH_PATHS = (
384 | "$(inherited)",
385 | "$(PROJECT_DIR)/Flutter",
386 | );
387 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterWidget;
388 | PRODUCT_NAME = "$(TARGET_NAME)";
389 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
390 | SWIFT_VERSION = 4.0;
391 | VERSIONING_SYSTEM = "apple-generic";
392 | };
393 | name = Profile;
394 | };
395 | 97C147031CF9000F007C117D /* Debug */ = {
396 | isa = XCBuildConfiguration;
397 | buildSettings = {
398 | ALWAYS_SEARCH_USER_PATHS = NO;
399 | CLANG_ANALYZER_NONNULL = YES;
400 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
401 | CLANG_CXX_LIBRARY = "libc++";
402 | CLANG_ENABLE_MODULES = YES;
403 | CLANG_ENABLE_OBJC_ARC = YES;
404 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
405 | CLANG_WARN_BOOL_CONVERSION = YES;
406 | CLANG_WARN_COMMA = YES;
407 | CLANG_WARN_CONSTANT_CONVERSION = YES;
408 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
409 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
410 | CLANG_WARN_EMPTY_BODY = YES;
411 | CLANG_WARN_ENUM_CONVERSION = YES;
412 | CLANG_WARN_INFINITE_RECURSION = YES;
413 | CLANG_WARN_INT_CONVERSION = YES;
414 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
415 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
416 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
417 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
418 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
419 | CLANG_WARN_STRICT_PROTOTYPES = YES;
420 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
421 | CLANG_WARN_UNREACHABLE_CODE = YES;
422 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
423 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
424 | COPY_PHASE_STRIP = NO;
425 | DEBUG_INFORMATION_FORMAT = dwarf;
426 | ENABLE_STRICT_OBJC_MSGSEND = YES;
427 | ENABLE_TESTABILITY = YES;
428 | GCC_C_LANGUAGE_STANDARD = gnu99;
429 | GCC_DYNAMIC_NO_PIC = NO;
430 | GCC_NO_COMMON_BLOCKS = YES;
431 | GCC_OPTIMIZATION_LEVEL = 0;
432 | GCC_PREPROCESSOR_DEFINITIONS = (
433 | "DEBUG=1",
434 | "$(inherited)",
435 | );
436 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
437 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
438 | GCC_WARN_UNDECLARED_SELECTOR = YES;
439 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
440 | GCC_WARN_UNUSED_FUNCTION = YES;
441 | GCC_WARN_UNUSED_VARIABLE = YES;
442 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
443 | MTL_ENABLE_DEBUG_INFO = YES;
444 | ONLY_ACTIVE_ARCH = YES;
445 | SDKROOT = iphoneos;
446 | TARGETED_DEVICE_FAMILY = "1,2";
447 | };
448 | name = Debug;
449 | };
450 | 97C147041CF9000F007C117D /* Release */ = {
451 | isa = XCBuildConfiguration;
452 | buildSettings = {
453 | ALWAYS_SEARCH_USER_PATHS = NO;
454 | CLANG_ANALYZER_NONNULL = YES;
455 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
456 | CLANG_CXX_LIBRARY = "libc++";
457 | CLANG_ENABLE_MODULES = YES;
458 | CLANG_ENABLE_OBJC_ARC = YES;
459 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
460 | CLANG_WARN_BOOL_CONVERSION = YES;
461 | CLANG_WARN_COMMA = YES;
462 | CLANG_WARN_CONSTANT_CONVERSION = YES;
463 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
464 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
465 | CLANG_WARN_EMPTY_BODY = YES;
466 | CLANG_WARN_ENUM_CONVERSION = YES;
467 | CLANG_WARN_INFINITE_RECURSION = YES;
468 | CLANG_WARN_INT_CONVERSION = YES;
469 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
470 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
471 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
472 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
473 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
474 | CLANG_WARN_STRICT_PROTOTYPES = YES;
475 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
476 | CLANG_WARN_UNREACHABLE_CODE = YES;
477 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
478 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
479 | COPY_PHASE_STRIP = NO;
480 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
481 | ENABLE_NS_ASSERTIONS = NO;
482 | ENABLE_STRICT_OBJC_MSGSEND = YES;
483 | GCC_C_LANGUAGE_STANDARD = gnu99;
484 | GCC_NO_COMMON_BLOCKS = YES;
485 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
486 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
487 | GCC_WARN_UNDECLARED_SELECTOR = YES;
488 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
489 | GCC_WARN_UNUSED_FUNCTION = YES;
490 | GCC_WARN_UNUSED_VARIABLE = YES;
491 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
492 | MTL_ENABLE_DEBUG_INFO = NO;
493 | SDKROOT = iphoneos;
494 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
495 | TARGETED_DEVICE_FAMILY = "1,2";
496 | VALIDATE_PRODUCT = YES;
497 | };
498 | name = Release;
499 | };
500 | 97C147061CF9000F007C117D /* Debug */ = {
501 | isa = XCBuildConfiguration;
502 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
503 | buildSettings = {
504 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
505 | CLANG_ENABLE_MODULES = YES;
506 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
507 | DEVELOPMENT_TEAM = XXB3A2BN5T;
508 | ENABLE_BITCODE = NO;
509 | FRAMEWORK_SEARCH_PATHS = (
510 | "$(inherited)",
511 | "$(PROJECT_DIR)/Flutter",
512 | );
513 | INFOPLIST_FILE = Runner/Info.plist;
514 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
515 | LIBRARY_SEARCH_PATHS = (
516 | "$(inherited)",
517 | "$(PROJECT_DIR)/Flutter",
518 | );
519 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterWidget;
520 | PRODUCT_NAME = "$(TARGET_NAME)";
521 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
522 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
523 | SWIFT_VERSION = 4.0;
524 | VERSIONING_SYSTEM = "apple-generic";
525 | };
526 | name = Debug;
527 | };
528 | 97C147071CF9000F007C117D /* Release */ = {
529 | isa = XCBuildConfiguration;
530 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
531 | buildSettings = {
532 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
533 | CLANG_ENABLE_MODULES = YES;
534 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
535 | DEVELOPMENT_TEAM = XXB3A2BN5T;
536 | ENABLE_BITCODE = NO;
537 | FRAMEWORK_SEARCH_PATHS = (
538 | "$(inherited)",
539 | "$(PROJECT_DIR)/Flutter",
540 | );
541 | INFOPLIST_FILE = Runner/Info.plist;
542 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
543 | LIBRARY_SEARCH_PATHS = (
544 | "$(inherited)",
545 | "$(PROJECT_DIR)/Flutter",
546 | );
547 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterWidget;
548 | PRODUCT_NAME = "$(TARGET_NAME)";
549 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
550 | SWIFT_VERSION = 4.0;
551 | VERSIONING_SYSTEM = "apple-generic";
552 | };
553 | name = Release;
554 | };
555 | /* End XCBuildConfiguration section */
556 |
557 | /* Begin XCConfigurationList section */
558 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
559 | isa = XCConfigurationList;
560 | buildConfigurations = (
561 | 97C147031CF9000F007C117D /* Debug */,
562 | 97C147041CF9000F007C117D /* Release */,
563 | 249021D3217E4FDB00AE95B9 /* Profile */,
564 | );
565 | defaultConfigurationIsVisible = 0;
566 | defaultConfigurationName = Release;
567 | };
568 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
569 | isa = XCConfigurationList;
570 | buildConfigurations = (
571 | 97C147061CF9000F007C117D /* Debug */,
572 | 97C147071CF9000F007C117D /* Release */,
573 | 249021D4217E4FDB00AE95B9 /* Profile */,
574 | );
575 | defaultConfigurationIsVisible = 0;
576 | defaultConfigurationName = Release;
577 | };
578 | /* End XCConfigurationList section */
579 | };
580 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
581 | }
582 |
--------------------------------------------------------------------------------
/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/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/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // Runner
4 | //
5 | // Created by 阿明 on 2019/10/25.
6 | // Copyright © 2019 The Chromium Authors. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface AppDelegate : NSObject
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // Runner
4 | //
5 | // Created by 阿明 on 2019/10/25.
6 | // Copyright © 2019 The Chromium Authors. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @implementation AppDelegate
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Chromium Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 | import UIKit
5 | import Flutter
6 |
7 | enum ChannelName {
8 | static let battery = "samples.flutter.io/battery"
9 | static let charging = "samples.flutter.io/charging"
10 | }
11 |
12 | enum BatteryState {
13 | static let charging = "charging"
14 | static let discharging = "discharging"
15 | }
16 |
17 | enum MyFlutterErrorCode {
18 | static let unavailable = "UNAVAILABLE"
19 | }
20 |
21 | @UIApplicationMain
22 | @objc class AppDelegate: FlutterAppDelegate, FlutterStreamHandler {
23 | private var eventSink: FlutterEventSink?
24 |
25 | override func application(
26 | _ application: UIApplication,
27 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
28 | GeneratedPluginRegistrant.register(with: self)
29 | guard let controller = window?.rootViewController as? FlutterViewController else {
30 | fatalError("rootViewController is not type FlutterViewController")
31 | }
32 | let batteryChannel = FlutterMethodChannel(name: ChannelName.battery,
33 | binaryMessenger: controller.binaryMessenger)
34 | batteryChannel.setMethodCallHandler({
35 | [weak self] (call: FlutterMethodCall, result: FlutterResult) -> Void in
36 | guard call.method == "getBatteryLevel" else {
37 | result(FlutterMethodNotImplemented)
38 | return
39 | }
40 | self?.receiveBatteryLevel(result: result)
41 | })
42 |
43 | let chargingChannel = FlutterEventChannel(name: ChannelName.charging,
44 | binaryMessenger: controller.binaryMessenger)
45 | chargingChannel.setStreamHandler(self)
46 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
47 | }
48 |
49 | private func receiveBatteryLevel(result: FlutterResult) {
50 | let device = UIDevice.current
51 | device.isBatteryMonitoringEnabled = true
52 | guard device.batteryState != .unknown else {
53 | result(FlutterError(code: MyFlutterErrorCode.unavailable,
54 | message: "Battery info unavailable",
55 | details: nil))
56 | return
57 | }
58 | result(Int(device.batteryLevel * 100))
59 | }
60 |
61 | public func onListen(withArguments arguments: Any?,
62 | eventSink: @escaping FlutterEventSink) -> FlutterError? {
63 | self.eventSink = eventSink
64 | UIDevice.current.isBatteryMonitoringEnabled = true
65 | sendBatteryStateEvent()
66 | NotificationCenter.default.addObserver(
67 | self,
68 | selector: #selector(AppDelegate.onBatteryStateDidChange),
69 | name: NSNotification.Name.UIDeviceBatteryStateDidChange,
70 | object: nil)
71 | return nil
72 | }
73 |
74 | @objc private func onBatteryStateDidChange(notification: NSNotification) {
75 | sendBatteryStateEvent()
76 | }
77 |
78 | private func sendBatteryStateEvent() {
79 | guard let eventSink = eventSink else {
80 | return
81 | }
82 |
83 | switch UIDevice.current.batteryState {
84 | case .full:
85 | eventSink(BatteryState.charging)
86 | case .charging:
87 | eventSink(BatteryState.charging)
88 | case .unplugged:
89 | eventSink(BatteryState.discharging)
90 | default:
91 | eventSink(FlutterError(code: MyFlutterErrorCode.unavailable,
92 | message: "Charging status unavailable",
93 | details: nil))
94 | }
95 | }
96 |
97 | public func onCancel(withArguments arguments: Any?) -> FlutterError? {
98 | NotificationCenter.default.removeObserver(self)
99 | eventSink = nil
100 | return nil
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/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/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/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/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/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/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/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/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/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/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/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/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/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/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/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/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/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/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/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/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/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/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/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/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/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/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/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/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/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/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/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/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tecode/flutter_widget/3a22898c58114bd942162ca1fc7bbdcef9396430/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/AudioplayerPlugin.h:
--------------------------------------------------------------------------------
1 | //
2 | // AudioplayerPlugin.h
3 | // Runner
4 | //
5 | // Created by 阿明 on 2019/10/25.
6 | // Copyright © 2019 The Chromium Authors. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface AudioplayerPlugin : NSObject
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/ios/Runner/AudioplayerPlugin.m:
--------------------------------------------------------------------------------
1 | //
2 | // AudioplayerPlugin.m
3 | // Runner
4 | //
5 | // Created by 阿明 on 2019/10/25.
6 | // Copyright © 2019 The Chromium Authors. All rights reserved.
7 | //
8 |
9 | #import "AudioplayerPlugin.h"
10 |
11 | @implementation AudioplayerPlugin
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/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/ConfigurationHelper.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ConfigurationHelper.swift
3 | // BrainScientist_Business
4 | //
5 | // Created by 沈鑫 on 2019/3/19.
6 | // Copyright © 2019 BrainScientist. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import IQKeyboardManagerSwift
11 | import AVFoundation
12 | import Kingfisher
13 |
14 | let sdkAppid = 1400194089
15 | let sdkAccountType = "36862"
16 | let identifier = "krcm110"
17 | let userSig = "eJxlj11PgzAYhe-5FaTXRltKNzHZxaZuUTcMMCTuhhTaSkPooBT8iv-diBqb*N4*T84577vjui7Yb5NTWpbHQZncvLYcuBcugODkD7atZDk1OdbsH*QvrdQ8p8JwPUFECPEgtB3JuDJSyB*j1mWDkC30rM6nlu8EH0IU*PA8sBX5NMHddXR5sxlnWX3ISpEqL0RXfkIaWg1VWse3VTEcYpEGKuzul2cP66VcZWPbNX0x6m2UvXVRHG7kKiRire7i5wbvkseC0XlVp-0*WiysSiMb-vsSxnBOZvagketeHtUkeBAR5GH4dcD5cD4BFpdeiA__"
18 | /** 高德地图appkey*/
19 | let mapApiKey = "5e9242e82a4c9bf3951cc6f1f33a3287"
20 | let JPUSH_APPKEY = "1e276f53606380ff031e22ed"
21 | let channelKey = "BrainScientist-iOS";
22 |
23 | class ConfigurationHelper: NSObject, WXApiDelegate {
24 |
25 | var shareHandler: (( _ resp: BaseResp) -> Void)?
26 |
27 | /** 单例*/
28 | static let shared = ConfigurationHelper()
29 |
30 | class func initializeConfiguration() {
31 | self.networkChange()
32 | self.userInterfaceConfiguration()
33 | // self.keyboardManagerConfiguration()
34 | VersionRefreshHelper.shared.logout()
35 | self.progressHUDConfiguration()
36 | self.ShareSDKConfiguration()
37 | self.TIMConfiguration()
38 | self.AMapServicesConfiguration()
39 | self.BuglyConfiguration()
40 | if !VersionRefreshHelper.shared.isGoingAppFrist {
41 | VersionRefreshHelper.shared.isGoingAppFrist = true
42 | } else {
43 | if !self.isUserNotificationEnable() {
44 | SystemAler.shared.show("“脑学家”想给您发送通知", "您的手机需要开启通知权限之后才能正常接收通知。", ["取消","去设置"]) { (index) in
45 | if index == 0 {
46 |
47 | } else {
48 | self.goToAppSystemSetting()
49 | }
50 | }
51 | }
52 | }
53 | }
54 |
55 | class func resetRoot() -> UIViewController {
56 | if UserInfoHelper.shared.addNickname {
57 | let nicknameVC = LoginChangeNickNameViewController(nibName: "LoginChangeNickNameViewController", bundle: nil)
58 | nicknameVC.businessUser = UserInfoHelper.shared.businessUser
59 | let rootNav = BaseNavigationController.init(rootViewController: nicknameVC)
60 | rootNav.navigationBar.isHidden = true
61 | return rootNav
62 | } else {
63 | if UserInfoHelper.shared.isLogin {
64 | let rootNav = BaseNavigationController.init(rootViewController: RootTabBarController())
65 | rootNav.navigationBar.isHidden = true
66 | return rootNav
67 | } else {
68 | let loginNav = BaseNavigationController.init(rootViewController: LoginViewController.init(nibName: "LoginViewController", bundle: nil))
69 | loginNav.navigationBar.isHidden = true
70 | return loginNav
71 | }
72 | }
73 | }
74 |
75 | /** 判断用户是否允许接受通知消息*/
76 | class func isUserNotificationEnable() -> Bool {
77 | var isEnable: Bool = false
78 | let setting = UIApplication.shared.currentUserNotificationSettings
79 | isEnable = (UIUserNotificationType.init(rawValue: 0) == setting!.types) ? false : true
80 | return isEnable
81 | }
82 | //MARK: 跳转到设置页面
83 | class func goToAppSystemSetting() {
84 | let application = UIApplication.shared
85 | let url = URL.init(string: UIApplication.openSettingsURLString)
86 | if application.canOpenURL(url!) {
87 | if #available(iOS 10.0, *) {
88 | application.open(url!, options: [:], completionHandler: nil)
89 | } else {
90 | // Fallback on earlier versions
91 | application.openURL(url!)
92 | }
93 | }
94 | }
95 |
96 | class func JPUSHConfiguration(_ application: UIApplication, launchOptions: [UIApplication.LaunchOptionsKey: Any]?, delegate: JPUSHRegisterDelegate) {
97 |
98 | let entity = JPUSHRegisterEntity()
99 | if #available(iOS 12.0, *) {
100 | entity.types = Int(JPAuthorizationOptions.alert.rawValue|JPAuthorizationOptions.badge.rawValue|JPAuthorizationOptions.sound.rawValue|JPAuthorizationOptions.providesAppNotificationSettings.rawValue)
101 | } else {
102 | // Fallback on earlier versions
103 | }
104 | JPUSHService.registrationIDCompletionHandler { (retCode, registrationID) in
105 | if retCode == 0 {
106 | USERDEFAULTS.set(registrationID, forKey: "registrationID")
107 | USERDEFAULTS.synchronize()
108 | } else {
109 | USERDEFAULTS.set("", forKey: "registrationID")
110 | USERDEFAULTS.synchronize()
111 | }
112 |
113 | if #available(iOS 10.0, *) {
114 | let center = UNUserNotificationCenter.current()
115 | center.requestAuthorization(options: (UNAuthorizationOptions(rawValue: UNAuthorizationOptions.alert.rawValue + UNAuthorizationOptions.sound.rawValue)), completionHandler: { (granted, error) in
116 |
117 | })
118 | } else {
119 | let settings = UIUserNotificationSettings.init(types: .badge, categories: nil)
120 | UIApplication.shared.registerUserNotificationSettings(settings)
121 | application.registerForRemoteNotifications()
122 | }
123 | }
124 | JPUSHService.register(forRemoteNotificationConfig: entity, delegate: delegate)
125 | JPUSHService.setup(withOption: launchOptions, appKey: JPUSH_APPKEY, channel: channelKey, apsForProduction: false)
126 | }
127 |
128 | private class func BuglyConfiguration() {
129 | Bugly.start(withAppId: "d1e2f2b658")
130 | }
131 |
132 | /** 设置UITabBarItem属性*/
133 | private class func userInterfaceConfiguration() {
134 | UIBarButtonItem.appearance().setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.red], for: .normal)
135 | UIBarButtonItem.appearance().setTitleTextAttributes([NSAttributedString.Key.foregroundColor : UIColor.red], for: .selected)
136 | }
137 |
138 | /** 设置IQKeyboardManager*/
139 | private class func keyboardManagerConfiguration() {
140 | IQKeyboardManager.shared.enable = true
141 | IQKeyboardManager.shared.enableAutoToolbar = false
142 | IQKeyboardManager.shared.shouldResignOnTouchOutside = false
143 | }
144 |
145 | /** 设置SVProgressHUD*/
146 | private class func progressHUDConfiguration() {
147 | }
148 |
149 | /** shareSDK*/
150 | private class func ShareSDKConfiguration() {
151 | WXApi.registerApp("wx5e7cbffb0621d349")
152 | }
153 |
154 | class func wxHandleOpenURL(url: URL) -> Bool {
155 | return WXApi.handleOpen(url, delegate: ConfigurationHelper.shared)
156 | }
157 |
158 | /** 清除缓存*/
159 | class func cleanCache() {
160 | SDImageCache.shared.clearDisk(onCompletion: nil)
161 | SDImageCache.shared.clearMemory()
162 | KingfisherManager.shared.cache.clearDiskCache()
163 | KingfisherManager.shared.cache.clearMemoryCache()
164 | KingfisherManager.shared.cache.cleanExpiredDiskCache()
165 | }
166 |
167 | /** 计算缓存大小*/
168 | class func cacheCountData() -> String {
169 | let imageCache: CGFloat = CGFloat(KingfisherManager.shared.cache.maxDiskCacheSize / (1024*1024))
170 | let sdImageCache: CGFloat = CGFloat(SDImageCache.shared.totalDiskSize() / (1024*1024))
171 | return String.init(format: "%.1lfMB", imageCache+sdImageCache)
172 | }
173 |
174 |
175 |
176 | private class func AMapServicesConfiguration() {
177 | AMapServices.shared()?.apiKey = mapApiKey
178 | }
179 |
180 | private class func TIMConfiguration() {
181 | TUIKit.sharedInstance()?.setup(withAppId: sdkAppid)
182 | }
183 |
184 | private class func networkChange(){
185 | RequestHelper.startListening { (status) in
186 | if (status == NetworkStatus.unknown || status == NetworkStatus.notReachable) {
187 | YJYHUD.show("亲,似乎已断开互联网链接!")
188 | }
189 | }
190 | }
191 |
192 | /** WXApiDelegate*/
193 | func onResp(_ resp: BaseResp) {
194 | if self.shareHandler != nil {
195 | self.shareHandler!(resp)
196 | }
197 | }
198 | }
199 |
200 |
--------------------------------------------------------------------------------
/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_widget
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UIBackgroundModes
26 |
27 | audio
28 |
29 | UILaunchStoryboardName
30 | LaunchScreen
31 | UIMainStoryboardFile
32 | Main
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 | UIViewControllerBasedStatusBarAppearance
47 |
48 | NSAppTransportSecurity
49 |
50 | NSAllowsArbitraryLoads
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/ios/Runner/Runner.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | aps-environment
6 | development
7 |
8 |
9 |
--------------------------------------------------------------------------------
/lib/flutterApp.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_widget/routers/AppLifecycleListen.dart';
3 | import 'package:flutter_widget/routers/CollapseNavigation.dart';
4 | import 'package:flutter_widget/routers/LoginVideo.dart';
5 | import 'package:flutter_widget/routers/StackNavBar.dart';
6 | import 'package:flutter_widget/routers/Swiper.dart';
7 | import 'package:flutter_widget/routers/UnlimitedHighCarousel.dart';
8 | import 'package:flutter_widget/routers/AudioApp.dart';
9 | import 'package:flutter_widget/routers/SlideDown.dart';
10 | import 'package:flutter_widget/routers/TabBarFixed.dart';
11 | import 'package:flutter_widget/routers/StickTab.dart';
12 | import 'package:flutter_widget/routers/PlatformChannel.dart';
13 | import 'package:flutter_widget/routers/Animationted.dart';
14 | import 'package:flutter_widget/routers/VideoPictureInPicture.dart';
15 | import 'package:flutter_widget/routers/carousel_zoom.dart';
16 | import 'package:flutter_widget/routers/fold_list.dart';
17 |
18 | class FlutterApp extends StatelessWidget {
19 | @override
20 | Widget build(BuildContext context) {
21 | return Scaffold(
22 | body: SafeArea(
23 | child: Container(
24 | color: Color(0xfffafafa),
25 | padding: EdgeInsets.only(top: 28.0),
26 | child: ListView(
27 | children: [
28 | ListTile(
29 | title: Text("视频背景登录"),
30 | trailing: Icon(
31 | Icons.keyboard_arrow_right,
32 | color: Colors.black,
33 | ),
34 | onTap: () {
35 | Navigator.push(
36 | context,
37 | MaterialPageRoute(
38 | builder: (context) => const LoginVideo()));
39 | },
40 | ),
41 | ListTile(
42 | title: Text("具有缩放效果的轮播图"),
43 | trailing: Icon(
44 | Icons.keyboard_arrow_right,
45 | color: Colors.black,
46 | ),
47 | onTap: () {
48 | Navigator.push(
49 | context,
50 | MaterialPageRoute(
51 | builder: (context) => const CarouselZoom()));
52 | },
53 | ),
54 | ListTile(
55 | title: Text("仿马蜂窝不限高轮播图"),
56 | trailing: Icon(
57 | Icons.keyboard_arrow_right,
58 | color: Colors.black,
59 | ),
60 | onTap: () {
61 | Navigator.push(
62 | context,
63 | MaterialPageRoute(
64 | builder: (context) => const UnlimitedHighCarousel()));
65 | },
66 | ),
67 | ListTile(
68 | title: Text("下拉菜单"),
69 | trailing: Icon(
70 | Icons.keyboard_arrow_right,
71 | color: Colors.black,
72 | ),
73 | onTap: () {
74 | Navigator.push(context,
75 | MaterialPageRoute(builder: (context) => const SlideDown()));
76 | },
77 | ),
78 | ListTile(
79 | title: Text("音频播放"),
80 | trailing: Icon(
81 | Icons.keyboard_arrow_right,
82 | color: Colors.black,
83 | ),
84 | onTap: () {
85 | Navigator.push(context,
86 | MaterialPageRoute(builder: (context) => const AudioApp()));
87 | },
88 | ),
89 | ListTile(
90 | title: Text("固定TabBar"),
91 | trailing: Icon(
92 | Icons.keyboard_arrow_right,
93 | color: Colors.black,
94 | ),
95 | onTap: () {
96 | Navigator.push(context,
97 | MaterialPageRoute(builder: (context) => TabBarFixed()));
98 | },
99 | ),
100 | ListTile(
101 | title: Text("ListView嵌套ListView"),
102 | trailing: Icon(
103 | Icons.keyboard_arrow_right,
104 | color: Colors.black,
105 | ),
106 | onTap: () {
107 | Navigator.push(context,
108 | MaterialPageRoute(builder: (context) => StickTab()));
109 | },
110 | ),
111 | ListTile(
112 | title: Text("平台通道"),
113 | trailing: Icon(
114 | Icons.keyboard_arrow_right,
115 | color: Colors.black,
116 | ),
117 | onTap: () {
118 | Navigator.push(context,
119 | MaterialPageRoute(builder: (context) => PlatformChannel()));
120 | },
121 | ),
122 | ListTile(
123 | title: Text("动画"),
124 | trailing: Icon(
125 | Icons.keyboard_arrow_right,
126 | color: Colors.black,
127 | ),
128 | onTap: () {
129 | Navigator.push(context,
130 | MaterialPageRoute(builder: (context) => Animationted()));
131 | },
132 | ),
133 | ListTile(
134 | title: Text("Swipe"),
135 | trailing: Icon(
136 | Icons.keyboard_arrow_right,
137 | color: Colors.black,
138 | ),
139 | onTap: () {
140 | Navigator.push(
141 | context, MaterialPageRoute(builder: (context) => Swipe()));
142 | },
143 | ),
144 | ListTile(
145 | title: Text("滑动导航变色"),
146 | trailing: Icon(
147 | Icons.keyboard_arrow_right,
148 | color: Colors.black,
149 | ),
150 | onTap: () {
151 | Navigator.push(context,
152 | MaterialPageRoute(builder: (context) => StackNavBar()));
153 | },
154 | ),
155 | ListTile(
156 | title: Text("滑动隐藏导航"),
157 | trailing: Icon(
158 | Icons.keyboard_arrow_right,
159 | color: Colors.black,
160 | ),
161 | onTap: () {
162 | Navigator.push(
163 | context,
164 | MaterialPageRoute(
165 | builder: (context) => CollapseNavigation()));
166 | },
167 | ),
168 | ListTile(
169 | title: Text("App状态监听"),
170 | trailing: Icon(
171 | Icons.keyboard_arrow_right,
172 | color: Colors.black,
173 | ),
174 | onTap: () {
175 | Navigator.push(
176 | context,
177 | MaterialPageRoute(
178 | builder: (context) => AppLifecycleListen()));
179 | },
180 | ),
181 | ListTile(
182 | title: Text("视频嵌套播放"),
183 | trailing: Icon(
184 | Icons.keyboard_arrow_right,
185 | color: Colors.black,
186 | ),
187 | onTap: () {
188 | Navigator.push(
189 | context,
190 | MaterialPageRoute(
191 | builder: (context) => VideoPictureInPicture()));
192 | },
193 | ),
194 | ListTile(
195 | title: Text("折叠列表"),
196 | trailing: Icon(
197 | Icons.keyboard_arrow_right,
198 | color: Colors.black,
199 | ),
200 | onTap: () {
201 | Navigator.push(context,
202 | MaterialPageRoute(builder: (context) => FoldList()));
203 | },
204 | ),
205 | ],
206 | ),
207 | ),
208 | ));
209 | }
210 | }
211 |
--------------------------------------------------------------------------------
/lib/helpers/audio.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:flutter/services.dart';
4 |
5 | /// Communicates the current state of the audio player.
6 | enum AudioPlayerState {
7 | /// Player is stopped. No file is loaded to the player. Calling [resume] or
8 | /// [pause] will result in exception.
9 | STOPPED,
10 | /// Currently playing a file. The user can [pause], [resume] or [stop] the
11 | /// playback.
12 | PLAYING,
13 | /// Paused. The user can [resume] the playback without providing the URL.
14 | PAUSED,
15 | /// The playback has been completed. This state is the same as [STOPPED],
16 | /// however we differentiate it because some clients might want to know when
17 | /// the playback is done versus when the user has stopped the playback.
18 | COMPLETED,
19 | }
20 |
21 | const MethodChannel _channel =
22 | const MethodChannel('bz.rxla.flutter/audio');
23 |
24 | /// A plugin for controlling the on device audio player.
25 | ///
26 | /// Due to the async nature of the native APIs, this plugin delegates all control
27 | /// methods to native without informing the caller of the state changes that happen
28 | /// as a result of these calls. The state changes are communicated via the
29 | /// [onPlayerStateChanged] stream instead so clients are expected to subscribe
30 | /// to this.
31 | class AudioPlayer {
32 | final StreamController _playerStateController =
33 | new StreamController.broadcast();
34 |
35 | final StreamController _positionController =
36 | new StreamController.broadcast();
37 |
38 | AudioPlayerState _state = AudioPlayerState.STOPPED;
39 | Duration _duration = const Duration();
40 |
41 | AudioPlayer() {
42 | _channel.setMethodCallHandler(_audioPlayerStateChange);
43 | }
44 |
45 | /// Play a given url.
46 | Future play(String url, {bool isLocal: false}) async =>
47 | await _channel.invokeMethod('play', {'url': url, 'isLocal': isLocal});
48 |
49 | /// Pause the currently playing stream.
50 | Future pause() async => await _channel.invokeMethod('pause');
51 |
52 | /// Stop the currently playing stream.
53 | Future stop() async => await _channel.invokeMethod('stop');
54 |
55 | /// Mute sound.
56 | Future mute(bool muted) async => await _channel.invokeMethod('mute', muted);
57 |
58 | /// Seek to a specific position in the audio stream.
59 | Future seek(double seconds) async => await _channel.invokeMethod('seek', seconds);
60 |
61 | /// Stream for subscribing to player state change events.
62 | Stream get onPlayerStateChanged => _playerStateController.stream;
63 |
64 | /// Reports what the player is currently doing.
65 | AudioPlayerState get state => _state;
66 |
67 | /// Reports the duration of the current media being played. It might return
68 | /// 0 if we have not determined the length of the media yet. It is best to
69 | /// call this from a state listener when the state has become
70 | /// [AudioPlayerState.PLAYING].
71 | Duration get duration => _duration;
72 |
73 | /// Stream for subscribing to audio position change events. Roughly fires
74 | /// every 200 milliseconds. Will continously update the position of the
75 | /// playback if the status is [AudioPlayerState.PLAYING].
76 | Stream get onAudioPositionChanged => _positionController.stream;
77 |
78 | Future _audioPlayerStateChange(MethodCall call) async {
79 | switch (call.method) {
80 | case "audio.onCurrentPosition":
81 | assert(_state == AudioPlayerState.PLAYING);
82 | _positionController.add(new Duration(milliseconds: call.arguments));
83 | break;
84 | case "audio.onStart":
85 | _state = AudioPlayerState.PLAYING;
86 | _playerStateController.add(AudioPlayerState.PLAYING);
87 | _duration = new Duration(milliseconds: call.arguments);
88 | break;
89 | case "audio.onPause":
90 | _state = AudioPlayerState.PAUSED;
91 | _playerStateController.add(AudioPlayerState.PAUSED);
92 | break;
93 | case "audio.onStop":
94 | _state = AudioPlayerState.STOPPED;
95 | _playerStateController.add(AudioPlayerState.STOPPED);
96 | break;
97 | case "audio.onComplete":
98 | _state = AudioPlayerState.COMPLETED;
99 | _playerStateController.add(AudioPlayerState.COMPLETED);
100 | break;
101 | case "audio.onError":
102 | // If there's an error, we assume the player has stopped.
103 | _state = AudioPlayerState.STOPPED;
104 | _playerStateController.addError(call.arguments);
105 | // to the client since each platform creates different error string
106 | // formats so we can't expect client to parse these.
107 | break;
108 | default:
109 | throw new ArgumentError('Unknown method ${call.method} ');
110 | }
111 | }
112 | }
--------------------------------------------------------------------------------
/lib/helpers/flutter_toast.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:flutter/services.dart';
4 |
5 | class FlutterToast {
6 | static const MethodChannel _channel = const MethodChannel('flutter_toast');
7 |
8 | static Future get platformVersion async {
9 | final String version = await _channel.invokeMethod('getPlatformVersion');
10 | return version;
11 | }
12 |
13 | static Future showToast(String msg) async {
14 | Map args = {};
15 | args.putIfAbsent("msg", () => msg);
16 | await _channel.invokeMethod('showToast', args);
17 | return null;
18 | }
19 | }
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'dart:ui' as ui;
2 | import 'dart:async';
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter/services.dart';
5 | import './flutterApp.dart';
6 |
7 | void main() => runApp(MyApp());
8 |
9 | class MyApp extends StatelessWidget {
10 | // This widget is the root of your application.
11 | @override
12 | Widget build(BuildContext context) {
13 | return MaterialApp(
14 | themeMode: ThemeMode.dark,
15 | title: 'Flutter Demo',
16 | theme: ThemeData(
17 | primarySwatch: Colors.blue,
18 | ),
19 | home: AnnotatedRegion(
20 | value: SystemUiOverlayStyle.dark,
21 | child: FlutterApp(),
22 | ),
23 | );
24 | }
25 | }
26 |
27 | class MyHomePage extends StatelessWidget {
28 | Widget build(BuildContext context) {
29 | Image image = new Image.network(
30 | 'https://timgsa.baidu.com/timg?image&quality=80&size=b10000_10000&sec=1564812422&di=a113f4b98d25442643ad9236f01ecbf5&src=http://hbimg.b0.upaiyun.com/0338cbe93580d5e6b0e89f25531541d455f66fda4a6a5-eVWQaf_fw658');
31 | Completer completer = new Completer();
32 | image.image.resolve(new ImageConfiguration()).addListener(
33 | ImageStreamListener(
34 | (ImageInfo info, bool _) => completer.complete(info.image)));
35 | return new Scaffold(
36 | appBar: new AppBar(
37 | title: new Text("Image Dimensions Example"),
38 | ),
39 | body: new ListView(
40 | children: [
41 | new FutureBuilder(
42 | future: completer.future,
43 | builder: (BuildContext context, AsyncSnapshot snapshot) {
44 | if (snapshot.hasData) {
45 | return new Text(
46 | '${snapshot.data.width}x${snapshot.data.height}',
47 | style: Theme.of(context).textTheme.body2,
48 | );
49 | } else {
50 | return new Text('Loading...');
51 | }
52 | },
53 | ),
54 | image,
55 | ],
56 | ),
57 | );
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/lib/routers/Animationted.dart:
--------------------------------------------------------------------------------
1 | import 'package:flare_flutter/provider/asset_flare.dart';
2 | import 'package:flutter/material.dart';
3 | import "package:flare_flutter/flare_actor.dart";
4 | import "package:flare_flutter/flare_cache_builder.dart";
5 | import 'package:flutter/services.dart';
6 |
7 | class Animationted extends StatefulWidget {
8 | @override
9 | _AnimationtedState createState() => _AnimationtedState();
10 | }
11 |
12 | class _AnimationtedState extends State {
13 | String _animationName = "idle";
14 | final asset = AssetFlare(bundle: rootBundle, name: "assets/Filip.flr");
15 | @override
16 | Widget build(BuildContext context) {
17 | return Scaffold(
18 | appBar: AppBar(
19 | title: Text('动画'),
20 | ),
21 | body: FlareCacheBuilder(
22 | [asset],
23 | builder: (BuildContext context, bool isWarm) {
24 | return !isWarm
25 | ? Container(child: Text("NO"))
26 | : FlareActor(
27 | "assets/Filip.flr",
28 | alignment: Alignment.center,
29 | fit: BoxFit.cover,
30 | animation: _animationName,
31 | );
32 | },
33 | ),
34 | );
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/lib/routers/AppLifecycleListen.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class AppLifecycleListen extends StatefulWidget {
4 | @override
5 | _AppLifecycleListenState createState() => _AppLifecycleListenState();
6 | }
7 |
8 | class _AppLifecycleListenState extends State
9 | with WidgetsBindingObserver {
10 | List _stateList = [];
11 | @override
12 | void initState() {
13 | super.initState();
14 | WidgetsBinding.instance.addObserver(this);
15 | }
16 |
17 | @override
18 | void dispose() {
19 | WidgetsBinding.instance.removeObserver(this);
20 | super.dispose();
21 | }
22 |
23 | @override
24 | void didChangeAppLifecycleState(AppLifecycleState state) {
25 | setState(() {
26 | _stateList.add('$state');
27 | });
28 | }
29 |
30 | Widget get _widget {
31 | if (_stateList.isEmpty) {
32 | return Center(
33 | child: Text(
34 | '将App切换到后台再返回App',
35 | style: Theme.of(context).textTheme.headline5,
36 | ),
37 | );
38 | }
39 | return ListView(
40 | children: _stateList
41 | .map((String value) => ListTile(
42 | title: Text(value, style: TextStyle(fontSize: 18.0)),
43 | ))
44 | .toList(),
45 | );
46 | }
47 |
48 | @override
49 | Widget build(BuildContext context) {
50 | return Scaffold(
51 | appBar: AppBar(
52 | centerTitle: true,
53 | title: Text('App状态监听'),
54 | ),
55 | body: _widget,
56 | );
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/lib/routers/AudioApp.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:audioplayers/audioplayers.dart';
3 |
4 | enum Status {
5 | playing,
6 | end,
7 | loading,
8 | pause,
9 | }
10 |
11 | class AudioApp extends StatefulWidget {
12 | const AudioApp();
13 | @override
14 | _AudioAppState createState() => _AudioAppState();
15 | }
16 |
17 | class _AudioAppState extends State {
18 | AudioPlayer audioPlayer = AudioPlayer();
19 | int _current = 0;
20 | Status _status = Status.pause;
21 |
22 | final List