├── .gitignore
├── .metadata
├── README.md
├── android
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── flutter_widgets
│ │ │ │ └── MainActivity.java
│ │ └── res
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── images
├── 1.png
├── 10.png
├── 2.png
├── 3.png
├── 4.png
├── 5.png
├── 6.png
├── 7.png
├── 8.png
├── 9.png
└── mic
│ ├── 1.png
│ ├── 10.png
│ ├── 11.png
│ ├── 12.png
│ ├── 13.png
│ ├── 14.png
│ ├── 15.png
│ ├── 16.png
│ ├── 2.png
│ ├── 3.png
│ ├── 4.png
│ ├── 5.png
│ ├── 6.png
│ ├── 7.png
│ ├── 8.png
│ └── 9.png
├── ios
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Podfile.lock
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-App-1024x1024@1x.png
│ │ ├── Icon-App-20x20@1x.png
│ │ ├── Icon-App-20x20@2x.png
│ │ ├── Icon-App-20x20@3x.png
│ │ ├── Icon-App-29x29@1x.png
│ │ ├── Icon-App-29x29@2x.png
│ │ ├── Icon-App-29x29@3x.png
│ │ ├── Icon-App-40x40@1x.png
│ │ ├── Icon-App-40x40@2x.png
│ │ ├── Icon-App-40x40@3x.png
│ │ ├── Icon-App-60x60@2x.png
│ │ ├── Icon-App-60x60@3x.png
│ │ ├── Icon-App-76x76@1x.png
│ │ ├── Icon-App-76x76@2x.png
│ │ └── Icon-App-83.5x83.5@2x.png
│ └── LaunchImage.imageset
│ │ ├── Contents.json
│ │ ├── LaunchImage.png
│ │ ├── LaunchImage@2x.png
│ │ ├── LaunchImage@3x.png
│ │ └── README.md
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ └── main.m
├── lib
├── DetailPage.dart
├── main.dart
├── models
│ ├── BsbdjData.dart
│ ├── HotModel.dart
│ ├── ListenModel.dart
│ ├── MusicDetailModel.dart
│ ├── WYNewsModel.dart
│ ├── WidgetJSON.dart
│ ├── dioDatas.dart
│ ├── musicDatas.dart
│ ├── post.dart
│ └── videoDatas.dart
├── route
│ ├── flutter_buttons.dart
│ ├── flutter_chips.dart
│ ├── flutter_dataTables.dart
│ ├── flutter_dialogs.dart
│ ├── flutter_dios.dart
│ ├── flutter_dios_detail.dart
│ ├── flutter_hots.dart
│ ├── flutter_interActives.dart
│ ├── flutter_listen_music.dart
│ ├── flutter_listen_music_detail.dart
│ ├── flutter_music_detail.dart
│ ├── flutter_musics.dart
│ ├── flutter_others.dart
│ ├── flutter_tuijians.dart
│ ├── flutter_videos.dart
│ ├── flutter_wynews.dart
│ └── flutter_wynews_detail.dart
├── tools
│ └── DioTool.dart
└── widgets
│ ├── MainColor.dart
│ ├── needle_anim.dart
│ └── record_anim.dart
├── pubspec.lock
├── pubspec.yaml
└── test
└── widget_test.dart
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # Visual Studio Code related
19 | .vscode/
20 |
21 | # Flutter/Dart/Pub related
22 | **/doc/api/
23 | .dart_tool/
24 | .flutter-plugins
25 | .packages
26 | .pub-cache/
27 | .pub/
28 | /build/
29 |
30 | # Android related
31 | **/android/**/gradle-wrapper.jar
32 | **/android/.gradle
33 | **/android/captures/
34 | **/android/gradlew
35 | **/android/gradlew.bat
36 | **/android/local.properties
37 | **/android/**/GeneratedPluginRegistrant.java
38 |
39 | # iOS/XCode related
40 | **/ios/**/*.mode1v3
41 | **/ios/**/*.mode2v3
42 | **/ios/**/*.moved-aside
43 | **/ios/**/*.pbxuser
44 | **/ios/**/*.perspectivev3
45 | **/ios/**/*sync/
46 | **/ios/**/.sconsign.dblite
47 | **/ios/**/.tags*
48 | **/ios/**/.vagrant/
49 | **/ios/**/DerivedData/
50 | **/ios/**/Icon?
51 | **/ios/**/Pods/
52 | **/ios/**/.symlinks/
53 | **/ios/**/profile
54 | **/ios/**/xcuserdata
55 | **/ios/.generated/
56 | **/ios/Flutter/App.framework
57 | **/ios/Flutter/Flutter.framework
58 | **/ios/Flutter/Generated.xcconfig
59 | **/ios/Flutter/app.flx
60 | **/ios/Flutter/app.zip
61 | **/ios/Flutter/flutter_assets/
62 | **/ios/ServiceDefinitions.json
63 | **/ios/Runner/GeneratedPluginRegistrant.*
64 |
65 | # Exceptions to above rules.
66 | !**/ios/**/default.mode1v3
67 | !**/ios/**/default.mode2v3
68 | !**/ios/**/default.pbxuser
69 | !**/ios/**/default.perspectivev3
70 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
71 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 8661d8aecd626f7f57ccbcb735553edc05a2e713
8 | channel: beta
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # flutter_widgets
2 |
3 | A new Flutter application.
4 |
5 | #### 内容涉及:
6 | ###### 1.基础界面的搭建,常见Widgets的使用;
7 | ###### 2.Dio网络请求、JSON Parse与数据渲染;
8 | ###### 3.下拉刷新与上拉加载更多;
9 | ###### 4.音视频播放;
10 | ###### 5. 其他;
11 |
12 | ## App兼容iOS与Android;
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 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26 |
27 | android {
28 | compileSdkVersion 28
29 |
30 | lintOptions {
31 | disable 'InvalidPackage'
32 | }
33 |
34 | defaultConfig {
35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
36 | applicationId "com.example.flutter_widgets"
37 | minSdkVersion 16
38 | targetSdkVersion 28
39 | versionCode flutterVersionCode.toInteger()
40 | versionName flutterVersionName
41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
42 | }
43 |
44 | buildTypes {
45 | release {
46 | // TODO: Add your own signing config for the release build.
47 | // Signing with the debug keys for now, so `flutter run --release` works.
48 | signingConfig signingConfigs.debug
49 | }
50 | }
51 | }
52 |
53 | flutter {
54 | source '../..'
55 | }
56 |
57 | dependencies {
58 | testImplementation 'junit:junit:4.12'
59 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
61 | }
62 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
9 |
13 |
20 |
24 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/example/flutter_widgets/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.flutter_widgets;
2 |
3 | import android.os.Bundle;
4 | import io.flutter.app.FlutterActivity;
5 | import io.flutter.plugins.GeneratedPluginRegistrant;
6 |
7 | public class MainActivity extends FlutterActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | GeneratedPluginRegistrant.registerWith(this);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/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 | repositories {
3 | google()
4 | jcenter()
5 | }
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:3.2.1'
9 | }
10 | }
11 |
12 | allprojects {
13 | repositories {
14 | google()
15 | jcenter()
16 | }
17 | }
18 |
19 | rootProject.buildDir = '../build'
20 | subprojects {
21 | project.buildDir = "${rootProject.buildDir}/${project.name}"
22 | }
23 | subprojects {
24 | project.evaluationDependsOn(':app')
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
7 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/images/ 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/ 1.png
--------------------------------------------------------------------------------
/images/ 10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/ 10.png
--------------------------------------------------------------------------------
/images/ 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/ 2.png
--------------------------------------------------------------------------------
/images/ 3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/ 3.png
--------------------------------------------------------------------------------
/images/ 4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/ 4.png
--------------------------------------------------------------------------------
/images/ 5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/ 5.png
--------------------------------------------------------------------------------
/images/ 6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/ 6.png
--------------------------------------------------------------------------------
/images/ 7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/ 7.png
--------------------------------------------------------------------------------
/images/ 8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/ 8.png
--------------------------------------------------------------------------------
/images/ 9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/ 9.png
--------------------------------------------------------------------------------
/images/mic/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/mic/1.png
--------------------------------------------------------------------------------
/images/mic/10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/mic/10.png
--------------------------------------------------------------------------------
/images/mic/11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/mic/11.png
--------------------------------------------------------------------------------
/images/mic/12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/mic/12.png
--------------------------------------------------------------------------------
/images/mic/13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/mic/13.png
--------------------------------------------------------------------------------
/images/mic/14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/mic/14.png
--------------------------------------------------------------------------------
/images/mic/15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/mic/15.png
--------------------------------------------------------------------------------
/images/mic/16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/mic/16.png
--------------------------------------------------------------------------------
/images/mic/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/mic/2.png
--------------------------------------------------------------------------------
/images/mic/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/mic/3.png
--------------------------------------------------------------------------------
/images/mic/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/mic/4.png
--------------------------------------------------------------------------------
/images/mic/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/mic/5.png
--------------------------------------------------------------------------------
/images/mic/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/mic/6.png
--------------------------------------------------------------------------------
/images/mic/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/mic/7.png
--------------------------------------------------------------------------------
/images/mic/8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/mic/8.png
--------------------------------------------------------------------------------
/images/mic/9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/images/mic/9.png
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def parse_KV_file(file, separator='=')
14 | file_abs_path = File.expand_path(file)
15 | if !File.exists? file_abs_path
16 | return [];
17 | end
18 | pods_ary = []
19 | skip_line_start_symbols = ["#", "/"]
20 | File.foreach(file_abs_path) { |line|
21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
22 | plugin = line.split(pattern=separator)
23 | if plugin.length == 2
24 | podname = plugin[0].strip()
25 | path = plugin[1].strip()
26 | podpath = File.expand_path("#{path}", file_abs_path)
27 | pods_ary.push({:name => podname, :path => podpath});
28 | else
29 | puts "Invalid plugin specification: #{line}"
30 | end
31 | }
32 | return pods_ary
33 | end
34 |
35 | target 'Runner' do
36 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
37 | # referring to absolute paths on developers' machines.
38 | system('rm -rf .symlinks')
39 | system('mkdir -p .symlinks/plugins')
40 |
41 | # Flutter Pods
42 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
43 | if generated_xcode_build_settings.empty?
44 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
45 | end
46 | generated_xcode_build_settings.map { |p|
47 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
48 | symlink = File.join('.symlinks', 'flutter')
49 | File.symlink(File.dirname(p[:path]), symlink)
50 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
51 | end
52 | }
53 |
54 | # Plugin Pods
55 | plugin_pods = parse_KV_file('../.flutter-plugins')
56 | plugin_pods.map { |p|
57 | symlink = File.join('.symlinks', 'plugins', p[:name])
58 | File.symlink(p[:path], symlink)
59 | pod p[:name], :path => File.join(symlink, 'ios')
60 | }
61 | end
62 |
63 | post_install do |installer|
64 | installer.pods_project.targets.each do |target|
65 | target.build_configurations.each do |config|
66 | config.build_settings['ENABLE_BITCODE'] = 'NO'
67 | end
68 | end
69 | end
70 |
--------------------------------------------------------------------------------
/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - audioplayer (0.0.1):
3 | - Flutter
4 | - Flutter (1.0.0)
5 | - flutter_webview_plugin (0.0.1):
6 | - Flutter
7 | - fluttertoast (0.0.2):
8 | - Flutter
9 | - video_player (0.0.1):
10 | - Flutter
11 |
12 | DEPENDENCIES:
13 | - audioplayer (from `.symlinks/plugins/audioplayer/ios`)
14 | - Flutter (from `.symlinks/flutter/ios`)
15 | - flutter_webview_plugin (from `.symlinks/plugins/flutter_webview_plugin/ios`)
16 | - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
17 | - video_player (from `.symlinks/plugins/video_player/ios`)
18 |
19 | EXTERNAL SOURCES:
20 | audioplayer:
21 | :path: ".symlinks/plugins/audioplayer/ios"
22 | Flutter:
23 | :path: ".symlinks/flutter/ios"
24 | flutter_webview_plugin:
25 | :path: ".symlinks/plugins/flutter_webview_plugin/ios"
26 | fluttertoast:
27 | :path: ".symlinks/plugins/fluttertoast/ios"
28 | video_player:
29 | :path: ".symlinks/plugins/video_player/ios"
30 |
31 | SPEC CHECKSUMS:
32 | audioplayer: 3cc64e4f5f3e231c715c8923a9bc26a19dc5da3b
33 | Flutter: 9d0fac939486c9aba2809b7982dfdbb47a7b0296
34 | flutter_webview_plugin: 116575b48572029304775b768e9f15ebfc316274
35 | fluttertoast: 0a20dcbbb8ecfd1a61b6285651ff2d5989d033fb
36 | video_player: 906796a841943c8d370ac7c13b18039aa9b56498
37 |
38 | PODFILE CHECKSUM: aff02bfeed411c636180d6812254b2daeea14d09
39 |
40 | COCOAPODS: 1.5.3
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 | 02153E679909923D31BCBD51 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78778FEA71F34EEC66983DC7 /* libPods-Runner.a */; };
11 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
18 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
19 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
20 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
21 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
22 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
23 | /* End PBXBuildFile section */
24 |
25 | /* Begin PBXCopyFilesBuildPhase section */
26 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
27 | isa = PBXCopyFilesBuildPhase;
28 | buildActionMask = 2147483647;
29 | dstPath = "";
30 | dstSubfolderSpec = 10;
31 | files = (
32 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
33 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
34 | );
35 | name = "Embed Frameworks";
36 | runOnlyForDeploymentPostprocessing = 0;
37 | };
38 | /* End PBXCopyFilesBuildPhase section */
39 |
40 | /* Begin PBXFileReference section */
41 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
42 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
43 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
44 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; };
45 | 78778FEA71F34EEC66983DC7 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
46 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
47 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
48 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
49 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
50 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
51 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; };
52 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
53 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
54 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
55 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
56 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
57 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
58 | /* End PBXFileReference section */
59 |
60 | /* Begin PBXFrameworksBuildPhase section */
61 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
62 | isa = PBXFrameworksBuildPhase;
63 | buildActionMask = 2147483647;
64 | files = (
65 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
66 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
67 | 02153E679909923D31BCBD51 /* libPods-Runner.a in Frameworks */,
68 | );
69 | runOnlyForDeploymentPostprocessing = 0;
70 | };
71 | /* End PBXFrameworksBuildPhase section */
72 |
73 | /* Begin PBXGroup section */
74 | 2001D60057F76DAD20E8196D /* Frameworks */ = {
75 | isa = PBXGroup;
76 | children = (
77 | 78778FEA71F34EEC66983DC7 /* libPods-Runner.a */,
78 | );
79 | name = Frameworks;
80 | sourceTree = "";
81 | };
82 | 9740EEB11CF90186004384FC /* Flutter */ = {
83 | isa = PBXGroup;
84 | children = (
85 | 3B80C3931E831B6300D905FE /* App.framework */,
86 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
87 | 9740EEBA1CF902C7004384FC /* Flutter.framework */,
88 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
89 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
90 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
91 | );
92 | name = Flutter;
93 | sourceTree = "";
94 | };
95 | 97C146E51CF9000F007C117D = {
96 | isa = PBXGroup;
97 | children = (
98 | 9740EEB11CF90186004384FC /* Flutter */,
99 | 97C146F01CF9000F007C117D /* Runner */,
100 | 97C146EF1CF9000F007C117D /* Products */,
101 | CB645C21AD5B11512F9D66C7 /* Pods */,
102 | 2001D60057F76DAD20E8196D /* Frameworks */,
103 | );
104 | sourceTree = "";
105 | };
106 | 97C146EF1CF9000F007C117D /* Products */ = {
107 | isa = PBXGroup;
108 | children = (
109 | 97C146EE1CF9000F007C117D /* Runner.app */,
110 | );
111 | name = Products;
112 | sourceTree = "";
113 | };
114 | 97C146F01CF9000F007C117D /* Runner */ = {
115 | isa = PBXGroup;
116 | children = (
117 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
118 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
119 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
120 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
121 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
122 | 97C147021CF9000F007C117D /* Info.plist */,
123 | 97C146F11CF9000F007C117D /* Supporting Files */,
124 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
125 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
126 | );
127 | path = Runner;
128 | sourceTree = "";
129 | };
130 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
131 | isa = PBXGroup;
132 | children = (
133 | 97C146F21CF9000F007C117D /* main.m */,
134 | );
135 | name = "Supporting Files";
136 | sourceTree = "";
137 | };
138 | CB645C21AD5B11512F9D66C7 /* Pods */ = {
139 | isa = PBXGroup;
140 | children = (
141 | );
142 | name = Pods;
143 | sourceTree = "";
144 | };
145 | /* End PBXGroup section */
146 |
147 | /* Begin PBXNativeTarget section */
148 | 97C146ED1CF9000F007C117D /* Runner */ = {
149 | isa = PBXNativeTarget;
150 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
151 | buildPhases = (
152 | 5341A6EFC2CDCF1B5F31713A /* [CP] Check Pods Manifest.lock */,
153 | 9740EEB61CF901F6004384FC /* Run Script */,
154 | 97C146EA1CF9000F007C117D /* Sources */,
155 | 97C146EB1CF9000F007C117D /* Frameworks */,
156 | 97C146EC1CF9000F007C117D /* Resources */,
157 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
158 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
159 | 0B876F6AE92B02CC78EB088F /* [CP] Embed Pods Frameworks */,
160 | );
161 | buildRules = (
162 | );
163 | dependencies = (
164 | );
165 | name = Runner;
166 | productName = Runner;
167 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
168 | productType = "com.apple.product-type.application";
169 | };
170 | /* End PBXNativeTarget section */
171 |
172 | /* Begin PBXProject section */
173 | 97C146E61CF9000F007C117D /* Project object */ = {
174 | isa = PBXProject;
175 | attributes = {
176 | LastUpgradeCheck = 0910;
177 | ORGANIZATIONNAME = "The Chromium Authors";
178 | TargetAttributes = {
179 | 97C146ED1CF9000F007C117D = {
180 | CreatedOnToolsVersion = 7.3.1;
181 | DevelopmentTeam = 2R8GD39REK;
182 | ProvisioningStyle = Manual;
183 | SystemCapabilities = {
184 | com.apple.BackgroundModes = {
185 | enabled = 1;
186 | };
187 | };
188 | };
189 | };
190 | };
191 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
192 | compatibilityVersion = "Xcode 3.2";
193 | developmentRegion = English;
194 | hasScannedForEncodings = 0;
195 | knownRegions = (
196 | English,
197 | en,
198 | Base,
199 | );
200 | mainGroup = 97C146E51CF9000F007C117D;
201 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
202 | projectDirPath = "";
203 | projectRoot = "";
204 | targets = (
205 | 97C146ED1CF9000F007C117D /* Runner */,
206 | );
207 | };
208 | /* End PBXProject section */
209 |
210 | /* Begin PBXResourcesBuildPhase section */
211 | 97C146EC1CF9000F007C117D /* Resources */ = {
212 | isa = PBXResourcesBuildPhase;
213 | buildActionMask = 2147483647;
214 | files = (
215 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
216 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
217 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
218 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
219 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
220 | );
221 | runOnlyForDeploymentPostprocessing = 0;
222 | };
223 | /* End PBXResourcesBuildPhase section */
224 |
225 | /* Begin PBXShellScriptBuildPhase section */
226 | 0B876F6AE92B02CC78EB088F /* [CP] Embed Pods Frameworks */ = {
227 | isa = PBXShellScriptBuildPhase;
228 | buildActionMask = 2147483647;
229 | files = (
230 | );
231 | inputPaths = (
232 | "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
233 | "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
234 | );
235 | name = "[CP] Embed Pods Frameworks";
236 | outputPaths = (
237 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
238 | );
239 | runOnlyForDeploymentPostprocessing = 0;
240 | shellPath = /bin/sh;
241 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
242 | showEnvVarsInLog = 0;
243 | };
244 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
245 | isa = PBXShellScriptBuildPhase;
246 | buildActionMask = 2147483647;
247 | files = (
248 | );
249 | inputPaths = (
250 | );
251 | name = "Thin Binary";
252 | outputPaths = (
253 | );
254 | runOnlyForDeploymentPostprocessing = 0;
255 | shellPath = /bin/sh;
256 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
257 | };
258 | 5341A6EFC2CDCF1B5F31713A /* [CP] Check Pods Manifest.lock */ = {
259 | isa = PBXShellScriptBuildPhase;
260 | buildActionMask = 2147483647;
261 | files = (
262 | );
263 | inputPaths = (
264 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
265 | "${PODS_ROOT}/Manifest.lock",
266 | );
267 | name = "[CP] Check Pods Manifest.lock";
268 | outputPaths = (
269 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
270 | );
271 | runOnlyForDeploymentPostprocessing = 0;
272 | shellPath = /bin/sh;
273 | 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";
274 | showEnvVarsInLog = 0;
275 | };
276 | 9740EEB61CF901F6004384FC /* Run Script */ = {
277 | isa = PBXShellScriptBuildPhase;
278 | buildActionMask = 2147483647;
279 | files = (
280 | );
281 | inputPaths = (
282 | );
283 | name = "Run Script";
284 | outputPaths = (
285 | );
286 | runOnlyForDeploymentPostprocessing = 0;
287 | shellPath = /bin/sh;
288 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
289 | };
290 | /* End PBXShellScriptBuildPhase section */
291 |
292 | /* Begin PBXSourcesBuildPhase section */
293 | 97C146EA1CF9000F007C117D /* Sources */ = {
294 | isa = PBXSourcesBuildPhase;
295 | buildActionMask = 2147483647;
296 | files = (
297 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
298 | 97C146F31CF9000F007C117D /* main.m in Sources */,
299 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
300 | );
301 | runOnlyForDeploymentPostprocessing = 0;
302 | };
303 | /* End PBXSourcesBuildPhase section */
304 |
305 | /* Begin PBXVariantGroup section */
306 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
307 | isa = PBXVariantGroup;
308 | children = (
309 | 97C146FB1CF9000F007C117D /* Base */,
310 | );
311 | name = Main.storyboard;
312 | sourceTree = "";
313 | };
314 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
315 | isa = PBXVariantGroup;
316 | children = (
317 | 97C147001CF9000F007C117D /* Base */,
318 | );
319 | name = LaunchScreen.storyboard;
320 | sourceTree = "";
321 | };
322 | /* End PBXVariantGroup section */
323 |
324 | /* Begin XCBuildConfiguration section */
325 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
326 | isa = XCBuildConfiguration;
327 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
328 | buildSettings = {
329 | ALWAYS_SEARCH_USER_PATHS = NO;
330 | CLANG_ANALYZER_NONNULL = YES;
331 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
332 | CLANG_CXX_LIBRARY = "libc++";
333 | CLANG_ENABLE_MODULES = YES;
334 | CLANG_ENABLE_OBJC_ARC = YES;
335 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
336 | CLANG_WARN_BOOL_CONVERSION = YES;
337 | CLANG_WARN_COMMA = YES;
338 | CLANG_WARN_CONSTANT_CONVERSION = YES;
339 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
340 | CLANG_WARN_EMPTY_BODY = YES;
341 | CLANG_WARN_ENUM_CONVERSION = YES;
342 | CLANG_WARN_INFINITE_RECURSION = YES;
343 | CLANG_WARN_INT_CONVERSION = YES;
344 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
345 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
346 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
347 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
348 | CLANG_WARN_STRICT_PROTOTYPES = YES;
349 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
350 | CLANG_WARN_UNREACHABLE_CODE = YES;
351 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
352 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
353 | COPY_PHASE_STRIP = NO;
354 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
355 | ENABLE_NS_ASSERTIONS = NO;
356 | ENABLE_STRICT_OBJC_MSGSEND = YES;
357 | GCC_C_LANGUAGE_STANDARD = gnu99;
358 | GCC_NO_COMMON_BLOCKS = YES;
359 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
360 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
361 | GCC_WARN_UNDECLARED_SELECTOR = YES;
362 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
363 | GCC_WARN_UNUSED_FUNCTION = YES;
364 | GCC_WARN_UNUSED_VARIABLE = YES;
365 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
366 | MTL_ENABLE_DEBUG_INFO = NO;
367 | SDKROOT = iphoneos;
368 | TARGETED_DEVICE_FAMILY = "1,2";
369 | VALIDATE_PRODUCT = YES;
370 | };
371 | name = Profile;
372 | };
373 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
374 | isa = XCBuildConfiguration;
375 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
376 | buildSettings = {
377 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
378 | CODE_SIGN_STYLE = Manual;
379 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
380 | DEVELOPMENT_TEAM = 2R8GD39REK;
381 | ENABLE_BITCODE = NO;
382 | FRAMEWORK_SEARCH_PATHS = (
383 | "$(inherited)",
384 | "$(PROJECT_DIR)/Flutter",
385 | );
386 | INFOPLIST_FILE = Runner/Info.plist;
387 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
388 | LIBRARY_SEARCH_PATHS = (
389 | "$(inherited)",
390 | "$(PROJECT_DIR)/Flutter",
391 | );
392 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterWidgets;
393 | PRODUCT_NAME = "$(TARGET_NAME)";
394 | PROVISIONING_PROFILE_SPECIFIER = devUse;
395 | VERSIONING_SYSTEM = "apple-generic";
396 | };
397 | name = Profile;
398 | };
399 | 97C147031CF9000F007C117D /* Debug */ = {
400 | isa = XCBuildConfiguration;
401 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
402 | buildSettings = {
403 | ALWAYS_SEARCH_USER_PATHS = NO;
404 | CLANG_ANALYZER_NONNULL = YES;
405 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
406 | CLANG_CXX_LIBRARY = "libc++";
407 | CLANG_ENABLE_MODULES = YES;
408 | CLANG_ENABLE_OBJC_ARC = YES;
409 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
410 | CLANG_WARN_BOOL_CONVERSION = YES;
411 | CLANG_WARN_COMMA = YES;
412 | CLANG_WARN_CONSTANT_CONVERSION = YES;
413 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
414 | CLANG_WARN_EMPTY_BODY = YES;
415 | CLANG_WARN_ENUM_CONVERSION = YES;
416 | CLANG_WARN_INFINITE_RECURSION = YES;
417 | CLANG_WARN_INT_CONVERSION = YES;
418 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
419 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
420 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
421 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
422 | CLANG_WARN_STRICT_PROTOTYPES = YES;
423 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
424 | CLANG_WARN_UNREACHABLE_CODE = YES;
425 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
426 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
427 | COPY_PHASE_STRIP = NO;
428 | DEBUG_INFORMATION_FORMAT = dwarf;
429 | ENABLE_STRICT_OBJC_MSGSEND = YES;
430 | ENABLE_TESTABILITY = YES;
431 | GCC_C_LANGUAGE_STANDARD = gnu99;
432 | GCC_DYNAMIC_NO_PIC = NO;
433 | GCC_NO_COMMON_BLOCKS = YES;
434 | GCC_OPTIMIZATION_LEVEL = 0;
435 | GCC_PREPROCESSOR_DEFINITIONS = (
436 | "DEBUG=1",
437 | "$(inherited)",
438 | );
439 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
440 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
441 | GCC_WARN_UNDECLARED_SELECTOR = YES;
442 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
443 | GCC_WARN_UNUSED_FUNCTION = YES;
444 | GCC_WARN_UNUSED_VARIABLE = YES;
445 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
446 | MTL_ENABLE_DEBUG_INFO = YES;
447 | ONLY_ACTIVE_ARCH = YES;
448 | SDKROOT = iphoneos;
449 | TARGETED_DEVICE_FAMILY = "1,2";
450 | };
451 | name = Debug;
452 | };
453 | 97C147041CF9000F007C117D /* Release */ = {
454 | isa = XCBuildConfiguration;
455 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
456 | buildSettings = {
457 | ALWAYS_SEARCH_USER_PATHS = NO;
458 | CLANG_ANALYZER_NONNULL = YES;
459 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
460 | CLANG_CXX_LIBRARY = "libc++";
461 | CLANG_ENABLE_MODULES = YES;
462 | CLANG_ENABLE_OBJC_ARC = YES;
463 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
464 | CLANG_WARN_BOOL_CONVERSION = YES;
465 | CLANG_WARN_COMMA = YES;
466 | CLANG_WARN_CONSTANT_CONVERSION = YES;
467 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
468 | CLANG_WARN_EMPTY_BODY = YES;
469 | CLANG_WARN_ENUM_CONVERSION = YES;
470 | CLANG_WARN_INFINITE_RECURSION = YES;
471 | CLANG_WARN_INT_CONVERSION = YES;
472 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
473 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
474 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
475 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
476 | CLANG_WARN_STRICT_PROTOTYPES = YES;
477 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
478 | CLANG_WARN_UNREACHABLE_CODE = YES;
479 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
480 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
481 | COPY_PHASE_STRIP = NO;
482 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
483 | ENABLE_NS_ASSERTIONS = NO;
484 | ENABLE_STRICT_OBJC_MSGSEND = YES;
485 | GCC_C_LANGUAGE_STANDARD = gnu99;
486 | GCC_NO_COMMON_BLOCKS = YES;
487 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
488 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
489 | GCC_WARN_UNDECLARED_SELECTOR = YES;
490 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
491 | GCC_WARN_UNUSED_FUNCTION = YES;
492 | GCC_WARN_UNUSED_VARIABLE = YES;
493 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
494 | MTL_ENABLE_DEBUG_INFO = NO;
495 | SDKROOT = iphoneos;
496 | TARGETED_DEVICE_FAMILY = "1,2";
497 | VALIDATE_PRODUCT = YES;
498 | };
499 | name = Release;
500 | };
501 | 97C147061CF9000F007C117D /* Debug */ = {
502 | isa = XCBuildConfiguration;
503 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
504 | buildSettings = {
505 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
506 | CODE_SIGN_STYLE = Manual;
507 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
508 | DEVELOPMENT_TEAM = 2R8GD39REK;
509 | ENABLE_BITCODE = NO;
510 | FRAMEWORK_SEARCH_PATHS = (
511 | "$(inherited)",
512 | "$(PROJECT_DIR)/Flutter",
513 | );
514 | INFOPLIST_FILE = Runner/Info.plist;
515 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
516 | LIBRARY_SEARCH_PATHS = (
517 | "$(inherited)",
518 | "$(PROJECT_DIR)/Flutter",
519 | );
520 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterWidgets;
521 | PRODUCT_NAME = "$(TARGET_NAME)";
522 | PROVISIONING_PROFILE_SPECIFIER = devUse;
523 | VERSIONING_SYSTEM = "apple-generic";
524 | };
525 | name = Debug;
526 | };
527 | 97C147071CF9000F007C117D /* Release */ = {
528 | isa = XCBuildConfiguration;
529 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
530 | buildSettings = {
531 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
532 | CODE_SIGN_STYLE = Manual;
533 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
534 | DEVELOPMENT_TEAM = 2R8GD39REK;
535 | ENABLE_BITCODE = NO;
536 | FRAMEWORK_SEARCH_PATHS = (
537 | "$(inherited)",
538 | "$(PROJECT_DIR)/Flutter",
539 | );
540 | INFOPLIST_FILE = Runner/Info.plist;
541 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
542 | LIBRARY_SEARCH_PATHS = (
543 | "$(inherited)",
544 | "$(PROJECT_DIR)/Flutter",
545 | );
546 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterWidgets;
547 | PRODUCT_NAME = "$(TARGET_NAME)";
548 | PROVISIONING_PROFILE_SPECIFIER = devUse;
549 | VERSIONING_SYSTEM = "apple-generic";
550 | };
551 | name = Release;
552 | };
553 | /* End XCBuildConfiguration section */
554 |
555 | /* Begin XCConfigurationList section */
556 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
557 | isa = XCConfigurationList;
558 | buildConfigurations = (
559 | 97C147031CF9000F007C117D /* Debug */,
560 | 97C147041CF9000F007C117D /* Release */,
561 | 249021D3217E4FDB00AE95B9 /* Profile */,
562 | );
563 | defaultConfigurationIsVisible = 0;
564 | defaultConfigurationName = Release;
565 | };
566 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
567 | isa = XCConfigurationList;
568 | buildConfigurations = (
569 | 97C147061CF9000F007C117D /* Debug */,
570 | 97C147071CF9000F007C117D /* Release */,
571 | 249021D4217E4FDB00AE95B9 /* Profile */,
572 | );
573 | defaultConfigurationIsVisible = 0;
574 | defaultConfigurationName = Release;
575 | };
576 | /* End XCConfigurationList section */
577 | };
578 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
579 | }
580 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | BuildSystemType
6 | Original
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #include "AppDelegate.h"
2 | #include "GeneratedPluginRegistrant.h"
3 | #import
4 | #import
5 | #import
6 |
7 | @interface AppDelegate()
8 | @property(nonatomic,strong)UIImagePickerController *imagePickerController;
9 | @end
10 |
11 | @implementation AppDelegate
12 |
13 | - (BOOL)application:(UIApplication *)application
14 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
15 | [GeneratedPluginRegistrant registerWithRegistry:self];
16 | [self initFlutterChannel];
17 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
18 | }
19 |
20 | -(void)initFlutterChannel{
21 |
22 | FlutterViewController * controller = (FlutterViewController *)self.window.rootViewController;
23 | FlutterMethodChannel * channel = [FlutterMethodChannel methodChannelWithName:@"flutter_widgets_demo" binaryMessenger:controller];
24 |
25 | __weak typeof (self)wSelf = self;
26 | [channel setMethodCallHandler:^(FlutterMethodCall * _Nonnull call, FlutterResult _Nonnull result) {
27 |
28 | if ([call.method isEqualToString:@"openLibrary"]) {
29 | //打开系统相机
30 | [wSelf openLibrary];
31 |
32 | }else{
33 | // @[FlutterMethodNotImplemented];
34 | }
35 | }];
36 |
37 | }
38 | -(UIImagePickerController *)imagePickerController{
39 | if (!_imagePickerController) {
40 |
41 | _imagePickerController = [[UIImagePickerController alloc] init];
42 | _imagePickerController.delegate = self;
43 | //跳转动画效果
44 | _imagePickerController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
45 | _imagePickerController.allowsEditing = YES;
46 | }
47 | return _imagePickerController;
48 | }
49 |
50 | -(void)openLibrary{
51 | UIAlertController *alertCtl =[[UIAlertController alloc]init];
52 |
53 | UIAlertAction *cancel =[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
54 | NSLog(@"cancel");
55 | }];
56 | UIAlertAction *xiangji =[UIAlertAction actionWithTitle:@"相机" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
57 | NSLog(@"xiangji");
58 |
59 | [self openCamera];
60 | }];
61 | UIAlertAction *xiangce =[UIAlertAction actionWithTitle:@"相册" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
62 | NSLog(@"xiangce");
63 |
64 | [self openPhotoLibrary];
65 | }];
66 |
67 | [alertCtl addAction:cancel];
68 | [alertCtl addAction:xiangji];
69 | [alertCtl addAction:xiangce];
70 |
71 | [self.window.rootViewController presentViewController:alertCtl animated:YES completion:nil];
72 |
73 |
74 | }
75 |
76 | /**
77 | * 调用照相机
78 | */
79 | -(void)openCamera{
80 |
81 | //判断是否可以打开照相机
82 | if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]){
83 | //摄像头
84 | self.imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
85 | [self.window.rootViewController presentViewController:self.imagePickerController animated:YES completion:nil];
86 | }
87 | else{
88 | NSLog(@"没有摄像头");
89 | }
90 | }
91 | /**
92 | * 打开相册
93 | */
94 | -(void)openPhotoLibrary{
95 |
96 | // 进入相册
97 | if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary])
98 | {
99 | self.imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
100 | [self.window.rootViewController presentViewController:self.imagePickerController animated:YES completion:^{
101 | NSLog(@"打开相册");
102 | }];
103 | }else{
104 | NSLog(@"不能打开相册");
105 | }
106 | }
107 | #pragma mark - UIImagePickerControllerDelegate
108 | // 拍照完成回调
109 | - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(nullable NSDictionary *)editingInfo NS_DEPRECATED_IOS(2_0, 3_0){
110 | [picker dismissViewControllerAnimated:YES completion:nil];
111 | }
112 |
113 | //进入拍摄页面点击取消按钮
114 | - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{
115 | [picker dismissViewControllerAnimated:YES completion:nil];
116 | }
117 |
118 | @end
119 |
120 |
121 |
122 |
123 |
--------------------------------------------------------------------------------
/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/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/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/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/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/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/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/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/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/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/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/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/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/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/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/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/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/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/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/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/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/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/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/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/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/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/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/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/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/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/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/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coder4why/flutter_widgets/e5222f588f99d119973813f84d195e017313e530/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | Google
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | flutter_widgets
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(FLUTTER_BUILD_NUMBER)
25 | LSRequiresIPhoneOS
26 |
27 | NSAppTransportSecurity
28 |
29 | NSAllowsArbitraryLoads
30 |
31 | NSExceptionDomains
32 |
33 | localhost
34 |
35 | NSExceptionAllowsInsecureHTTPLoads
36 |
37 |
38 |
39 |
40 | NSCameraUsageDescription
41 |
42 | NSPhotoLibraryUsageDescription
43 |
44 | UIBackgroundModes
45 |
46 | fetch
47 | remote-notification
48 |
49 | UILaunchStoryboardName
50 | LaunchScreen
51 | UIMainStoryboardFile
52 | Main
53 | UISupportedInterfaceOrientations
54 |
55 | UIInterfaceOrientationPortrait
56 | UIInterfaceOrientationLandscapeLeft
57 | UIInterfaceOrientationLandscapeRight
58 |
59 | UISupportedInterfaceOrientations~ipad
60 |
61 | UIInterfaceOrientationPortrait
62 | UIInterfaceOrientationPortraitUpsideDown
63 | UIInterfaceOrientationLandscapeLeft
64 | UIInterfaceOrientationLandscapeRight
65 |
66 | UIViewControllerBasedStatusBarAppearance
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/ios/Runner/main.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char* argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/lib/DetailPage.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'dart:convert';
3 | import 'package:http/http.dart' as http;
4 | import 'package:toast/toast.dart';
5 | import 'dart:math';
6 | import 'package:flutter_walkthrough/flutter_walkthrough.dart';
7 | import 'package:flutter_walkthrough/walkthrough.dart';
8 |
9 | class DetailPage extends StatefulWidget {
10 | //外部参数
11 | DetailPage(this.title);
12 |
13 | String title;
14 |
15 | @override
16 | _DetailPageState createState() => _DetailPageState();
17 | }
18 |
19 | class _DetailPageState extends State
20 | with SingleTickerProviderStateMixin {
21 | AnimationController _controller;
22 | var bsJSon;
23 | String imageUrl = '';
24 | final List list = [
25 | Walkthrough(
26 | title: "Title 1",
27 | content: "Content 1",
28 | imageIcon: Icons.restaurant_menu,
29 | ),
30 | Walkthrough(
31 | title: "Title 2",
32 | content: "Content 2",
33 | imageIcon: Icons.search,
34 | ),
35 | Walkthrough(
36 | title: "Title 3",
37 | content: "Content 3",
38 | imageIcon: Icons.shopping_cart,
39 | ),
40 | Walkthrough(
41 | title: "Title 4",
42 | content: "Content 4",
43 | imageIcon: Icons.verified_user,
44 | ),
45 | ];
46 |
47 | _loadDatas() async {
48 | //https://jsonplaceholder.typicode.com/posts
49 | // http://d.api.budejie.com/topic/list/zuixin/41/bs0315-ios-4.5.9/0-20.json
50 | String dataURL =
51 | "http://d.api.budejie.com/topic/list/zuixin/41/bs0315-ios-4.5.9/0-20.json";
52 | http.Response response = await http.get(dataURL);
53 | setState(() {
54 | bsJSon = json.decode(response.body);
55 | imageUrl = bsJSon['list'][Random().nextInt(19)]['video']['thumbnail'][0]
56 | .toString();
57 | });
58 |
59 | // _alertMegs(bsJSon['list'][Random().nextInt(19)]['video']['thumbnail'][0].toString());
60 | }
61 |
62 | _alertMegs(String text) {
63 | Toast.show(text, context,
64 | gravity: 0,
65 | backgroundRadius: 4,
66 | backgroundColor: Colors.black87,
67 | duration: 2);
68 | }
69 |
70 | @override
71 | void initState() {
72 | _controller = AnimationController(vsync: this);
73 | super.initState();
74 | _loadDatas();
75 | }
76 |
77 | @override
78 | void dispose() {
79 | _controller.dispose();
80 | super.dispose();
81 | }
82 |
83 | @override
84 | Widget build(BuildContext context) {
85 | return Material(
86 | child: Scaffold(
87 | appBar: AppBar(
88 | title: Text(widget.title, style: TextStyle(fontSize: 15.0)),
89 | ),
90 | body: Center(
91 | child: IntroScreen(list, null
92 | // new MaterialPageRoute(builder: (context) => null),
93 | ),
94 | // child: Column(
95 | // crossAxisAlignment: CrossAxisAlignment.center,
96 | // mainAxisAlignment: MainAxisAlignment.spaceEvenly,
97 | // children: [
98 | // Text(
99 | // widget.title,
100 | // style: TextStyle(fontSize: 20.0),
101 | // ),
102 | // ClipRRect(
103 | // borderRadius: BorderRadius.all(Radius.circular(10)),
104 | // child: Image.network(
105 | // imageUrl,
106 | // fit: BoxFit.fitWidth,
107 | // width: 250,
108 | // ),
109 | // )
110 | // ],
111 | // ),
112 | )),
113 | );
114 | }
115 | }
116 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'DetailPage.dart';
3 | import 'package:flutter_widgets/models/WidgetJSON.dart';
4 | import 'route/flutter_buttons.dart';
5 | import 'route/flutter_dialogs.dart';
6 | import 'route/flutter_chips.dart';
7 | import 'route/flutter_dataTables.dart';
8 | import 'route/flutter_others.dart';
9 | import 'route/flutter_interActives.dart';
10 | import 'route/flutter_dios.dart';
11 | import 'route/flutter_dios_detail.dart';
12 | import 'models/dioDatas.dart';
13 | import 'route/flutter_musics.dart';
14 | import 'route/flutter_music_detail.dart';
15 | import 'route/flutter_videos.dart';
16 | import 'package:flutter/services.dart';
17 | import 'route/flutter_tuijians.dart';
18 | import 'route/flutter_listen_music.dart';
19 | import 'route/flutter_listen_music_detail.dart';
20 | import 'route/flutter_wynews.dart';
21 | import 'route/flutter_wynews_detail.dart';
22 | void main() => runApp(MyApp());
23 | //
24 |
25 | Color themeColor = Colors.green;
26 |
27 | class MyApp extends StatelessWidget {
28 | static const MaterialColor blackColor =
29 | const MaterialColor(_redPrimaryValue, const {
30 | 200: const Color(0xFFE57373),
31 | 500: const Color(_redPrimaryValue),
32 | });
33 | static const int _redPrimaryValue = 0xFF333333;
34 |
35 | @override
36 | Widget build(BuildContext context) {
37 | return MaterialApp(
38 | title: 'Flutter Widgets',
39 | theme: ThemeData(
40 | // primarySwatch: blackColor,
41 | primaryColor: blackColor,
42 | ),
43 | debugShowCheckedModeBanner: true,
44 | home: MyHomePage(),
45 | //设置路由:
46 | routes: {
47 | 'DetailPage': (BuildContext context) => new DetailPage(''),
48 | 'FlutterButtons': (BuildContext context) => new FlutterButtons(),
49 | 'FlutterDiaglos': (BuildContext context) => new FlutterDiaglos(),
50 | 'FlutterChips': (BuildContext context) => new FlutterChips(),
51 | 'FlutterDataTables': (BuildContext context) => new FlutterDataTables(0),
52 | 'FlutterOthers': (BuildContext context) => new FlutterOthers(),
53 | 'InterActives': (BuildContext context) => new InterActives(0),
54 | 'DiosDetail': (BuildContext context) =>
55 | new DiosDetail(DioData('', '', '', '', '', '', '', '', '', '')),
56 | 'MusicPage': (BuildContext context) => new MusicPage(),
57 | 'MusicDetailPage': (BuildContext context) => new MusicDetailPage(null),
58 | 'VideoPage': (BuildContext context) => new VideoPage(),
59 | 'TuiJianPage': (BuildContext context) => new TuiJianDemo(false),
60 | 'ListenMusicDetailPage': (BuildContext context) => new ListenMusicDetailPage('','',),
61 | 'WYNewsDetailPage': (BuildContext context) =>new WYNewsDetailPage(null),
62 | },
63 | );
64 | }
65 | }
66 |
67 | class MyHomePage extends StatefulWidget {
68 | _MyHomePageState createState() => _MyHomePageState();
69 | }
70 |
71 | class _MyHomePageState extends State
72 | with SingleTickerProviderStateMixin {
73 | static TabController _tabController;
74 | int _currentIndex = 0;
75 |
76 | @override
77 | void initState() {
78 | super.initState();
79 | _tabController =
80 | new TabController(vsync: this, length: posts.length, initialIndex: 0);
81 | }
82 |
83 | @override
84 | void dispose() {
85 | _tabController.dispose();
86 | super.dispose();
87 | }
88 |
89 | _listItems(BuildContext context) {
90 | var listViews = new List();
91 | // var tabBarViews = new List();
92 | for (int x = 0; x < posts.length; x++) {
93 | var items = new List();
94 | if (x == 0) {
95 | items.add(DioWidgets());
96 | } else if(x==1){
97 | items.add(TuiJianDemo(true));
98 | } else if(x==2){
99 | items.add(WYNewsPage());
100 | } else {
101 | for (int i = 0; i < posts[x].widgets.length; i++) {
102 | items.add(
103 | GestureDetector(
104 | onTap: () => Navigator.of(context)
105 | .push(new MaterialPageRoute(builder: (context) {
106 | if (x == 7) {
107 | //交互模型
108 | return new InterActives(i);
109 | } else if (x == posts.length - 5) {
110 | return new FlutterButtons(); //按钮
111 | } else if (x == posts.length - 4) {
112 | return new FlutterDiaglos(); //对话框
113 | } else if (x == posts.length - 3) {
114 | return new FlutterChips(); //Chips
115 | } else if (x == posts.length - 2) {
116 | return new FlutterDataTables(i); //列表
117 | } else if (x == posts.length - 1) {
118 | return new FlutterOthers(); //其他
119 | } else {
120 | return new DetailPage(posts[x].widgets[i]); //详情
121 | }
122 | })),
123 | child: Container(
124 | color: Colors.black12,
125 | padding: EdgeInsets.only(left: 2, top: 10, bottom: 10),
126 | margin: EdgeInsets.all(10),
127 | child: Text(
128 | posts[x].widgets[i],
129 | style: TextStyle(fontSize: 17.0),
130 | ),
131 | )),
132 | );
133 | }
134 | }
135 | listViews.add(new ListView(
136 | children: items,
137 | ));
138 | }
139 | return listViews;
140 | }
141 |
142 | _listTiles() {
143 | var tiles = new List();
144 | var icons = [Icons.message, Icons.favorite, Icons.settings];
145 | var titles = ['听音乐', '看视频', '设置'];
146 | for (int i = 0; i < titles.length; i++) {
147 | tiles.add(ListTile(
148 | title: Text(
149 | titles[i],
150 | style: TextStyle(fontSize: 18),
151 | textAlign: TextAlign.left,
152 | ),
153 | trailing: Icon(icons[i], color: Colors.black12, size: 22.0),
154 | onTap: () { i==2?null:
155 | Navigator.of(context)
156 | .push(new MaterialPageRoute(builder: (context) {
157 | return i == 0 ? new MusicPage() : VideoPage();
158 | }));
159 | }));
160 | }
161 | return tiles;
162 | }
163 |
164 | _drawer() {
165 | return Drawer(
166 | child: ListView(
167 | padding: EdgeInsets.zero,
168 | children: [
169 | UserAccountsDrawerHeader(
170 | accountName:
171 | Text('Ds.Hpk', style: TextStyle(fontWeight: FontWeight.bold)),
172 | accountEmail: Text('https://gtihub.com/hupingkang'),
173 | currentAccountPicture: CircleAvatar(
174 | backgroundColor: Theme.of(context).primaryColor,
175 | backgroundImage: NetworkImage(
176 | 'https://gss3.bdstatic.com/7Po3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike116%2C5%2C5%2C116%2C38/sign=cec6b575a944ad343ab28fd5b1cb6791/d4628535e5dde711cf0a546eafefce1b9c166149.jpg'),
177 | ),
178 | decoration: BoxDecoration(
179 | // color: Colors.green[200],
180 | image: DecorationImage(
181 | image: NetworkImage(
182 | 'https://gss2.bdstatic.com/-fo3dSag_xI4khGkpoWK1HF6hhy/baike/h%3D250/sign=65c54448c4ea15ce5eeee70c86023a25/fcfaaf51f3deb48feaaa8b13fd1f3a292cf5783f.jpg'),
183 | fit: BoxFit.cover,
184 | colorFilter: ColorFilter.mode(
185 | Theme.of(context).primaryColor, BlendMode.hardLight),
186 | ),
187 | ),
188 | ),
189 | _listTiles()[0],
190 | _listTiles()[1],
191 | _listTiles()[2]
192 | ],
193 | ),
194 | );
195 | }
196 |
197 | _appBars() {
198 | var style = TextStyle(fontSize: 18.0, color: Colors.white);
199 | var items = new List();
200 | for (int i = 0; i < posts.length; i++) {
201 | items.add(new Tab(
202 | icon: Text(
203 | posts[i].title,
204 | style: style,
205 | ),
206 | ));
207 | }
208 | return new TabBar(
209 | tabs: items,
210 | indicatorColor: Colors.white,
211 | indicatorSize: TabBarIndicatorSize.label,
212 | isScrollable: true,
213 | controller: _tabController,
214 | );
215 | }
216 |
217 | //调用原生方法:打开系统相机和相册;
218 | _openLibrary() {
219 | MethodChannel channel = MethodChannel('flutter_widgets_demo');
220 | channel.invokeMethod('openLibrary');
221 | }
222 |
223 | _appBar(BuildContext context) {
224 | return new DefaultTabController(
225 | length: posts.length,
226 | child: Scaffold(
227 | floatingActionButton: _currentIndex == 1
228 | ? null
229 | : FloatingActionButton(
230 | backgroundColor: Theme.of(context).primaryColor,
231 | onPressed: _openLibrary,
232 | child: Icon(
233 | Icons.camera,
234 | color: Colors.white,
235 | ),
236 | ),
237 | drawer: _currentIndex == 1 ? null : _drawer(),
238 | appBar: _currentIndex == 1
239 | ? null
240 | : AppBar(
241 | title: _appBars() //Text('Flutter Widgets Use'),
242 | // bottom: ,
243 | ),
244 | body: _currentIndex == 1
245 | ? ListenMusicPage()
246 | : new TabBarView(
247 | children: _listItems(context),
248 | controller: _tabController,
249 | ),
250 | bottomNavigationBar: BottomNavigationBar(
251 | items: [
252 | BottomNavigationBarItem(
253 | icon: Icon(Icons.home), title: Text('首页')),
254 | BottomNavigationBarItem(
255 | icon: Icon(Icons.library_music), title: Text('听歌'))
256 | ],
257 | // fixedColor: Colors.red,
258 | type: BottomNavigationBarType.fixed,
259 | currentIndex: _currentIndex,
260 | onTap: (index) {
261 | setState(() {
262 | _currentIndex = index;
263 | });
264 | },
265 | ),
266 | ));
267 | }
268 |
269 | @override
270 | Widget build(BuildContext context) {
271 | return _appBar(context);
272 | }
273 | }
274 |
--------------------------------------------------------------------------------
/lib/models/BsbdjData.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'dart:convert';
3 |
4 | class Meida {
5 | final List list;
6 |
7 | Meida(this.list);
8 |
9 | Meida.fromJson(Map json)
10 | : list = json['list'];
11 |
12 | Map toJson() =>
13 | {
14 | 'list': list,
15 | };
16 |
17 | }
18 |
19 | class MediaModel {
20 | final List tags;
21 | MediaModel(this.tags);
22 |
23 | }
24 |
25 |
26 | class TagModel {
27 | final String name;
28 | final String image_list;
29 |
30 | TagModel(this.name,this.image_list);
31 |
32 | }
--------------------------------------------------------------------------------
/lib/models/HotModel.dart:
--------------------------------------------------------------------------------
1 |
2 | import '../tools/DioTool.dart';
3 |
4 | class HotModel {
5 | // type=text : 文字
6 | // type=image : 图片
7 | // type=gif : Gif
8 | // type=video: 视频
9 | String type;
10 | String text;
11 | String username;
12 | String uid;
13 |
14 | String header;
15 | String comment;
16 | String top_commentsVoiceuri;
17 | String top_commentsContent;
18 |
19 | String top_commentsHeader;
20 | String top_commentsName;
21 | String passtime;
22 | String soureid;
23 |
24 | String up;
25 | String down;
26 | String forward;
27 | String image;
28 |
29 | String gif;
30 | String thumbnail;
31 | String video;
32 |
33 | HotModel(
34 | this.type,
35 | this.text,
36 | this.username,
37 | this.uid,
38 | this.header,
39 | this.comment,
40 | this.top_commentsVoiceuri,
41 | this.top_commentsContent,
42 | this.passtime,
43 | this.soureid,
44 | this.up,
45 | this.down,
46 | this.forward,
47 | this.image,
48 | this.gif,
49 | this.thumbnail,
50 | this.video,
51 | );
52 |
53 | static Future> getHotModels() async {
54 |
55 | Map response = await DioTool.get('https://www.apiopen.top/satinGodApi?type=1&page=1');
56 | return jsonToModel(response);
57 | }
58 |
59 |
60 | static List jsonToModel(Map repsonse) {
61 | List datas = new List();
62 | List result = repsonse['data'];
63 | for (int i = 0; i < result.length; i++) {
64 | Map rowData = result[i];
65 | HotModel dataModel = new HotModel(
66 | rowData['type'].toString(),
67 | rowData['text'],
68 | rowData['username'],
69 | rowData['uid'],
70 | rowData['header'],
71 | rowData['comment'].toString(),
72 | rowData['top_commentsVoiceuri'],
73 | rowData['top_commentsContent'],
74 | rowData['passtime'],
75 | rowData['soureid'].toString(),
76 | rowData['up'].toString(),
77 | rowData['down'].toString(),
78 | rowData['forward'].toString(),
79 | rowData['image'],
80 | rowData['gif'],
81 | rowData['thumbnail'],
82 | rowData['video'],
83 | );
84 |
85 | datas.add(dataModel);
86 | }
87 |
88 | return datas;
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/lib/models/ListenModel.dart:
--------------------------------------------------------------------------------
1 | import '../tools/DioTool.dart';
2 | class ListenModel{
3 |
4 | // https://api.apiopen.top/musicRankings
5 | String pic_s210;
6 | String bg_pic;
7 | String pic_s444;
8 |
9 | String count;
10 | String type;
11 | List content;
12 | String name;
13 |
14 | String comment;
15 | String pic_s192;
16 | String pic_s260;
17 |
18 | ListenModel(this.pic_s210,
19 | this.bg_pic,
20 | this.pic_s444,
21 | this.count,
22 | this.type,
23 | this.content,
24 | this.name,
25 | this.comment,
26 | this.pic_s192,
27 | this.pic_s260,
28 | );
29 |
30 | static Future> getMusics() async {
31 | // https://api.apiopen.top/musicRankings
32 | Map response = await DioTool.get('https://api.apiopen.top/musicRankings');
33 | return ListenModel.jsonToModel(response);
34 | }
35 |
36 | static List jsonToModel(Map repsonse) {
37 | List datas = new List();
38 | List result = repsonse['result'];
39 | for (int i = 0; i < result.length; i++) {
40 | Map rowData = result[i];
41 | List