├── README.md ├── android ├── app │ ├── build.gradle │ ├── release │ │ ├── app-release.apk │ │ └── output.json │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── wx │ │ │ │ └── mung_flutter │ │ │ │ └── MainActivity.java │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── icon_splash.png │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── keystore │ └── keystore.jks └── settings.gradle ├── ios ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Images.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-120.png │ │ ├── Icon-121.png │ │ ├── Icon-180.png │ │ ├── Icon-40.png │ │ ├── Icon-58.png │ │ ├── Icon-60.png │ │ ├── Icon-80.png │ │ └── Icon-87.png │ ├── Contents.json │ └── LaunchImage.launchimage │ │ ├── Contents.json │ │ ├── icon_spash1125-2436.png │ │ ├── icon_spash1242-2209 2.png │ │ ├── icon_spash1242-2209.png │ │ ├── icon_spash1242-2210.png │ │ ├── icon_spash640-1136.png │ │ ├── icon_spash640-960.png │ │ └── icon_spash750-1334.png ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Images.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-120.png │ │ ├── Icon-121.png │ │ ├── Icon-180.png │ │ ├── Icon-40.png │ │ ├── Icon-58.png │ │ ├── Icon-60.png │ │ ├── Icon-80.png │ │ └── Icon-87.png │ ├── Contents.json │ └── LaunchImage.launchimage │ │ ├── Contents.json │ │ ├── icon_spash1242-2208 2.png │ │ ├── icon_spash1242-2208.png │ │ ├── icon_spash1242-2209.png │ │ ├── icon_spash640-1136.png │ │ ├── icon_spash640-960.png │ │ ├── icon_spash750-1334.png │ │ └── icon_spash750-1335.png │ ├── Info.plist │ ├── main.m │ └── splash.png ├── lib ├── bloc │ └── theme_bloc.dart ├── data │ ├── const │ │ └── constant.dart │ ├── img │ │ └── iconfont.ttf │ └── net │ │ ├── http_base.dart │ │ └── http_movie.dart ├── main.dart ├── model │ ├── detail_base_model.dart │ ├── discuss_model.dart │ ├── hot_model.dart │ ├── list_model.dart │ ├── loading_state.dart │ └── stills_model.dart ├── pages │ ├── detail_page.dart │ ├── list_page.dart │ ├── main_page.dart │ ├── photo_detail_page.dart │ ├── search_page.dart │ └── theme_page.dart ├── style │ ├── base_style.dart │ └── colors.dart ├── utils │ ├── route_util.dart │ ├── sp_util.dart │ └── ui_util.dart └── widget │ ├── loading_footer_widget.dart │ └── loading_widget.dart ├── pubspec.lock ├── pubspec.yaml └── test └── widget_test.dart /README.md: -------------------------------------------------------------------------------- 1 | ## [React版Mung](https://github.com/mochixuan/Mung-React) 2 | ## [React-Native版Mung](https://github.com/mochixuan/Mung) 3 | ## [Flutter版Mung](https://github.com/mochixuan/Mung-Flutter) 4 | 5 | # Mung-Flutter 6 | 7 | ### 1. Mung-Flutter:是一个基于Flutter编写,使用豆瓣开源API开发的一个项目。 8 | 9 | ![image](https://github.com/mochixuan/Mung/blob/master/Ui/ui/ic_launcher.png?raw=true) 10 | 11 | ### 2. 功能概述 12 | 13 | - **启动页**:添加了启动页主要是让最开始进入时不至于显示白屏。 14 | - **数据保存** :支持断网加载缓存数据。 15 | - **主题换肤** :现在只支持切换主题颜色,本项目没几张图片。 16 | - **查看电影详情** :支持查看电影详情包括评论。 17 | - **一键搜索**: 支持标签和语句查找相关的电影。 18 | - **查看剧照**: 支持缩放图片。 19 | - **适配iphonx及以上**:适配了IphoneX及以上的头部和底部的安全区域问题。 20 | 21 | ### 3.1 动态演示(Android版) 22 | ![](https://user-gold-cdn.xitu.io/2019/5/22/16add3b749fe8761?w=240&h=400&f=gif&s=4173548) 23 | 24 | ### 3.2 运行结果图 25 | 26 | ![image](https://github.com/mochixuan/Mung/blob/master/Ui/ppt/icon_ppt1.png?raw=true) 27 | ![image](https://github.com/mochixuan/Mung/blob/master/Ui/ppt/icon_ppt2.png?raw=true) 28 | 29 | ### 4. 使用到的框架 30 | 31 | - **flutter_swiper** :Banner栏图片轮播的效果。 32 | - **rxdart** :和Rxjava、RxJs、RxSwift差不多,这里主要用它的BehaviorSubject配合Bloc模式实现状态管理。 33 | - **shared_preferences** :简单的数据保存,比较细致的数据存储如列表等还是建议使用数据库。 34 | - **dio** :实现网络请求,一个非常不错的三方网络包,功能非常多,如果刚入门或者项目比较急建议使用这个。 35 | - **flutter_spinkit** : 加载时显示的加载组件,挺不错,建议看下。 36 | - **photo_view**: 图片缩放组件,因为安卓里的photoview正好选了,使用了一个简单的功能,暂时没发现问题。 37 | 38 | ### 5. 项目全局状态管理 39 | 现在据我了解的比较成熟的状态管理有。 40 | 41 | - 1. InheritedWidget(自带的其他三方好像都是基于它开发,只是封装了下,更加方便) 42 | - 2. scoped_model: 不错。 43 | - 3. redux和前端的redux是一个意思,但我写过demo用过,个人愚见:差远了。 44 | - 4. Bloc:(Business Logic Component)paolo soares 和 cong hui 在2018年Google dartconf上提出的,它其实是一个模式InheritedWidget+stream配合使用。 45 | 46 | 本项目使用的就是Bloc。 47 | 48 | ### 6. 思考 49 | 这个开发的第一个flutter,都有这个项目来说该用的主流框架都恰到好处的用了,因为项目太小,适合入门和快速开发。对于flutter个人感觉。 50 | 51 | - 1. 上个月看了一个消息Flutter团队好像在今年不会推出热更新功能,好像是基于安全和可实现性考虑,这里要说下flutter编译模式: 开发阶段使用的是 Kernel Snapshot 模式编译,生产模式使用AOT。 52 | - 2. flutter上月好像推出了web端和桌面的适配,这个应该对flutter发展有很大帮助。 53 | - 3. 我之前一年多一直使用React-Native开发项目,感觉Flutter的组件比RN多,而且多很多,组件兼容性更好,而且更精致,但是嵌套的模式真心丑,而且巨乱,我开发时把组件拆分成多个函数这样会让界面清新一点。 54 | - 4. 状态管理,暂时还没有一个绝对好的状态管理功能,现在有些项目使用bloc或者bloc+redux,但个人认为不久的将来会有一个好的状态管理功能占据绝对的地址,想RN的redux、mobx一样。 55 | - 5. 组件生命周期函数很少,尤其是开发大型项目时,之前使用RN开发时就觉得RN比原生安卓生命周期少,自己还得去添加全局监听去管理生命周期,flutter就更少了。 56 | - 6. 性能,应该flutter,网上一大堆对比文章一番一大把,个人使用也明显感觉到flutter性能很好,这是现实原理的问题,尤其是列表,比fRN好很多,而且动画等也多,自定义组件还没看,不做评价。 57 | - 7. 社区,毫无疑问RN社区会比Flutter对于现在这个时间段来说,而且RN支持热更新对原生加(RN、Flutter)来说,RN也更站优势,三方组件来说RN已经很多了,开源项目比较多。 58 | 59 | ### 7. 提示 60 | 2019-5-12左右豆瓣把开源API关了,现在使用的别的开发者的地址,项目Baser_url是抽出来的后期可以自己改,现在项目使用的是https://douban.uieee.com/v2,可以正常运行。 61 | 62 | ### 8.下载地址 63 | - [安卓版](https://fir.im/mungflutter) 64 | - ios版(没有企业账号-😊) 65 | -------------------------------------------------------------------------------- /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.wx.mung_flutter" 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/release/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/android/app/release/app-release.apk -------------------------------------------------------------------------------- /android/app/release/output.json: -------------------------------------------------------------------------------- 1 | [{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 10 | 17 | 21 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/wx/mung_flutter/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.wx.mung_flutter; 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 | 8 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/icon_splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/android/app/src/main/res/mipmap-xxhdpi/icon_splash.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/keystore/keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/android/keystore/keystore.jks -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-40.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-60.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-58.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-87.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-80.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-120.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-121.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-180.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "idiom" : "ios-marketing", 53 | "size" : "1024x1024", 54 | "scale" : "1x" 55 | } 56 | ], 57 | "info" : { 58 | "version" : 1, 59 | "author" : "xcode" 60 | } 61 | } -------------------------------------------------------------------------------- /ios/Images.xcassets/AppIcon.appiconset/Icon-120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Images.xcassets/AppIcon.appiconset/Icon-120.png -------------------------------------------------------------------------------- /ios/Images.xcassets/AppIcon.appiconset/Icon-121.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Images.xcassets/AppIcon.appiconset/Icon-121.png -------------------------------------------------------------------------------- /ios/Images.xcassets/AppIcon.appiconset/Icon-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Images.xcassets/AppIcon.appiconset/Icon-180.png -------------------------------------------------------------------------------- /ios/Images.xcassets/AppIcon.appiconset/Icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Images.xcassets/AppIcon.appiconset/Icon-40.png -------------------------------------------------------------------------------- /ios/Images.xcassets/AppIcon.appiconset/Icon-58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Images.xcassets/AppIcon.appiconset/Icon-58.png -------------------------------------------------------------------------------- /ios/Images.xcassets/AppIcon.appiconset/Icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Images.xcassets/AppIcon.appiconset/Icon-60.png -------------------------------------------------------------------------------- /ios/Images.xcassets/AppIcon.appiconset/Icon-80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Images.xcassets/AppIcon.appiconset/Icon-80.png -------------------------------------------------------------------------------- /ios/Images.xcassets/AppIcon.appiconset/Icon-87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Images.xcassets/AppIcon.appiconset/Icon-87.png -------------------------------------------------------------------------------- /ios/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ios/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "12.0", 8 | "subtype" : "2688h", 9 | "scale" : "3x" 10 | }, 11 | { 12 | "orientation" : "portrait", 13 | "idiom" : "iphone", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "12.0", 16 | "subtype" : "1792h", 17 | "scale" : "2x" 18 | }, 19 | { 20 | "orientation" : "portrait", 21 | "idiom" : "iphone", 22 | "extent" : "full-screen", 23 | "minimum-system-version" : "11.0", 24 | "subtype" : "2436h", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "orientation" : "portrait", 29 | "idiom" : "iphone", 30 | "extent" : "full-screen", 31 | "minimum-system-version" : "8.0", 32 | "subtype" : "736h", 33 | "scale" : "3x" 34 | }, 35 | { 36 | "orientation" : "portrait", 37 | "idiom" : "iphone", 38 | "extent" : "full-screen", 39 | "minimum-system-version" : "8.0", 40 | "subtype" : "667h", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "orientation" : "portrait", 45 | "idiom" : "iphone", 46 | "filename" : "icon_spash640-960.png", 47 | "extent" : "full-screen", 48 | "minimum-system-version" : "7.0", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "extent" : "full-screen", 53 | "idiom" : "iphone", 54 | "subtype" : "retina4", 55 | "filename" : "icon_spash640-1136.png", 56 | "minimum-system-version" : "7.0", 57 | "orientation" : "portrait", 58 | "scale" : "2x" 59 | }, 60 | { 61 | "extent" : "full-screen", 62 | "idiom" : "iphone", 63 | "subtype" : "2688h", 64 | "filename" : "icon_spash1242-2210.png", 65 | "minimum-system-version" : "12.0", 66 | "orientation" : "portrait", 67 | "unassigned" : true, 68 | "scale" : "3x" 69 | }, 70 | { 71 | "extent" : "full-screen", 72 | "idiom" : "iphone", 73 | "subtype" : "1792h", 74 | "filename" : "icon_spash1242-2209 2.png", 75 | "minimum-system-version" : "12.0", 76 | "orientation" : "portrait", 77 | "unassigned" : true, 78 | "scale" : "2x" 79 | }, 80 | { 81 | "extent" : "full-screen", 82 | "idiom" : "iphone", 83 | "subtype" : "2436h", 84 | "filename" : "icon_spash1125-2436.png", 85 | "minimum-system-version" : "11.0", 86 | "orientation" : "portrait", 87 | "unassigned" : true, 88 | "scale" : "3x" 89 | }, 90 | { 91 | "extent" : "full-screen", 92 | "idiom" : "iphone", 93 | "subtype" : "736h", 94 | "filename" : "icon_spash1242-2209.png", 95 | "minimum-system-version" : "8.0", 96 | "orientation" : "portrait", 97 | "unassigned" : true, 98 | "scale" : "3x" 99 | }, 100 | { 101 | "extent" : "full-screen", 102 | "idiom" : "iphone", 103 | "subtype" : "667h", 104 | "filename" : "icon_spash750-1334.png", 105 | "minimum-system-version" : "8.0", 106 | "orientation" : "portrait", 107 | "unassigned" : true, 108 | "scale" : "2x" 109 | } 110 | ], 111 | "info" : { 112 | "version" : 1, 113 | "author" : "xcode" 114 | } 115 | } -------------------------------------------------------------------------------- /ios/Images.xcassets/LaunchImage.launchimage/icon_spash1125-2436.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Images.xcassets/LaunchImage.launchimage/icon_spash1125-2436.png -------------------------------------------------------------------------------- /ios/Images.xcassets/LaunchImage.launchimage/icon_spash1242-2209 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Images.xcassets/LaunchImage.launchimage/icon_spash1242-2209 2.png -------------------------------------------------------------------------------- /ios/Images.xcassets/LaunchImage.launchimage/icon_spash1242-2209.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Images.xcassets/LaunchImage.launchimage/icon_spash1242-2209.png -------------------------------------------------------------------------------- /ios/Images.xcassets/LaunchImage.launchimage/icon_spash1242-2210.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Images.xcassets/LaunchImage.launchimage/icon_spash1242-2210.png -------------------------------------------------------------------------------- /ios/Images.xcassets/LaunchImage.launchimage/icon_spash640-1136.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Images.xcassets/LaunchImage.launchimage/icon_spash640-1136.png -------------------------------------------------------------------------------- /ios/Images.xcassets/LaunchImage.launchimage/icon_spash640-960.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Images.xcassets/LaunchImage.launchimage/icon_spash640-960.png -------------------------------------------------------------------------------- /ios/Images.xcassets/LaunchImage.launchimage/icon_spash750-1334.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Images.xcassets/LaunchImage.launchimage/icon_spash750-1334.png -------------------------------------------------------------------------------- /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 | - Flutter (1.0.0) 3 | - shared_preferences (0.0.1): 4 | - Flutter 5 | 6 | DEPENDENCIES: 7 | - Flutter (from `.symlinks/flutter/ios`) 8 | - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) 9 | 10 | EXTERNAL SOURCES: 11 | Flutter: 12 | :path: ".symlinks/flutter/ios" 13 | shared_preferences: 14 | :path: ".symlinks/plugins/shared_preferences/ios" 15 | 16 | SPEC CHECKSUMS: 17 | Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a 18 | shared_preferences: 1feebfa37bb57264736e16865e7ffae7fc99b523 19 | 20 | PODFILE CHECKSUM: aff02bfeed411c636180d6812254b2daeea14d09 21 | 22 | COCOAPODS: 1.6.1 23 | -------------------------------------------------------------------------------- /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 | 10CD00252285721500F9FE78 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 10CD00242285721500F9FE78 /* Images.xcassets */; }; 11 | 10FB784B228A46130081E413 /* splash.png in Resources */ = {isa = PBXBuildFile; fileRef = 10FB784A228A46130081E413 /* splash.png */; }; 12 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 13 | 2EA3F4F1669A4C6DE181EECA /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A97C91E8EA998E1D2B44CF33 /* libPods-Runner.a */; }; 14 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 15 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 16 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 18 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 19 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 20 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 21 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 22 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 23 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXCopyFilesBuildPhase section */ 27 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 28 | isa = PBXCopyFilesBuildPhase; 29 | buildActionMask = 2147483647; 30 | dstPath = ""; 31 | dstSubfolderSpec = 10; 32 | files = ( 33 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 34 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 35 | ); 36 | name = "Embed Frameworks"; 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXCopyFilesBuildPhase section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 10CD00242285721500F9FE78 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 43 | 10FB784A228A46130081E413 /* splash.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = splash.png; sourceTree = ""; }; 44 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 45 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 46 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 47 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 48 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 49 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 50 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 51 | 7B7F968EFD88A7BA0BB0B71C /* 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 = ""; }; 52 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 53 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 54 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 55 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 57 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 58 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 59 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 60 | A4A17D4EB10F5A6917993FE0 /* 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 = ""; }; 61 | A97C91E8EA998E1D2B44CF33 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 62 | B327EBD572D78911CC2A7489 /* 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 = ""; }; 63 | /* End PBXFileReference section */ 64 | 65 | /* Begin PBXFrameworksBuildPhase section */ 66 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 71 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 72 | 2EA3F4F1669A4C6DE181EECA /* libPods-Runner.a in Frameworks */, 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | /* End PBXFrameworksBuildPhase section */ 77 | 78 | /* Begin PBXGroup section */ 79 | 39E61A4217410A44DCAE04E5 /* Pods */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | A4A17D4EB10F5A6917993FE0 /* Pods-Runner.debug.xcconfig */, 83 | 7B7F968EFD88A7BA0BB0B71C /* Pods-Runner.release.xcconfig */, 84 | B327EBD572D78911CC2A7489 /* Pods-Runner.profile.xcconfig */, 85 | ); 86 | path = Pods; 87 | sourceTree = ""; 88 | }; 89 | 9740EEB11CF90186004384FC /* Flutter */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | 3B80C3931E831B6300D905FE /* App.framework */, 93 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 94 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 95 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 96 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 97 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 98 | ); 99 | name = Flutter; 100 | sourceTree = ""; 101 | }; 102 | 97C146E51CF9000F007C117D = { 103 | isa = PBXGroup; 104 | children = ( 105 | 9740EEB11CF90186004384FC /* Flutter */, 106 | 97C146F01CF9000F007C117D /* Runner */, 107 | 97C146EF1CF9000F007C117D /* Products */, 108 | 39E61A4217410A44DCAE04E5 /* Pods */, 109 | DC64528F8F0562B46AAB98DB /* Frameworks */, 110 | ); 111 | sourceTree = ""; 112 | }; 113 | 97C146EF1CF9000F007C117D /* Products */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 97C146EE1CF9000F007C117D /* Runner.app */, 117 | ); 118 | name = Products; 119 | sourceTree = ""; 120 | }; 121 | 97C146F01CF9000F007C117D /* Runner */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 10FB784A228A46130081E413 /* splash.png */, 125 | 10CD00242285721500F9FE78 /* Images.xcassets */, 126 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 127 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 128 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 129 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 130 | 97C147021CF9000F007C117D /* Info.plist */, 131 | 97C146F11CF9000F007C117D /* Supporting Files */, 132 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 133 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 134 | ); 135 | path = Runner; 136 | sourceTree = ""; 137 | }; 138 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 97C146F21CF9000F007C117D /* main.m */, 142 | ); 143 | name = "Supporting Files"; 144 | sourceTree = ""; 145 | }; 146 | DC64528F8F0562B46AAB98DB /* Frameworks */ = { 147 | isa = PBXGroup; 148 | children = ( 149 | A97C91E8EA998E1D2B44CF33 /* libPods-Runner.a */, 150 | ); 151 | name = Frameworks; 152 | sourceTree = ""; 153 | }; 154 | /* End PBXGroup section */ 155 | 156 | /* Begin PBXNativeTarget section */ 157 | 97C146ED1CF9000F007C117D /* Runner */ = { 158 | isa = PBXNativeTarget; 159 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 160 | buildPhases = ( 161 | 7A937251D20D8494510A7C25 /* [CP] Check Pods Manifest.lock */, 162 | 9740EEB61CF901F6004384FC /* Run Script */, 163 | 97C146EA1CF9000F007C117D /* Sources */, 164 | 97C146EB1CF9000F007C117D /* Frameworks */, 165 | 97C146EC1CF9000F007C117D /* Resources */, 166 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 167 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 168 | B81A7BBF265A39B8BECB93BF /* [CP] Embed Pods Frameworks */, 169 | ); 170 | buildRules = ( 171 | ); 172 | dependencies = ( 173 | ); 174 | name = Runner; 175 | productName = Runner; 176 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 177 | productType = "com.apple.product-type.application"; 178 | }; 179 | /* End PBXNativeTarget section */ 180 | 181 | /* Begin PBXProject section */ 182 | 97C146E61CF9000F007C117D /* Project object */ = { 183 | isa = PBXProject; 184 | attributes = { 185 | LastUpgradeCheck = 0910; 186 | ORGANIZATIONNAME = "The Chromium Authors"; 187 | TargetAttributes = { 188 | 97C146ED1CF9000F007C117D = { 189 | CreatedOnToolsVersion = 7.3.1; 190 | DevelopmentTeam = SSA23VCT7A; 191 | }; 192 | }; 193 | }; 194 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 195 | compatibilityVersion = "Xcode 3.2"; 196 | developmentRegion = English; 197 | hasScannedForEncodings = 0; 198 | knownRegions = ( 199 | en, 200 | Base, 201 | ); 202 | mainGroup = 97C146E51CF9000F007C117D; 203 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 204 | projectDirPath = ""; 205 | projectRoot = ""; 206 | targets = ( 207 | 97C146ED1CF9000F007C117D /* Runner */, 208 | ); 209 | }; 210 | /* End PBXProject section */ 211 | 212 | /* Begin PBXResourcesBuildPhase section */ 213 | 97C146EC1CF9000F007C117D /* Resources */ = { 214 | isa = PBXResourcesBuildPhase; 215 | buildActionMask = 2147483647; 216 | files = ( 217 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 218 | 10CD00252285721500F9FE78 /* Images.xcassets in Resources */, 219 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 220 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 221 | 10FB784B228A46130081E413 /* splash.png in Resources */, 222 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 223 | ); 224 | runOnlyForDeploymentPostprocessing = 0; 225 | }; 226 | /* End PBXResourcesBuildPhase section */ 227 | 228 | /* Begin PBXShellScriptBuildPhase section */ 229 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 230 | isa = PBXShellScriptBuildPhase; 231 | buildActionMask = 2147483647; 232 | files = ( 233 | ); 234 | inputPaths = ( 235 | ); 236 | name = "Thin Binary"; 237 | outputPaths = ( 238 | ); 239 | runOnlyForDeploymentPostprocessing = 0; 240 | shellPath = /bin/sh; 241 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 242 | }; 243 | 7A937251D20D8494510A7C25 /* [CP] Check Pods Manifest.lock */ = { 244 | isa = PBXShellScriptBuildPhase; 245 | buildActionMask = 2147483647; 246 | files = ( 247 | ); 248 | inputFileListPaths = ( 249 | ); 250 | inputPaths = ( 251 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 252 | "${PODS_ROOT}/Manifest.lock", 253 | ); 254 | name = "[CP] Check Pods Manifest.lock"; 255 | outputFileListPaths = ( 256 | ); 257 | outputPaths = ( 258 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 259 | ); 260 | runOnlyForDeploymentPostprocessing = 0; 261 | shellPath = /bin/sh; 262 | 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"; 263 | showEnvVarsInLog = 0; 264 | }; 265 | 9740EEB61CF901F6004384FC /* Run Script */ = { 266 | isa = PBXShellScriptBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | ); 270 | inputPaths = ( 271 | ); 272 | name = "Run Script"; 273 | outputPaths = ( 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | shellPath = /bin/sh; 277 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 278 | }; 279 | B81A7BBF265A39B8BECB93BF /* [CP] Embed Pods Frameworks */ = { 280 | isa = PBXShellScriptBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | ); 284 | inputFileListPaths = ( 285 | ); 286 | inputPaths = ( 287 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", 288 | "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", 289 | ); 290 | name = "[CP] Embed Pods Frameworks"; 291 | outputFileListPaths = ( 292 | ); 293 | outputPaths = ( 294 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", 295 | ); 296 | runOnlyForDeploymentPostprocessing = 0; 297 | shellPath = /bin/sh; 298 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 299 | showEnvVarsInLog = 0; 300 | }; 301 | /* End PBXShellScriptBuildPhase section */ 302 | 303 | /* Begin PBXSourcesBuildPhase section */ 304 | 97C146EA1CF9000F007C117D /* Sources */ = { 305 | isa = PBXSourcesBuildPhase; 306 | buildActionMask = 2147483647; 307 | files = ( 308 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 309 | 97C146F31CF9000F007C117D /* main.m in Sources */, 310 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 311 | ); 312 | runOnlyForDeploymentPostprocessing = 0; 313 | }; 314 | /* End PBXSourcesBuildPhase section */ 315 | 316 | /* Begin PBXVariantGroup section */ 317 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 318 | isa = PBXVariantGroup; 319 | children = ( 320 | 97C146FB1CF9000F007C117D /* Base */, 321 | ); 322 | name = Main.storyboard; 323 | sourceTree = ""; 324 | }; 325 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 326 | isa = PBXVariantGroup; 327 | children = ( 328 | 97C147001CF9000F007C117D /* Base */, 329 | ); 330 | name = LaunchScreen.storyboard; 331 | sourceTree = ""; 332 | }; 333 | /* End PBXVariantGroup section */ 334 | 335 | /* Begin XCBuildConfiguration section */ 336 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 337 | isa = XCBuildConfiguration; 338 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 339 | buildSettings = { 340 | ALWAYS_SEARCH_USER_PATHS = NO; 341 | CLANG_ANALYZER_NONNULL = YES; 342 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 343 | CLANG_CXX_LIBRARY = "libc++"; 344 | CLANG_ENABLE_MODULES = YES; 345 | CLANG_ENABLE_OBJC_ARC = YES; 346 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 347 | CLANG_WARN_BOOL_CONVERSION = YES; 348 | CLANG_WARN_COMMA = YES; 349 | CLANG_WARN_CONSTANT_CONVERSION = YES; 350 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 351 | CLANG_WARN_EMPTY_BODY = YES; 352 | CLANG_WARN_ENUM_CONVERSION = YES; 353 | CLANG_WARN_INFINITE_RECURSION = YES; 354 | CLANG_WARN_INT_CONVERSION = YES; 355 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 356 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 357 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 358 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 359 | CLANG_WARN_STRICT_PROTOTYPES = YES; 360 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 361 | CLANG_WARN_UNREACHABLE_CODE = YES; 362 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 363 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 364 | COPY_PHASE_STRIP = NO; 365 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 366 | ENABLE_NS_ASSERTIONS = NO; 367 | ENABLE_STRICT_OBJC_MSGSEND = YES; 368 | GCC_C_LANGUAGE_STANDARD = gnu99; 369 | GCC_NO_COMMON_BLOCKS = YES; 370 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 371 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 372 | GCC_WARN_UNDECLARED_SELECTOR = YES; 373 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 374 | GCC_WARN_UNUSED_FUNCTION = YES; 375 | GCC_WARN_UNUSED_VARIABLE = YES; 376 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 377 | MTL_ENABLE_DEBUG_INFO = NO; 378 | SDKROOT = iphoneos; 379 | TARGETED_DEVICE_FAMILY = "1,2"; 380 | VALIDATE_PRODUCT = YES; 381 | }; 382 | name = Profile; 383 | }; 384 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 385 | isa = XCBuildConfiguration; 386 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 387 | buildSettings = { 388 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 389 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 390 | DEVELOPMENT_TEAM = SSA23VCT7A; 391 | ENABLE_BITCODE = NO; 392 | FRAMEWORK_SEARCH_PATHS = ( 393 | "$(inherited)", 394 | "$(PROJECT_DIR)/Flutter", 395 | ); 396 | INFOPLIST_FILE = Runner/Info.plist; 397 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 398 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 399 | LIBRARY_SEARCH_PATHS = ( 400 | "$(inherited)", 401 | "$(PROJECT_DIR)/Flutter", 402 | ); 403 | PRODUCT_BUNDLE_IDENTIFIER = com.wx.mungFlutter; 404 | PRODUCT_NAME = "$(TARGET_NAME)"; 405 | TARGETED_DEVICE_FAMILY = "1,2"; 406 | VERSIONING_SYSTEM = "apple-generic"; 407 | }; 408 | name = Profile; 409 | }; 410 | 97C147031CF9000F007C117D /* Debug */ = { 411 | isa = XCBuildConfiguration; 412 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 413 | buildSettings = { 414 | ALWAYS_SEARCH_USER_PATHS = NO; 415 | CLANG_ANALYZER_NONNULL = YES; 416 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 417 | CLANG_CXX_LIBRARY = "libc++"; 418 | CLANG_ENABLE_MODULES = YES; 419 | CLANG_ENABLE_OBJC_ARC = YES; 420 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 421 | CLANG_WARN_BOOL_CONVERSION = YES; 422 | CLANG_WARN_COMMA = YES; 423 | CLANG_WARN_CONSTANT_CONVERSION = YES; 424 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 425 | CLANG_WARN_EMPTY_BODY = YES; 426 | CLANG_WARN_ENUM_CONVERSION = YES; 427 | CLANG_WARN_INFINITE_RECURSION = YES; 428 | CLANG_WARN_INT_CONVERSION = YES; 429 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 430 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 431 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 432 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 433 | CLANG_WARN_STRICT_PROTOTYPES = YES; 434 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 435 | CLANG_WARN_UNREACHABLE_CODE = YES; 436 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 437 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 438 | COPY_PHASE_STRIP = NO; 439 | DEBUG_INFORMATION_FORMAT = dwarf; 440 | ENABLE_STRICT_OBJC_MSGSEND = YES; 441 | ENABLE_TESTABILITY = YES; 442 | GCC_C_LANGUAGE_STANDARD = gnu99; 443 | GCC_DYNAMIC_NO_PIC = NO; 444 | GCC_NO_COMMON_BLOCKS = YES; 445 | GCC_OPTIMIZATION_LEVEL = 0; 446 | GCC_PREPROCESSOR_DEFINITIONS = ( 447 | "DEBUG=1", 448 | "$(inherited)", 449 | ); 450 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 451 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 452 | GCC_WARN_UNDECLARED_SELECTOR = YES; 453 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 454 | GCC_WARN_UNUSED_FUNCTION = YES; 455 | GCC_WARN_UNUSED_VARIABLE = YES; 456 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 457 | MTL_ENABLE_DEBUG_INFO = YES; 458 | ONLY_ACTIVE_ARCH = YES; 459 | SDKROOT = iphoneos; 460 | TARGETED_DEVICE_FAMILY = "1,2"; 461 | }; 462 | name = Debug; 463 | }; 464 | 97C147041CF9000F007C117D /* Release */ = { 465 | isa = XCBuildConfiguration; 466 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 467 | buildSettings = { 468 | ALWAYS_SEARCH_USER_PATHS = NO; 469 | CLANG_ANALYZER_NONNULL = YES; 470 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 471 | CLANG_CXX_LIBRARY = "libc++"; 472 | CLANG_ENABLE_MODULES = YES; 473 | CLANG_ENABLE_OBJC_ARC = YES; 474 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 475 | CLANG_WARN_BOOL_CONVERSION = YES; 476 | CLANG_WARN_COMMA = YES; 477 | CLANG_WARN_CONSTANT_CONVERSION = YES; 478 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 479 | CLANG_WARN_EMPTY_BODY = YES; 480 | CLANG_WARN_ENUM_CONVERSION = YES; 481 | CLANG_WARN_INFINITE_RECURSION = YES; 482 | CLANG_WARN_INT_CONVERSION = YES; 483 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 484 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 485 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 486 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 487 | CLANG_WARN_STRICT_PROTOTYPES = YES; 488 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 489 | CLANG_WARN_UNREACHABLE_CODE = YES; 490 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 491 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 492 | COPY_PHASE_STRIP = NO; 493 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 494 | ENABLE_NS_ASSERTIONS = NO; 495 | ENABLE_STRICT_OBJC_MSGSEND = YES; 496 | GCC_C_LANGUAGE_STANDARD = gnu99; 497 | GCC_NO_COMMON_BLOCKS = YES; 498 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 499 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 500 | GCC_WARN_UNDECLARED_SELECTOR = YES; 501 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 502 | GCC_WARN_UNUSED_FUNCTION = YES; 503 | GCC_WARN_UNUSED_VARIABLE = YES; 504 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 505 | MTL_ENABLE_DEBUG_INFO = NO; 506 | SDKROOT = iphoneos; 507 | TARGETED_DEVICE_FAMILY = "1,2"; 508 | VALIDATE_PRODUCT = YES; 509 | }; 510 | name = Release; 511 | }; 512 | 97C147061CF9000F007C117D /* Debug */ = { 513 | isa = XCBuildConfiguration; 514 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 515 | buildSettings = { 516 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 517 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 518 | DEVELOPMENT_TEAM = SSA23VCT7A; 519 | ENABLE_BITCODE = NO; 520 | FRAMEWORK_SEARCH_PATHS = ( 521 | "$(inherited)", 522 | "$(PROJECT_DIR)/Flutter", 523 | ); 524 | INFOPLIST_FILE = Runner/Info.plist; 525 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 526 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 527 | LIBRARY_SEARCH_PATHS = ( 528 | "$(inherited)", 529 | "$(PROJECT_DIR)/Flutter", 530 | ); 531 | PRODUCT_BUNDLE_IDENTIFIER = com.wx.mungFlutter; 532 | PRODUCT_NAME = "$(TARGET_NAME)"; 533 | TARGETED_DEVICE_FAMILY = "1,2"; 534 | VERSIONING_SYSTEM = "apple-generic"; 535 | }; 536 | name = Debug; 537 | }; 538 | 97C147071CF9000F007C117D /* Release */ = { 539 | isa = XCBuildConfiguration; 540 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 541 | buildSettings = { 542 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 543 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 544 | DEVELOPMENT_TEAM = SSA23VCT7A; 545 | ENABLE_BITCODE = NO; 546 | FRAMEWORK_SEARCH_PATHS = ( 547 | "$(inherited)", 548 | "$(PROJECT_DIR)/Flutter", 549 | ); 550 | INFOPLIST_FILE = Runner/Info.plist; 551 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 552 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 553 | LIBRARY_SEARCH_PATHS = ( 554 | "$(inherited)", 555 | "$(PROJECT_DIR)/Flutter", 556 | ); 557 | PRODUCT_BUNDLE_IDENTIFIER = com.wx.mungFlutter; 558 | PRODUCT_NAME = "$(TARGET_NAME)"; 559 | TARGETED_DEVICE_FAMILY = "1,2"; 560 | VERSIONING_SYSTEM = "apple-generic"; 561 | }; 562 | name = Release; 563 | }; 564 | /* End XCBuildConfiguration section */ 565 | 566 | /* Begin XCConfigurationList section */ 567 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 568 | isa = XCConfigurationList; 569 | buildConfigurations = ( 570 | 97C147031CF9000F007C117D /* Debug */, 571 | 97C147041CF9000F007C117D /* Release */, 572 | 249021D3217E4FDB00AE95B9 /* Profile */, 573 | ); 574 | defaultConfigurationIsVisible = 0; 575 | defaultConfigurationName = Release; 576 | }; 577 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 578 | isa = XCConfigurationList; 579 | buildConfigurations = ( 580 | 97C147061CF9000F007C117D /* Debug */, 581 | 97C147071CF9000F007C117D /* Release */, 582 | 249021D4217E4FDB00AE95B9 /* Profile */, 583 | ); 584 | defaultConfigurationIsVisible = 0; 585 | defaultConfigurationName = Release; 586 | }; 587 | /* End XCConfigurationList section */ 588 | }; 589 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 590 | } 591 | -------------------------------------------------------------------------------- /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 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ios/Runner/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 | -------------------------------------------------------------------------------- /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 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /ios/Runner/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-40.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-60.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-58.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-87.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-80.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-120.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-121.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-180.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "idiom" : "ios-marketing", 53 | "size" : "1024x1024", 54 | "scale" : "1x" 55 | } 56 | ], 57 | "info" : { 58 | "version" : 1, 59 | "author" : "xcode" 60 | } 61 | } -------------------------------------------------------------------------------- /ios/Runner/Images.xcassets/AppIcon.appiconset/Icon-120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Runner/Images.xcassets/AppIcon.appiconset/Icon-120.png -------------------------------------------------------------------------------- /ios/Runner/Images.xcassets/AppIcon.appiconset/Icon-121.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Runner/Images.xcassets/AppIcon.appiconset/Icon-121.png -------------------------------------------------------------------------------- /ios/Runner/Images.xcassets/AppIcon.appiconset/Icon-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Runner/Images.xcassets/AppIcon.appiconset/Icon-180.png -------------------------------------------------------------------------------- /ios/Runner/Images.xcassets/AppIcon.appiconset/Icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Runner/Images.xcassets/AppIcon.appiconset/Icon-40.png -------------------------------------------------------------------------------- /ios/Runner/Images.xcassets/AppIcon.appiconset/Icon-58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Runner/Images.xcassets/AppIcon.appiconset/Icon-58.png -------------------------------------------------------------------------------- /ios/Runner/Images.xcassets/AppIcon.appiconset/Icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Runner/Images.xcassets/AppIcon.appiconset/Icon-60.png -------------------------------------------------------------------------------- /ios/Runner/Images.xcassets/AppIcon.appiconset/Icon-80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Runner/Images.xcassets/AppIcon.appiconset/Icon-80.png -------------------------------------------------------------------------------- /ios/Runner/Images.xcassets/AppIcon.appiconset/Icon-87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Runner/Images.xcassets/AppIcon.appiconset/Icon-87.png -------------------------------------------------------------------------------- /ios/Runner/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ios/Runner/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "extent" : "full-screen", 5 | "idiom" : "iphone", 6 | "subtype" : "2688h", 7 | "filename" : "icon_spash1242-2209.png", 8 | "minimum-system-version" : "12.0", 9 | "orientation" : "portrait", 10 | "scale" : "3x" 11 | }, 12 | { 13 | "extent" : "full-screen", 14 | "idiom" : "iphone", 15 | "subtype" : "1792h", 16 | "filename" : "icon_spash750-1335.png", 17 | "minimum-system-version" : "12.0", 18 | "orientation" : "portrait", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "extent" : "full-screen", 23 | "idiom" : "iphone", 24 | "subtype" : "2436h", 25 | "filename" : "icon_spash1242-2208 2.png", 26 | "minimum-system-version" : "11.0", 27 | "orientation" : "portrait", 28 | "scale" : "3x" 29 | }, 30 | { 31 | "extent" : "full-screen", 32 | "idiom" : "iphone", 33 | "subtype" : "736h", 34 | "filename" : "icon_spash1242-2208.png", 35 | "minimum-system-version" : "8.0", 36 | "orientation" : "portrait", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "extent" : "full-screen", 41 | "idiom" : "iphone", 42 | "subtype" : "667h", 43 | "filename" : "icon_spash750-1334.png", 44 | "minimum-system-version" : "8.0", 45 | "orientation" : "portrait", 46 | "scale" : "2x" 47 | }, 48 | { 49 | "orientation" : "portrait", 50 | "idiom" : "iphone", 51 | "filename" : "icon_spash640-960.png", 52 | "extent" : "full-screen", 53 | "minimum-system-version" : "7.0", 54 | "scale" : "2x" 55 | }, 56 | { 57 | "extent" : "full-screen", 58 | "idiom" : "iphone", 59 | "subtype" : "retina4", 60 | "filename" : "icon_spash640-1136.png", 61 | "minimum-system-version" : "7.0", 62 | "orientation" : "portrait", 63 | "scale" : "2x" 64 | } 65 | ], 66 | "info" : { 67 | "version" : 1, 68 | "author" : "xcode" 69 | } 70 | } -------------------------------------------------------------------------------- /ios/Runner/Images.xcassets/LaunchImage.launchimage/icon_spash1242-2208 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Runner/Images.xcassets/LaunchImage.launchimage/icon_spash1242-2208 2.png -------------------------------------------------------------------------------- /ios/Runner/Images.xcassets/LaunchImage.launchimage/icon_spash1242-2208.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Runner/Images.xcassets/LaunchImage.launchimage/icon_spash1242-2208.png -------------------------------------------------------------------------------- /ios/Runner/Images.xcassets/LaunchImage.launchimage/icon_spash1242-2209.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Runner/Images.xcassets/LaunchImage.launchimage/icon_spash1242-2209.png -------------------------------------------------------------------------------- /ios/Runner/Images.xcassets/LaunchImage.launchimage/icon_spash640-1136.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Runner/Images.xcassets/LaunchImage.launchimage/icon_spash640-1136.png -------------------------------------------------------------------------------- /ios/Runner/Images.xcassets/LaunchImage.launchimage/icon_spash640-960.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Runner/Images.xcassets/LaunchImage.launchimage/icon_spash640-960.png -------------------------------------------------------------------------------- /ios/Runner/Images.xcassets/LaunchImage.launchimage/icon_spash750-1334.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Runner/Images.xcassets/LaunchImage.launchimage/icon_spash750-1334.png -------------------------------------------------------------------------------- /ios/Runner/Images.xcassets/LaunchImage.launchimage/icon_spash750-1335.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Runner/Images.xcassets/LaunchImage.launchimage/icon_spash750-1335.png -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Mung 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | mung_flutter 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ios/Runner/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/ios/Runner/splash.png -------------------------------------------------------------------------------- /lib/bloc/theme_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:rxdart/rxdart.dart'; 3 | import 'package:mung_flutter/utils/sp_util.dart'; 4 | import 'package:mung_flutter/data/const/constant.dart'; 5 | 6 | class ThemeBloc { 7 | 8 | int _themeColor = 0xffffffff; 9 | final _controller = BehaviorSubject(); 10 | 11 | ThemeBloc() { 12 | _initThemeColor(); 13 | } 14 | 15 | _initThemeColor() async { 16 | int preThemeColor = await SPUtil.getThemeColor(); 17 | if (preThemeColor == null) { 18 | preThemeColor = Constant.ThemeItems[0]['color']; 19 | } 20 | changeTheme(preThemeColor); 21 | } 22 | 23 | ValueObservable get stream => _controller.stream; 24 | 25 | int get themeColor => _themeColor; 26 | 27 | changeTheme(int themeColor) { 28 | _themeColor = themeColor; 29 | _controller.add(themeColor); 30 | SPUtil.setThemeColor(themeColor); //存储数据 31 | } 32 | 33 | void dispose() { 34 | _controller.close(); 35 | } 36 | 37 | } 38 | 39 | class ThemeProvider extends InheritedWidget { 40 | 41 | final ThemeBloc themeBloc; 42 | 43 | ThemeProvider({@required Widget child,@required ThemeBloc themeBloc}) 44 | : themeBloc = themeBloc , super(child: child); 45 | 46 | @override 47 | bool updateShouldNotify(InheritedWidget oldWidget) { 48 | return true; 49 | } 50 | 51 | static ThemeBloc of(BuildContext context) => 52 | (context.inheritFromWidgetOfExactType(ThemeProvider) as ThemeProvider).themeBloc; 53 | 54 | } -------------------------------------------------------------------------------- /lib/data/const/constant.dart: -------------------------------------------------------------------------------- 1 | class Constant { 2 | 3 | static const List> ThemeItems = [ 4 | { 5 | "color":0xff937eff, 6 | "name": 'BlueViolet', 7 | }, 8 | { 9 | "color": 0xff87CEFA, 10 | "name": 'LightSkyBlue', 11 | }, 12 | { 13 | "color":0xff48D1CC, 14 | "name": 'Teal', 15 | }, 16 | { 17 | "color":0xff00FF00, 18 | "name": 'Lime', 19 | }, 20 | { 21 | "color":0xffFF4500, 22 | "name": 'OrangeRed', 23 | }, 24 | { 25 | "color":0xffFF1493, 26 | "name": 'DeepPink', 27 | }, 28 | { 29 | "color":0xff40E0D0, 30 | "name": 'Turquoise', 31 | }, 32 | { 33 | "color":0xff008B8B, 34 | "name": 'DarkCyan', 35 | }, 36 | { 37 | "color":0xff1E90FF, 38 | "name": 'DoderBlue', 39 | }, 40 | { 41 | "color":0xffFF00FF, 42 | "name": 'Fuchsia', 43 | }, 44 | { 45 | "color":0xffFF1493, 46 | "name": 'DeepPink', 47 | }, 48 | { 49 | "color":0xff483D8B, 50 | "name": 'DarkSlateBlue', 51 | } 52 | ]; 53 | 54 | static const List> CateItems = [ 55 | { 56 | "colors": [0xfffe4080,0xffff77a5], 57 | "title": "Top250", 58 | "icon": 0xe636, 59 | }, 60 | { 61 | "colors": [0xfffeaa1a,0xffffd31a], 62 | "title": "口碑榜", 63 | "icon": 0xe7a7, 64 | }, 65 | { 66 | "colors": [0xffb983ff,0xffa35cff], 67 | "title": "北美票房榜", 68 | "icon": 0xe6ac, 69 | }, 70 | { 71 | "colors": [0xff00ceff,0xff0196fe], 72 | "title": "新片榜", 73 | "icon": 0xe638, 74 | } 75 | ]; 76 | 77 | static const List RecommendItems = [ 78 | '搞笑','爱情','动作','科技', 79 | '记录','动漫','犯罪','战争' 80 | ]; 81 | 82 | } -------------------------------------------------------------------------------- /lib/data/img/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mochixuan/Mung-Flutter/90b3ad0f55f829adeec18723e14065795b3e39f5/lib/data/img/iconfont.ttf -------------------------------------------------------------------------------- /lib/data/net/http_base.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | 3 | // 数据格式太乱,简单处理一下 4 | 5 | const _BASE_URL = "https://douban.uieee.com/v2"; 6 | 7 | const CODE_SUCCESS = 1; //自定义成功 8 | 9 | const _REQUEST_ERROR = -100; //网络请求错误 10 | const _TIMEOUT_ERROR_CODE = -101; // 网络超时,请重试! 11 | const _INVALID_API_KEY=104; //apikey无线 12 | const _BAD_REQUEST = 400; //请求的地址不存在或者包含不支持的参数 13 | const _UNAUTHORIZED = 401; //数据未授权 14 | const _FORBIDDEN = 403; //数据被禁止访问访问 15 | const _NOT_FOUND = 404; //请求的资源不存在或被删除 16 | const _INTERNAL_SERVER_ERROR = 500; //内部错误 17 | const _NEED_PERMISSION = 1000; //数据未授权 18 | 19 | class HttpBase { 20 | 21 | static _errorAnalysis(result) { 22 | 23 | if(result == null || result['code'] == null) { 24 | return { 25 | "code": _REQUEST_ERROR, 26 | "error": '网络超时,请重试!', 27 | }; 28 | } 29 | 30 | switch (result['code']) { 31 | case CODE_SUCCESS: 32 | result["error"] = "请求成功"; 33 | break; 34 | case _TIMEOUT_ERROR_CODE: 35 | result["error"] = "网络超时,请重试!"; 36 | break; 37 | case _REQUEST_ERROR: 38 | result["error"] = "网络请求错误"; 39 | break; 40 | case _INVALID_API_KEY: 41 | result["error"] = "ApiKey无效了"; 42 | break; 43 | case _BAD_REQUEST: 44 | result["error"] = "请求的地址不存在或者包含不支持的参数"; 45 | break; 46 | case _UNAUTHORIZED: 47 | result["error"] = "数据未授权"; 48 | break; 49 | case _FORBIDDEN: 50 | result["error"] = "数据被禁止访问访问"; 51 | break; 52 | case _NOT_FOUND: 53 | result["error"] = "请求的资源不存在或被删除"; 54 | break; 55 | case _INTERNAL_SERVER_ERROR: 56 | result["error"] = "内部错误"; 57 | break; 58 | case _NEED_PERMISSION: 59 | result["error"] = "数据未授权"; 60 | break; 61 | default: 62 | result["error"] = "网络超时,请重试!"; 63 | break; 64 | } 65 | 66 | return result; 67 | } 68 | 69 | // 统一数据,统一数据流出格式 70 | static baseGetRequest(String urlSuffix) async{ 71 | 72 | dynamic result; 73 | 74 | try { 75 | Dio dio = Dio(); 76 | dio.options.baseUrl = _BASE_URL; 77 | dio.options.connectTimeout = 10000; // 10s 78 | dio.options.receiveTimeout = 10000; // 10s 79 | dio.options.receiveTimeout = 10000; // 10s 80 | 81 | Response response = await dio.get(urlSuffix); 82 | 83 | if (response != null && response.statusCode == 200 && response.data != null) { 84 | result = response.data; 85 | if (result['code'] == null) result['code'] = CODE_SUCCESS; 86 | } 87 | } catch (e) { 88 | result = null; //清空 89 | } 90 | 91 | result = _errorAnalysis(result); 92 | 93 | return result; 94 | } 95 | 96 | } -------------------------------------------------------------------------------- /lib/data/net/http_movie.dart: -------------------------------------------------------------------------------- 1 | import 'package:mung_flutter/data/net/http_base.dart'; 2 | 3 | const KEY_APP_ID = "0df993c66c0c636e29ecbb5344252a4a"; 4 | 5 | class HttpMovie { 6 | 7 | /*正在热映*/ 8 | static const _MOVIE_HOT_URL = "/movie/in_theaters"; 9 | /*电影条目信息*/ 10 | static const _MOVIE_DETAIL_URL = '/movie/subject/'; 11 | 12 | static requestMovieHot(int _start,int _count) => HttpBase.baseGetRequest("${_MOVIE_HOT_URL}?start=${_start}&count=${_count}"); 13 | 14 | static requestDetailBaseData(String id) => HttpBase.baseGetRequest("${_MOVIE_DETAIL_URL+id}"); 15 | 16 | static requestMoviePhotos(String id,int count) => HttpBase.baseGetRequest("${_MOVIE_DETAIL_URL+id}/photos?count=${count}&apikey=${KEY_APP_ID}"); 17 | 18 | static requestMovieDiscuss(String id,int start,int count) => HttpBase.baseGetRequest("${_MOVIE_DETAIL_URL+id}/comments?start=${start}&count=${count}&apikey=${KEY_APP_ID}"); 19 | 20 | static requestListMovie(String url,int start,int count,String query) => HttpBase.baseGetRequest("${url}?q=${query}start=${start}&count=${count}&apikey=${KEY_APP_ID}"); 21 | 22 | } -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mung_flutter/bloc/theme_bloc.dart'; 3 | import 'package:mung_flutter/pages/main_page.dart'; 4 | 5 | void main(){ 6 | 7 | ThemeBloc _themeBloc = ThemeBloc(); 8 | 9 | // bloc init 10 | final entryPage = ThemeProvider( 11 | themeBloc: _themeBloc, 12 | child: StreamBuilder( 13 | stream: _themeBloc.stream, 14 | builder: (context,snapshot){ 15 | return MainPage(); 16 | } 17 | ) 18 | ); 19 | 20 | return runApp(entryPage); 21 | } 22 | -------------------------------------------------------------------------------- /lib/model/detail_base_model.dart: -------------------------------------------------------------------------------- 1 | class DetailBaseModel { 2 | 3 | int code; 4 | String error; 5 | String title; 6 | String imagesLarge; 7 | String year; 8 | String genres; 9 | String originalTitle; 10 | String directorsName; 11 | String castsName; 12 | List castFilmmakerItems = []; 13 | double ratingAverage; 14 | int ratingsCount; 15 | String summary; 16 | 17 | DetailBaseModel.fromJson(Map json) { 18 | code = json['code']; 19 | error = json['error']; 20 | title = json['title']; 21 | imagesLarge = json['images']['large']; 22 | year = json['year']; 23 | genres = (json['genres'] as List).join("/"); 24 | originalTitle = json['original_title']; 25 | List directors = json['directors']; 26 | if (directors != null && directors.length != 0) { 27 | directorsName = json['directors'][0]['name']; 28 | } else { 29 | directorsName = "未知"; 30 | } 31 | // 两步合一起 32 | castsName = json['casts'].map((item){ 33 | if (castFilmmakerItems.length < 4) { 34 | castFilmmakerItems.add(DetailBaseFilmmakerModel( 35 | name: item['name'], 36 | large: item['avatars']['large'] 37 | )); 38 | } 39 | return item['name']; 40 | }).join(" "); 41 | ratingAverage = json['rating']['average'] + 0.0; 42 | ratingsCount = json['ratings_count']; 43 | summary = json['summary']; 44 | } 45 | 46 | } 47 | 48 | class DetailBaseFilmmakerModel { 49 | String name; 50 | String large; 51 | 52 | DetailBaseFilmmakerModel({this.name, this.large}); 53 | 54 | } -------------------------------------------------------------------------------- /lib/model/discuss_model.dart: -------------------------------------------------------------------------------- 1 | class DiscussModel { 2 | int code; 3 | String error; 4 | int start; 5 | List discussItems; 6 | 7 | DiscussModel.fromJson(Map json) { 8 | code = json['code']; 9 | error = json['error']; 10 | start = json['start']; 11 | 12 | if (json != null && json['comments'] != null) { 13 | discussItems = []; 14 | json['comments'].forEach((item){ 15 | discussItems.add(DiscussItem.fromJson(item)); 16 | }); 17 | } 18 | 19 | } 20 | 21 | 22 | } 23 | 24 | class DiscussItem { 25 | 26 | String authorAvatar = ""; 27 | String name = "--"; 28 | double ratingValue = 0; 29 | int usefulCount; 30 | String content; 31 | String createdAt; 32 | 33 | 34 | DiscussItem.fromJson(Map json) { 35 | if (json['author'] != null) { 36 | if (json['author']['avatar'] != null) authorAvatar = json['author']['avatar']; 37 | if (json['author']['name'] != null) name = (json['author']['name'] as String); 38 | if (name.length > 13) { 39 | name = name.substring(0,10)+"..."; 40 | } 41 | } 42 | if (json['rating'] != null && json['rating']['value'] != null) { 43 | ratingValue = json['rating']['value'] + 0.0; 44 | } 45 | usefulCount = json['useful_count'] ?? 0; 46 | content = json['content'] ?? ""; 47 | createdAt = json['created_at'] ?? ""; 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /lib/model/hot_model.dart: -------------------------------------------------------------------------------- 1 | 2 | class HotModel { 3 | 4 | int count; 5 | int code; 6 | String error; 7 | int start; 8 | int total; 9 | List subjects; 10 | 11 | HotModel(); 12 | 13 | HotModel.fromJson(Map json){ 14 | code = json['code']; 15 | error = json['error']; 16 | start = json['start']; 17 | total = json['total']; 18 | count = json['count']; 19 | 20 | dynamic subjectItems = json['subjects']; 21 | if (subjectItems != null && subjectItems is List) { 22 | subjects = []; 23 | subjectItems.forEach((subjectModel){ 24 | subjects.add(HotSubjectsModel.fromJson(subjectModel)); 25 | }); 26 | } 27 | 28 | } 29 | 30 | 31 | } 32 | 33 | // 全部集中一起,简单点 34 | class HotSubjectsModel { 35 | 36 | // id 37 | String id; 38 | // 标题 39 | String title; 40 | // 导演的头像 41 | String avatarsSmall; 42 | // 导演名 43 | String directorsName; 44 | // 星级 45 | double ratingAverage; 46 | //所有主演 47 | String castNames; 48 | // 大图 49 | String largeImage; 50 | // 多少人看过 51 | int collectCount; 52 | 53 | HotSubjectsModel.fromJson(Map json) { 54 | if (json != null) { 55 | id = json['id']; 56 | largeImage = json['images']['large']; 57 | title = json['title']; 58 | 59 | List directors = json['directors']; 60 | if (directors != null && directors.length != 0) { 61 | avatarsSmall = json['directors'][0]['avatars']['small']; 62 | directorsName = json['directors'][0]['name']; 63 | } else { 64 | avatarsSmall = ""; 65 | directorsName = "未知"; 66 | } 67 | 68 | castNames = json['casts'].map((item) => item['name']).join(" "); 69 | collectCount = json['collect_count']; 70 | ratingAverage = json['rating']['average'] + 0.0; 71 | } 72 | } 73 | 74 | 75 | } -------------------------------------------------------------------------------- /lib/model/list_model.dart: -------------------------------------------------------------------------------- 1 | class ListModel { 2 | 3 | int code; 4 | String error; 5 | List listItems; 6 | 7 | ListModel.fromJson(Map json) { 8 | code = json['code']; 9 | error = json['error']; 10 | if (json != null && json['subjects'] != null) { 11 | listItems = []; 12 | json['subjects'].forEach((item){ 13 | listItems.add(ListItem.fromJson(item['subject'] ?? item)); 14 | }); 15 | } 16 | } 17 | 18 | } 19 | 20 | class ListItem { 21 | 22 | // id 23 | String id; 24 | // 标题 25 | String title; 26 | // 大图 27 | String largeImage; 28 | // 导演名 29 | String directorsName; 30 | // 星级 31 | double ratingAverage; 32 | //所有主演 33 | String castNames; 34 | String year; 35 | 36 | ListItem.fromJson(Map json) { 37 | if (json != null) { 38 | id = json['id']; 39 | title = json['title']; 40 | largeImage = json['images']['large']; 41 | 42 | List directors = json['directors']; 43 | if (directors != null && directors.length != 0) { 44 | directorsName = json['directors'][0]['name']; 45 | } else { 46 | directorsName = "未知"; 47 | } 48 | castNames = json['casts'].map((item) => item['name']).join(" "); 49 | ratingAverage = json['rating']['average'] + 0.0; 50 | year = json['year']; 51 | 52 | } 53 | } 54 | 55 | } -------------------------------------------------------------------------------- /lib/model/loading_state.dart: -------------------------------------------------------------------------------- 1 | enum LoadingState { 2 | Loading, Error, NoMore 3 | } -------------------------------------------------------------------------------- /lib/model/stills_model.dart: -------------------------------------------------------------------------------- 1 | class StillsModel { 2 | 3 | int code; 4 | String error; 5 | List stillItems; 6 | 7 | StillsModel.fromJson(Map json) { 8 | code = json['code']; 9 | error = json['error']; 10 | if (json != null && json['photos'] != null) { 11 | stillItems = []; 12 | json['photos'].forEach((model){ 13 | stillItems.add(StillItem.fromJson(model)); 14 | }); 15 | } 16 | } 17 | 18 | } 19 | 20 | class StillItem { 21 | 22 | int photoCount = 0; 23 | String image; 24 | 25 | StillItem.fromJson(Map json) { 26 | photoCount = json['photos_count']; 27 | image = json['image']; 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /lib/pages/detail_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mung_flutter/data/net/http_base.dart'; 3 | import 'package:mung_flutter/data/net/http_movie.dart'; 4 | import 'package:mung_flutter/style/base_style.dart'; 5 | import 'package:mung_flutter/utils/ui_util.dart'; 6 | import 'package:mung_flutter/widget/loading_widget.dart'; 7 | import 'package:mung_flutter/model/loading_state.dart'; 8 | import 'package:mung_flutter/model/detail_base_model.dart'; 9 | import 'package:mung_flutter/style/colors.dart'; 10 | import 'package:smooth_star_rating/smooth_star_rating.dart'; 11 | import 'package:mung_flutter/model/stills_model.dart'; 12 | import 'package:mung_flutter/model/discuss_model.dart'; 13 | import 'package:mung_flutter/widget/loading_footer_widget.dart'; 14 | import 'package:mung_flutter/utils/route_util.dart'; 15 | 16 | class DetailPage extends StatefulWidget { 17 | 18 | final String id; 19 | 20 | DetailPage({@required this.id}); 21 | 22 | @override 23 | State createState() { 24 | return DetailState(id: this.id); 25 | } 26 | } 27 | 28 | class DetailState extends State { 29 | 30 | final String id; 31 | LoadingState _loadingState = LoadingState.Loading; 32 | LoadingState _stillLoadingState = LoadingState.Loading; 33 | LoadingState _discussLoadingState = LoadingState.Loading; 34 | DetailBaseModel _detailBaseModel; 35 | List _stillItems; 36 | double _ratingAverage = 0; 37 | bool _isOpenIntro = false; 38 | 39 | int _discussStart = 0; 40 | List _discussItems = []; 41 | bool _scrollRefreshing = false; 42 | final ScrollController _scrollController = ScrollController(); 43 | 44 | DetailState({@required this.id}); 45 | 46 | @override 47 | void initState() { 48 | super.initState(); 49 | 50 | _requestBaseData(); 51 | _requestSectionStills(); 52 | _requestDiscussData(); 53 | 54 | _scrollController.addListener((){ 55 | // 如果错误要手动单机重新加载 56 | if (_discussLoadingState != LoadingState.Error && 57 | _discussLoadingState != LoadingState.NoMore) { 58 | double _curHeight = _scrollController.position.pixels; 59 | double _maxHeight = _scrollController.position.maxScrollExtent; 60 | if (_curHeight+loadingFooterHeight*0.8 > _maxHeight) { 61 | this._requestDiscussData(); 62 | } 63 | } 64 | }); 65 | } 66 | 67 | @override 68 | void dispose() { 69 | _scrollController.dispose(); 70 | super.dispose(); 71 | } 72 | 73 | @override 74 | Widget build(BuildContext context) { 75 | 76 | if (_detailBaseModel == null || 77 | _detailBaseModel.code != CODE_SUCCESS) { 78 | return LoadingWidget(_loadingState,this._requestBaseData); 79 | } 80 | 81 | return Material( 82 | color: WColors.color_f5, 83 | child: Padding( 84 | padding: EdgeInsets.only(bottom: UiUtil.getSafeBottomPadding(context)), 85 | child: CustomScrollView( 86 | controller: _scrollController, 87 | slivers: [ 88 | SliverAppBar( 89 | leading: BaseStyle.getIconFontButton(0xeb09,() => Navigator.pop(context)), 90 | expandedHeight: 300, 91 | pinned: true, 92 | title: Text(_detailBaseModel.title), 93 | centerTitle: true, 94 | flexibleSpace: FlexibleSpaceBar( 95 | collapseMode: CollapseMode.parallax, 96 | background: Container( 97 | margin: EdgeInsets.only( 98 | top: UiUtil.getSafeTopPadding(context)+56, 99 | bottom: 28 100 | ), 101 | child: ClipRRect( 102 | borderRadius: BorderRadius.circular(20), 103 | child: Image.network( 104 | _detailBaseModel.imagesLarge, 105 | ), 106 | ), 107 | ), 108 | ), 109 | ), 110 | _baseInfoWidget(), 111 | _discussWidget(), 112 | SliverToBoxAdapter( 113 | child: LoadingFooterWidget(_discussLoadingState,this._requestDiscussData) 114 | ) 115 | ], 116 | ), 117 | ), 118 | ); 119 | } 120 | 121 | _requestBaseData() { 122 | 123 | setState(() { 124 | _loadingState = LoadingState.Loading; 125 | }); 126 | 127 | HttpMovie.requestDetailBaseData(this.id) 128 | .then((result){ 129 | _detailBaseModel = DetailBaseModel.fromJson(result); 130 | if(_detailBaseModel.code == CODE_SUCCESS) { 131 | setState(() { 132 | _loadingState = LoadingState.NoMore; 133 | }); 134 | } else { 135 | setState(() { 136 | _loadingState = LoadingState.Error; 137 | }); 138 | } 139 | }); 140 | } 141 | 142 | _requestSectionStills() { 143 | 144 | setState(() { 145 | _stillLoadingState = LoadingState.Loading; 146 | }); 147 | 148 | HttpMovie.requestMoviePhotos(this.id, 6) 149 | .then((result){ 150 | StillsModel stillsModel = StillsModel.fromJson(result); 151 | if (stillsModel.code == CODE_SUCCESS && stillsModel.stillItems != null) { 152 | setState(() { 153 | _stillLoadingState = LoadingState.NoMore; 154 | _stillItems = stillsModel.stillItems; 155 | }); 156 | } else { 157 | setState(() { 158 | _stillLoadingState = LoadingState.Error; 159 | }); 160 | } 161 | }); 162 | } 163 | 164 | _requestDiscussData() { 165 | 166 | if (_scrollRefreshing || _discussLoadingState == LoadingState.NoMore) return; 167 | 168 | setState(() { 169 | _scrollRefreshing = true; 170 | _discussLoadingState = LoadingState.Loading; 171 | }); 172 | 173 | HttpMovie.requestMovieDiscuss(this.id, _discussStart+1, 8) 174 | .then((result){ 175 | DiscussModel discussModel = DiscussModel.fromJson(result); 176 | if (discussModel.code == CODE_SUCCESS && discussModel.discussItems != null) { 177 | setState(() { 178 | _scrollRefreshing = false; 179 | _discussStart = discussModel.start; 180 | _discussItems.addAll(discussModel.discussItems); 181 | _loadingState = _discussItems.length != 8 ? LoadingState.NoMore : LoadingState.Loading; 182 | }); 183 | } else { 184 | setState(() { 185 | _scrollRefreshing = false; 186 | _loadingState = LoadingState.Error; 187 | }); 188 | } 189 | }); 190 | } 191 | 192 | SliverToBoxAdapter _baseInfoWidget() { 193 | 194 | double descWidth = UiUtil.getDeviceWidth(context) - 140; 195 | double filmmakerWidth = (UiUtil.getDeviceWidth(context) - 30)/4; 196 | 197 | return SliverToBoxAdapter( 198 | child: Column( 199 | crossAxisAlignment: CrossAxisAlignment.start, 200 | children: [ 201 | // 基本信息 202 | Padding( 203 | padding: const EdgeInsets.all(10), 204 | child: Row( 205 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 206 | children: [ 207 | Column( 208 | crossAxisAlignment: CrossAxisAlignment.start, 209 | mainAxisAlignment: MainAxisAlignment.center, 210 | children: [ 211 | Padding( 212 | padding: const EdgeInsets.only(bottom: 10), 213 | child: BaseStyle.limitLineText( 214 | descWidth, _detailBaseModel.title, 215 | TextStyle(fontSize: 16,color: WColors.color_66,fontWeight: FontWeight.bold), 1 216 | ), 217 | ), 218 | BaseStyle.limitLineText(descWidth,"${_detailBaseModel.year}/${_detailBaseModel.genres}",TextStyle(fontSize: 13,color: WColors.color_9d),1), 219 | BaseStyle.limitLineText(descWidth,"原名: ${_detailBaseModel.originalTitle}",TextStyle(fontSize: 13,color: WColors.color_9d),1), 220 | BaseStyle.limitLineText(descWidth,"导演: ${_detailBaseModel.directorsName}",TextStyle(fontSize: 13,color: WColors.color_9d),1), 221 | BaseStyle.limitLineText(descWidth,"主演: ${_detailBaseModel.castsName}",TextStyle(fontSize: 13,color: WColors.color_9d),1), 222 | ], 223 | ), 224 | Container( 225 | width: 100, 226 | height: 100, 227 | decoration: BoxDecoration( 228 | color: WColors.color_ff, 229 | borderRadius: BorderRadius.circular(6), 230 | boxShadow: [ 231 | BoxShadow( 232 | color: Theme.of(context).primaryColor, 233 | offset: Offset(1, 1), 234 | blurRadius: 3, 235 | ), 236 | ] 237 | ), 238 | child: Column( 239 | mainAxisAlignment: MainAxisAlignment.center, 240 | crossAxisAlignment: CrossAxisAlignment.center, 241 | children: [ 242 | Text("综合评分",style: TextStyle(fontSize: 12,color: WColors.color_9d)), 243 | Text(_detailBaseModel.ratingAverage.toString(),style: TextStyle(fontSize: 18,color: WColors.color_66,fontWeight: FontWeight.bold)), 244 | BaseStyle.starWidget(_detailBaseModel.ratingAverage, 12), 245 | Text("${_detailBaseModel.ratingsCount}人",style: TextStyle(fontSize: 12,color: WColors.color_9d)), 246 | ], 247 | ), 248 | ) 249 | ], 250 | ) 251 | ), 252 | Container( 253 | height: 48, 254 | margin: const EdgeInsets.only(top: 10,bottom: 20,right: 15,left: 15), 255 | decoration: BoxDecoration( 256 | border: Border.all(color: WColors.color_fc3,width: 2), 257 | borderRadius: BorderRadius.circular(4) 258 | ), 259 | child: Row( 260 | mainAxisAlignment: MainAxisAlignment.center, 261 | crossAxisAlignment: CrossAxisAlignment.center, 262 | children: [ 263 | Text("我来评分",style: TextStyle(color: WColors.color_fc3,fontSize: 16)), 264 | Padding( 265 | padding: const EdgeInsets.only(left: 10), 266 | child: SmoothStarRating( 267 | allowHalfRating: true, 268 | starCount: 5, 269 | rating: _ratingAverage, 270 | size: 24, 271 | color: WColors.color_fc3, 272 | borderColor: WColors.color_e6, 273 | onRatingChanged: (rate) { 274 | setState(() { 275 | _ratingAverage = rate; 276 | }); 277 | } 278 | ), 279 | ) 280 | ], 281 | ), 282 | ), 283 | Container(height: 2, color: WColors.color_ff), 284 | Padding( 285 | padding: const EdgeInsets.only(top: 20,bottom: 10,left: 10,right: 10), 286 | child: Text("简介",style: TextStyle(fontSize: 14,color: WColors.color_66),), 287 | ), 288 | Padding( 289 | padding: const EdgeInsets.symmetric(horizontal: 10), 290 | child: Stack( 291 | children: [ 292 | Positioned( 293 | child: Text( 294 | _detailBaseModel.summary,style: 295 | TextStyle(fontSize: 14,color: WColors.color_9d,height: 1.2), 296 | maxLines: _isOpenIntro ? 20 : 4, 297 | overflow: TextOverflow.ellipsis, 298 | ) 299 | ), 300 | Visibility( 301 | visible: !_isOpenIntro, 302 | child: Positioned( 303 | right: 0, 304 | bottom: 0, 305 | width: 40, 306 | height: 24, 307 | child: FlatButton( 308 | padding: const EdgeInsets.all(0), 309 | color: WColors.color_f5, 310 | onPressed: (){ 311 | setState(() { 312 | _isOpenIntro = true; 313 | }); 314 | }, 315 | child: Text("展开",style: TextStyle(fontSize: 14,height: 1.2,color: Theme.of(context).primaryColor),) 316 | ) 317 | ) 318 | ) 319 | ], 320 | ), 321 | ), 322 | Padding( 323 | padding: const EdgeInsets.only(top: 20,left: 10,right: 10), 324 | child: Text("影人",style: TextStyle(fontSize: 14,color: WColors.color_66),), 325 | ), 326 | Padding( 327 | padding: const EdgeInsets.only(left: 10,top: 10,bottom: 10,right: 10), 328 | child: Row( 329 | children: _detailBaseModel.castFilmmakerItems 330 | .map((item){ 331 | return Column( 332 | mainAxisAlignment: MainAxisAlignment.start, 333 | children: [ 334 | Image.network( 335 | item.large, 336 | width: (UiUtil.getDeviceWidth(context)-50)/4, 337 | height: 160, 338 | fit: BoxFit.fill, 339 | ), 340 | Container( 341 | width: filmmakerWidth, 342 | child: Text( 343 | item.name, 344 | style: TextStyle(fontSize: 12,color: WColors.color_9d), 345 | overflow: TextOverflow.ellipsis, 346 | textAlign: TextAlign.center, 347 | maxLines: 1, 348 | ), 349 | ) 350 | ], 351 | ); 352 | }).toList(), 353 | ), 354 | ), 355 | Padding( 356 | padding: const EdgeInsets.only(top: 20,left: 10,right: 10), 357 | child: Text("剧照",style: TextStyle(fontSize: 14,color: WColors.color_66),), 358 | ), 359 | _sectionStillsWidget(), 360 | Container( 361 | height: 2, 362 | color: WColors.color_ff, 363 | margin: const EdgeInsets.only(top: 10), 364 | ), 365 | Container( 366 | margin: const EdgeInsets.all(10), 367 | child: Text("评论区",style: TextStyle(fontSize: 16,color: WColors.color_9d),), 368 | ) 369 | ], 370 | ), 371 | ); 372 | } 373 | 374 | Widget _sectionStillsWidget() { 375 | if (_stillItems == null) { 376 | return Container( 377 | height: 150, 378 | child: LoadingWidget(_stillLoadingState, _requestSectionStills), 379 | ); 380 | } 381 | 382 | List widget = []; 383 | int photoCount = 0; 384 | if (_stillItems.length > 0) photoCount = _stillItems[0].photoCount; 385 | for(int i = 0 ; i < _stillItems.length ; i++) { 386 | widget.add( 387 | ClipRRect( 388 | borderRadius: BorderRadius.circular(2), 389 | child: Padding( 390 | padding: const EdgeInsets.only(right: 4), 391 | child: Image.network(_stillItems[i].image,fit: BoxFit.fill,width: 220,height: 150,), 392 | ), 393 | ) 394 | ); 395 | } 396 | widget.add( 397 | FlatButton( 398 | padding: const EdgeInsets.all(0), 399 | onPressed: (){ 400 | RouteUtil.routeToPhotoDetailPage(context, this.id,photoCount); 401 | }, 402 | child: ClipRRect( 403 | borderRadius: BorderRadius.circular(2), 404 | child: Container( 405 | width: 150, 406 | height: 150, 407 | color: WColors.color_9d, 408 | child: Column( 409 | mainAxisAlignment: MainAxisAlignment.center, 410 | children: [ 411 | Text("全部剧照",style: TextStyle(fontSize: 14,color: WColors.color_ff),), 412 | Container(color: WColors.color_ff,width: 75,height: 1,margin: const EdgeInsets.symmetric(vertical: 4),), 413 | Text("${photoCount} 张",style: TextStyle(fontSize: 12,color: WColors.color_ff),), 414 | ], 415 | ), 416 | ), 417 | ) 418 | ) 419 | ); 420 | 421 | 422 | return Padding( 423 | padding: const EdgeInsets.all(10), 424 | child: SingleChildScrollView( 425 | scrollDirection: Axis.horizontal, 426 | child: Row( 427 | children: widget, 428 | ), 429 | ), 430 | ); 431 | } 432 | 433 | SliverList _discussWidget() { 434 | 435 | return SliverList( 436 | delegate: SliverChildBuilderDelegate( 437 | (BuildContext context, int index){ 438 | DiscussItem discussItem = _discussItems[index]; 439 | return Container( 440 | color: WColors.color_ff, 441 | padding: const EdgeInsets.all(10), 442 | margin: const EdgeInsets.only(top: 2), 443 | child: Row( 444 | crossAxisAlignment: CrossAxisAlignment.start, 445 | children: [ 446 | ClipOval( 447 | child: Image.network( 448 | discussItem.authorAvatar, 449 | width: 36, 450 | height: 36, 451 | ), 452 | ), 453 | Expanded( 454 | child: Padding( 455 | padding: const EdgeInsets.only(left: 10), 456 | child: Column( 457 | crossAxisAlignment: CrossAxisAlignment.start, 458 | children: [ 459 | Row( 460 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 461 | crossAxisAlignment: CrossAxisAlignment.start, 462 | children: [ 463 | Row( 464 | children: [ 465 | Text(discussItem.name,style: TextStyle(fontSize: 12,color: WColors.color_66),), 466 | Padding( 467 | padding: const EdgeInsets.only(left: 4), 468 | child: BaseStyle.starWidget(discussItem.ratingValue/2, 12), 469 | ) 470 | ], 471 | ), 472 | Row( 473 | children: [ 474 | Icon( 475 | IconData(0xe7a7,fontFamily: 'iconfont'), 476 | size: 12, 477 | color: Theme.of(context).primaryColor, 478 | ), 479 | Padding( 480 | padding: const EdgeInsets.only(left: 4), 481 | child: Text(discussItem.usefulCount.toString(),style: TextStyle(fontSize: 12,color: Theme.of(context).primaryColor),), 482 | ) 483 | ], 484 | ) 485 | ], 486 | ), 487 | Text(discussItem.content,style: TextStyle( 488 | fontSize: 14, 489 | color: WColors.color_66, 490 | height: 1.1, 491 | ),), 492 | Row( 493 | mainAxisAlignment: MainAxisAlignment.end, 494 | children: [ 495 | Text(discussItem.createdAt,style: TextStyle( 496 | fontSize: 12, 497 | color: WColors.color_66 498 | ),) 499 | ], 500 | ) 501 | ], 502 | ), 503 | ) 504 | ) 505 | ], 506 | ), 507 | ); 508 | } , 509 | childCount: _discussItems.length 510 | ), 511 | ); 512 | } 513 | 514 | } 515 | 516 | -------------------------------------------------------------------------------- /lib/pages/list_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mung_flutter/model/list_model.dart'; 3 | import 'package:mung_flutter/style/base_style.dart'; 4 | import 'package:mung_flutter/utils/ui_util.dart'; 5 | import 'package:mung_flutter/widget/loading_widget.dart'; 6 | import 'package:mung_flutter/widget/loading_footer_widget.dart'; 7 | import 'package:mung_flutter/model/loading_state.dart'; 8 | import 'package:mung_flutter/data/net/http_movie.dart'; 9 | import 'package:mung_flutter/data/net/http_base.dart'; 10 | import 'package:mung_flutter/data/const/constant.dart'; 11 | import 'package:mung_flutter/style/colors.dart'; 12 | import 'package:mung_flutter/utils/route_util.dart'; 13 | 14 | class ListPage extends StatefulWidget { 15 | final String title; 16 | 17 | ListPage({this.title}); 18 | 19 | @override 20 | State createState() { 21 | return ListState(title: this.title); 22 | } 23 | } 24 | 25 | class ListState extends State { 26 | 27 | final String title; 28 | LoadingState _loadingState = LoadingState.Loading; 29 | List _listItems = []; 30 | int _start = 0; 31 | bool _scrollRefreshing = false; 32 | final ScrollController _scrollController = ScrollController(); 33 | 34 | ListState({this.title}); 35 | 36 | _requestData() { 37 | 38 | if (_scrollRefreshing || _loadingState == LoadingState.NoMore) return; 39 | 40 | setState(() { 41 | _loadingState = LoadingState.Loading; 42 | _scrollRefreshing = true; 43 | }); 44 | 45 | String url = ""; 46 | if (this.title == Constant.CateItems[0]['title']) { 47 | url = "/movie/top250"; 48 | } else if (this.title == Constant.CateItems[1]['title']) { 49 | url = "/movie/weekly"; 50 | } else if (this.title == Constant.CateItems[2]['title']) { 51 | url = "/movie/us_box"; 52 | } else if (this.title == Constant.CateItems[3]['title']) { 53 | url = "/movie/new_movies"; 54 | } else { 55 | url = "/movie/search"; 56 | } 57 | 58 | HttpMovie.requestListMovie(url, _start + 1, 16, this.title) 59 | .then((result){ 60 | ListModel listModel = ListModel.fromJson(result); 61 | if (listModel.code == CODE_SUCCESS && listModel.listItems != null) { 62 | setState(() { 63 | _scrollRefreshing = false; 64 | _start = _start + 1; //由于数据可能会为空自己处理 65 | _loadingState = listModel.listItems.length != 16 ? LoadingState.NoMore : LoadingState.Loading; 66 | _listItems.addAll(listModel.listItems); 67 | }); 68 | } else { 69 | setState(() { 70 | _scrollRefreshing = false; 71 | _loadingState = LoadingState.Error; 72 | }); 73 | } 74 | }); 75 | } 76 | 77 | @override 78 | void initState() { 79 | super.initState(); 80 | _requestData(); 81 | 82 | _scrollController.addListener((){ 83 | // 如果错误要手动单机重新加载 84 | if (_loadingState != LoadingState.Error && 85 | _loadingState != LoadingState.NoMore) { 86 | double _curHeight = _scrollController.position.pixels; 87 | double _maxHeight = _scrollController.position.maxScrollExtent; 88 | if (_curHeight+loadingFooterHeight*0.8 > _maxHeight) { 89 | this._requestData(); 90 | } 91 | } 92 | }); 93 | } 94 | 95 | @override 96 | Widget build(BuildContext context) { 97 | 98 | double leftTextWidth = UiUtil.getDeviceWidth(context) - 140; 99 | 100 | return Scaffold( 101 | appBar: AppBar( 102 | leading: BaseStyle.getIconFontButton(0xeb09,() => Navigator.pop(context)), 103 | title: Text(this.title,style: BaseStyle.textStyleWhite(18)), 104 | centerTitle: true, 105 | ), 106 | body: _listItems.length == 0 ? 107 | LoadingWidget(_loadingState, _requestData) : 108 | Padding( 109 | padding: EdgeInsets.only(bottom: UiUtil.getSafeBottomPadding(context)), 110 | child: CustomScrollView( 111 | controller: _scrollController, 112 | slivers: [ 113 | SliverList( 114 | delegate: SliverChildBuilderDelegate( 115 | (context,index){ 116 | ListItem item = _listItems[index]; 117 | return Column( 118 | mainAxisAlignment: MainAxisAlignment.start, 119 | crossAxisAlignment: CrossAxisAlignment.start, 120 | children: [ 121 | FlatButton( 122 | padding: const EdgeInsets.all(0), 123 | color: WColors.color_ff, 124 | onPressed: (){ 125 | RouteUtil.routeToDetailPage(context, item.id); 126 | }, 127 | child: Container( 128 | padding: const EdgeInsets.all(10), 129 | height: 200, 130 | child: Row( 131 | crossAxisAlignment: CrossAxisAlignment.center, 132 | children: [ 133 | ClipRRect( 134 | borderRadius: BorderRadius.circular(4), 135 | child: Image.network( 136 | item.largeImage, 137 | width: 96, 138 | height: 155, 139 | fit: BoxFit.fill, 140 | ), 141 | ), 142 | Padding( 143 | padding: const EdgeInsets.all(10), 144 | child: Column( 145 | mainAxisAlignment: MainAxisAlignment.spaceAround, 146 | crossAxisAlignment: CrossAxisAlignment.start, 147 | children: [ 148 | BaseStyle.limitLineText(leftTextWidth, item.title, TextStyle(fontSize: 16,color: WColors.color_66), 1), 149 | BaseStyle.limitLineText(leftTextWidth, '导演: '+item.directorsName, TextStyle(fontSize: 14,color: WColors.color_9d), 1), 150 | BaseStyle.limitLineText(leftTextWidth, '主演: '+item.castNames, TextStyle(fontSize: 14,color: WColors.color_9d), 2), 151 | Text(item.year,style: TextStyle(fontSize: 14,color: WColors.color_9d)), 152 | BaseStyle.starWidgetAndText(item.ratingAverage, 14) 153 | ], 154 | ), 155 | ) 156 | ], 157 | ), 158 | ) 159 | ), 160 | Container(height: 2) 161 | ], 162 | ); 163 | }, 164 | childCount: _listItems.length, 165 | ), 166 | 167 | ), 168 | SliverToBoxAdapter( 169 | child: LoadingFooterWidget(_loadingState,this._requestData) 170 | ) 171 | ], 172 | ), 173 | ) 174 | ); 175 | } 176 | 177 | } -------------------------------------------------------------------------------- /lib/pages/main_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_swiper/flutter_swiper.dart'; 3 | import 'package:mung_flutter/bloc/theme_bloc.dart'; 4 | import 'package:mung_flutter/data/net/http_base.dart'; 5 | import 'package:mung_flutter/data/net/http_movie.dart'; 6 | import 'package:mung_flutter/model/hot_model.dart'; 7 | import 'package:mung_flutter/model/loading_state.dart'; 8 | import 'package:mung_flutter/style/base_style.dart'; 9 | import 'package:mung_flutter/style/colors.dart'; 10 | import 'package:mung_flutter/utils/route_util.dart'; 11 | import 'package:mung_flutter/utils/ui_util.dart'; 12 | import 'package:mung_flutter/widget/loading_footer_widget.dart'; 13 | import 'package:mung_flutter/widget/loading_widget.dart'; 14 | import 'package:mung_flutter/data/const/constant.dart'; 15 | 16 | // ThemeProvider要独立出来,刷新会产生闪屏 17 | class MainPage extends StatefulWidget { 18 | @override 19 | State createState() { 20 | return _MainState(); 21 | } 22 | } 23 | 24 | class _MainState extends State { 25 | 26 | bool _scrollRefreshing = false; 27 | int _start = 0; 28 | List _hotMovieItems = []; 29 | final double _gridGapWidth = 10; 30 | LoadingState _loadingState = LoadingState.Loading; 31 | final ScrollController _scrollController = ScrollController(); 32 | 33 | _requestData() { 34 | 35 | if (_scrollRefreshing || _loadingState == LoadingState.NoMore) return; 36 | 37 | setState(() { 38 | _loadingState = LoadingState.Loading; 39 | _scrollRefreshing = true; 40 | }); 41 | 42 | HttpMovie.requestMovieHot(_start+2,20) 43 | .then((result){ 44 | HotModel hotModel = HotModel.fromJson(result); 45 | if (hotModel.code == CODE_SUCCESS && hotModel.subjects != null) { 46 | setState(() { 47 | _scrollRefreshing = false; 48 | _start = hotModel.start; 49 | _loadingState = hotModel.subjects.length != 20 ? LoadingState.NoMore : LoadingState.Loading; 50 | _hotMovieItems.addAll(hotModel.subjects); 51 | }); 52 | } else { 53 | setState(() { 54 | _scrollRefreshing = false; 55 | _loadingState = LoadingState.Error; 56 | }); 57 | } 58 | }); 59 | } 60 | 61 | @override 62 | void initState() { 63 | super.initState(); 64 | 65 | this._requestData(); 66 | 67 | _scrollController.addListener((){ 68 | // 如果错误要手动单机重新加载 69 | if (_loadingState != LoadingState.Error && 70 | _loadingState != LoadingState.NoMore) { 71 | double _curHeight = _scrollController.position.pixels; 72 | double _maxHeight = _scrollController.position.maxScrollExtent; 73 | if (_curHeight+loadingFooterHeight*0.8 > _maxHeight) { 74 | this._requestData(); 75 | } 76 | } 77 | }); 78 | } 79 | 80 | @override 81 | Widget build(BuildContext context) { 82 | 83 | // 有个时间差,就是执行顺序问 84 | return MaterialApp( 85 | debugShowCheckedModeBanner: false, 86 | theme: ThemeData( 87 | primaryColor: Color(ThemeProvider.of(context).themeColor), // 主题色 88 | scaffoldBackgroundColor: WColors.color_f5 89 | ), 90 | home: Builder( 91 | builder: (context) { 92 | return Scaffold( 93 | appBar: AppBar( 94 | leading: BaseStyle.getIconFontButton( 95 | 0xeaec, () => RouteUtil.routeToThemePage(context)), 96 | title: Text("Mung", style: BaseStyle.textStyleWhite(18),), 97 | centerTitle: true, 98 | actions: [ BaseStyle.getIconFontButton(0xeafe, () => RouteUtil.routeToSearchPage(context))], 99 | ), 100 | body: _hotMovieItems.length == 0 ? 101 | LoadingWidget(_loadingState,this._requestData): 102 | Padding( 103 | padding: EdgeInsets.only( 104 | left: _gridGapWidth, 105 | right: _gridGapWidth, 106 | top: _gridGapWidth, 107 | bottom: UiUtil.getSafeBottomPadding(context) 108 | ), 109 | child: CustomScrollView( 110 | controller: _scrollController, 111 | slivers: [ 112 | SliverToBoxAdapter( 113 | child: _BannerWidget(_hotMovieItems.take(4).toList()), 114 | ), 115 | _getCateWidget(context), 116 | _getGridViewWidget(context, _hotMovieItems.skip(4).toList()), 117 | SliverToBoxAdapter( 118 | child: LoadingFooterWidget(_loadingState,this._requestData) 119 | ) 120 | ], 121 | ), 122 | ), 123 | ); 124 | } 125 | ) 126 | ); 127 | } 128 | 129 | @override 130 | void dispose() { 131 | ThemeProvider.of(context).dispose(); 132 | _scrollController.dispose(); 133 | super.dispose(); 134 | } 135 | 136 | SliverToBoxAdapter _getCateWidget(BuildContext context) { 137 | return SliverToBoxAdapter( 138 | child: Container( 139 | height: 72, 140 | decoration: BoxDecoration( 141 | color: Theme.of(context).primaryColor, 142 | borderRadius: BorderRadius.circular(6) 143 | ), 144 | margin: EdgeInsets.symmetric(vertical: _gridGapWidth), 145 | child: Row( 146 | children: Constant.CateItems.map((item){ 147 | return Expanded( 148 | child: FlatButton( 149 | padding: const EdgeInsets.all(0), 150 | onPressed: (){ 151 | RouteUtil.routeToListPage(context,item['title']); 152 | }, 153 | child: Column( 154 | mainAxisAlignment: MainAxisAlignment.center, 155 | children: [ 156 | Container( 157 | width: 38, 158 | height: 38, 159 | decoration: BoxDecoration( 160 | gradient: LinearGradient( 161 | colors: [Color(item['colors'][0]),Color(item['colors'][1])], 162 | begin: Alignment.topCenter, 163 | end: Alignment.bottomCenter 164 | ), 165 | borderRadius: BorderRadius.circular(19) 166 | ), 167 | child: Icon( 168 | IconData(item['icon'],fontFamily: 'iconfont'), 169 | size: 26, 170 | color: WColors.color_ff, 171 | ), 172 | ), 173 | Text(item['title'],style: TextStyle( 174 | fontSize: 14, 175 | color: WColors.color_ff, 176 | fontWeight: FontWeight.bold 177 | )) 178 | ], 179 | ), 180 | ) 181 | ); 182 | }).toList(), 183 | ), 184 | ), 185 | ); 186 | } 187 | 188 | SliverGrid _getGridViewWidget(BuildContext context, List _hotItems) { 189 | 190 | double itemWidth = (UiUtil.getDeviceWidth(context) - _gridGapWidth*4)/3; 191 | return SliverGrid( 192 | gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( 193 | crossAxisCount: 3, 194 | mainAxisSpacing: _gridGapWidth, 195 | crossAxisSpacing: _gridGapWidth, 196 | childAspectRatio: 3/5 197 | ), 198 | 199 | delegate: SliverChildBuilderDelegate((context,index){ 200 | HotSubjectsModel model = _hotItems[index]; 201 | return FlatButton( 202 | padding: const EdgeInsets.all(0), 203 | onPressed: (){ 204 | RouteUtil.routeToDetailPage(context, model.id); 205 | }, 206 | child: ClipRRect( 207 | borderRadius: BorderRadius.circular(4), 208 | child: Stack( 209 | children: [ 210 | Positioned( 211 | top: 0,bottom: 0,left: 0,right: 0, 212 | child: Image.network( 213 | model.largeImage, 214 | fit: BoxFit.fill, 215 | ) 216 | ), 217 | Positioned( 218 | bottom: 0, 219 | left: 0, 220 | right: 0, 221 | height: 40, 222 | child: Container( 223 | color: Theme.of(context).primaryColor, 224 | child: Column( 225 | crossAxisAlignment: CrossAxisAlignment.center, 226 | mainAxisAlignment: MainAxisAlignment.center, 227 | children: [ 228 | Container( 229 | width: itemWidth, 230 | child: Text( 231 | model.title, 232 | textAlign: TextAlign.center, 233 | style: BaseStyle.textStyleWhite(12), 234 | overflow: TextOverflow.ellipsis, 235 | maxLines: 1, 236 | ), 237 | ), 238 | BaseStyle.starWidgetAndText(model.ratingAverage, 14,true) 239 | ] 240 | ), 241 | ) 242 | ) 243 | ], 244 | ), 245 | ) 246 | ); 247 | },childCount: _hotItems.length), 248 | ); 249 | } 250 | 251 | } 252 | 253 | class _BannerWidget extends StatelessWidget { 254 | 255 | final List _hotItems; 256 | 257 | _BannerWidget(this._hotItems); 258 | 259 | List _getDotView(int activeIndex) { 260 | int tempIndex = 4; 261 | return _hotItems.map((model){ 262 | tempIndex = tempIndex - 1; 263 | return Container( 264 | width: 16, 265 | height: 2, 266 | margin: const EdgeInsets.symmetric(horizontal: 2), 267 | decoration: BoxDecoration( 268 | color: activeIndex == tempIndex ? WColors.color_ff : WColors.color_66, 269 | ), 270 | ); 271 | }).toList(); 272 | } 273 | 274 | @override 275 | Widget build(BuildContext context) { 276 | 277 | //限制行数和越界问题 278 | double bannerLeftWidth = UiUtil.getDeviceWidth(context) - 10*2 - 12*3 - 178*0.68; 279 | 280 | return Container( 281 | height: 200, 282 | child: Swiper( 283 | itemCount: _hotItems.length, 284 | itemBuilder: (BuildContext context,int index){ 285 | HotSubjectsModel _model = _hotItems[index]; 286 | return FlatButton( 287 | padding: const EdgeInsets.all(0), 288 | onPressed: (){ 289 | RouteUtil.routeToDetailPage(context, _model.id); 290 | }, 291 | child: Container( 292 | decoration: BoxDecoration( 293 | borderRadius: BorderRadius.circular(6), 294 | color: Theme.of(context).primaryColor 295 | ), 296 | child: Row( 297 | children: [ 298 | Padding( 299 | padding: const EdgeInsets.symmetric(horizontal: 12), 300 | child: BaseStyle.clipRRectImg(_model.largeImage, 178*0.68, 178, 4) 301 | ), 302 | Padding( 303 | padding: const EdgeInsets.symmetric(vertical: 12), 304 | child: Column( 305 | mainAxisAlignment: MainAxisAlignment.spaceAround, 306 | crossAxisAlignment: CrossAxisAlignment.start, 307 | children: [ 308 | BaseStyle.limitLineText(bannerLeftWidth, _model.title, BaseStyle.textStyleWhite(16), 1), 309 | Row( 310 | children: [ 311 | BaseStyle.clipOvalImg(_model.avatarsSmall, 26), 312 | Padding( 313 | padding: const EdgeInsets.only(left: 10), 314 | child: BaseStyle.limitLineText(bannerLeftWidth - 36 , _model.directorsName, BaseStyle.textStyleWhite(14),1), 315 | ) 316 | ], 317 | ), 318 | BaseStyle.limitLineText(bannerLeftWidth, '主演: '+_model.castNames, BaseStyle.textStyleWhite(14), 2), 319 | BaseStyle.limitLineText(bannerLeftWidth, _model.collectCount.toString()+" 看过" , BaseStyle.textStyleWhite(14), 1), 320 | BaseStyle.starWidgetAndText(_model.ratingAverage, 20) 321 | ], 322 | ), 323 | ) 324 | ], 325 | ), 326 | ) 327 | ); 328 | }, 329 | autoplay: true, 330 | autoplayDelay: 4000, 331 | duration: 100, //圆角过度很丑,减到人察觉不到的时间差 332 | pagination: SwiperCustomPagination( 333 | builder:(BuildContext context, SwiperPluginConfig config){ 334 | return Container( 335 | alignment: Alignment.bottomRight, 336 | padding: const EdgeInsets.all(10), 337 | child: Row( 338 | textDirection: TextDirection.rtl, 339 | children: _getDotView(config.activeIndex), 340 | ) 341 | ); 342 | }, 343 | ), 344 | ), 345 | ); 346 | } 347 | 348 | } -------------------------------------------------------------------------------- /lib/pages/photo_detail_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mung_flutter/data/net/http_base.dart'; 3 | import 'package:mung_flutter/data/net/http_movie.dart'; 4 | import 'package:mung_flutter/model/loading_state.dart'; 5 | import 'package:mung_flutter/style/base_style.dart'; 6 | import 'package:mung_flutter/model/stills_model.dart'; 7 | import 'package:mung_flutter/widget/loading_widget.dart'; 8 | import 'package:photo_view/photo_view.dart'; 9 | import 'package:mung_flutter/style/colors.dart'; 10 | 11 | class PhotoDetailPage extends StatefulWidget { 12 | 13 | final int count; 14 | final String id; 15 | 16 | PhotoDetailPage({this.id,this.count}); 17 | 18 | @override 19 | State createState() { 20 | return PhotoDetailState(id: this.id,count: this.count); 21 | } 22 | 23 | } 24 | 25 | class PhotoDetailState extends State with SingleTickerProviderStateMixin{ 26 | 27 | final int count; 28 | final String id; 29 | LoadingState _loadingState = LoadingState.Loading; 30 | List _stillItems = []; 31 | int _curPage = 1; 32 | AnimationController _animationController; 33 | Animation _animation; 34 | 35 | PhotoDetailState({this.id,this.count}); 36 | 37 | @override 38 | void initState() { 39 | super.initState(); 40 | 41 | _animationController = AnimationController( 42 | vsync: this, 43 | duration: const Duration(milliseconds: 600), 44 | ); 45 | _animation = Tween(begin: 0.0,end: 1.0) 46 | .animate(_animationController) 47 | ..addListener((){ 48 | setState(() {}); 49 | }); 50 | 51 | _requestData(); 52 | } 53 | 54 | @override 55 | void dispose() { 56 | _animationController.dispose(); 57 | super.dispose(); 58 | } 59 | 60 | @override 61 | Widget build(BuildContext context) { 62 | 63 | if (_stillItems.length == 0) { 64 | return LoadingWidget(_loadingState,this._requestData); 65 | } 66 | 67 | return Scaffold( 68 | appBar: AppBar( 69 | leading: BaseStyle.getIconFontButton(0xeb09,() => Navigator.pop(context)), 70 | title: Text("${this._curPage}/${_stillItems.length}",style: BaseStyle.textStyleWhite(18)), 71 | centerTitle: false, 72 | ), 73 | body: Transform.scale( 74 | scale: _animation.value, 75 | child: Container( 76 | child: PageView.builder( 77 | itemCount: _stillItems.length, 78 | onPageChanged: (int curPage) { 79 | setState(() { 80 | _curPage = _curPage+1; 81 | }); 82 | }, 83 | itemBuilder: (BuildContext context,int index){ 84 | return PhotoView( 85 | backgroundDecoration: BoxDecoration( 86 | color: WColors.color_f5, 87 | ), 88 | imageProvider: NetworkImage(_stillItems[index].image,) 89 | ); 90 | } 91 | ), 92 | ) 93 | ), 94 | ); 95 | } 96 | 97 | _requestData() { 98 | 99 | setState(() { 100 | _loadingState = LoadingState.Loading; 101 | }); 102 | 103 | HttpMovie.requestMoviePhotos(this.id, this.count) 104 | .then((result){ 105 | StillsModel stillsModel = StillsModel.fromJson(result); 106 | if (stillsModel.code == CODE_SUCCESS && stillsModel.stillItems != null) { 107 | setState(() { 108 | _loadingState = LoadingState.Loading; 109 | _stillItems = stillsModel.stillItems; 110 | }); 111 | _animationController.forward(); 112 | } else { 113 | setState(() { 114 | _loadingState = LoadingState.Error; 115 | }); 116 | } 117 | }); 118 | } 119 | 120 | } -------------------------------------------------------------------------------- /lib/pages/search_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mung_flutter/style/base_style.dart'; 3 | import 'package:mung_flutter/data/const/constant.dart'; 4 | import 'package:mung_flutter/utils/ui_util.dart'; 5 | import 'package:mung_flutter/style/colors.dart'; 6 | import 'package:mung_flutter/utils/route_util.dart'; 7 | 8 | class SearchPage extends StatefulWidget { 9 | @override 10 | State createState() { 11 | return SearchState(); 12 | } 13 | } 14 | 15 | class SearchState extends State { 16 | 17 | TextEditingController _inputController; 18 | 19 | @override 20 | void initState() { 21 | super.initState(); 22 | _inputController = TextEditingController(); 23 | } 24 | 25 | @override 26 | void dispose() { 27 | _inputController.dispose(); 28 | super.dispose(); 29 | } 30 | 31 | @override 32 | Widget build(BuildContext context) { 33 | 34 | final recommendWidth = UiUtil.getDeviceWidth(context)/4; 35 | 36 | return Scaffold( 37 | appBar: AppBar( 38 | leading: BaseStyle.getIconFontButton(0xeb09,() => Navigator.pop(context)), 39 | title: Container( 40 | height: 40, 41 | child: TextField( 42 | autofocus: true, 43 | controller: _inputController, 44 | decoration: InputDecoration( 45 | hintText: "演员/电影名/类型/关键字", 46 | hintStyle: TextStyle(fontSize: 14,color: WColors.color_9d), 47 | fillColor: WColors.color_ff, 48 | filled: true, 49 | border: OutlineInputBorder( 50 | borderRadius: BorderRadius.circular(20), 51 | ), 52 | contentPadding: const EdgeInsets.symmetric(vertical: 10,horizontal: 20), 53 | ), 54 | maxLines: 1, 55 | cursorColor: Theme.of(context).primaryColor, 56 | style: TextStyle(fontSize: 14,color: WColors.color_66), 57 | ), 58 | ), 59 | centerTitle: true, 60 | actions: [BaseStyle.getIconFontButton(0xeafe, _searchRequest)], 61 | ), 62 | body: Padding( 63 | padding: const EdgeInsets.only(top: 20), 64 | child: Wrap( 65 | children: Constant.RecommendItems.map((item){ 66 | return Container( 67 | width: recommendWidth, 68 | height: 50, 69 | padding: const EdgeInsets.all(10), 70 | child: ClipRRect( 71 | borderRadius: BorderRadius.circular(15), 72 | child: FlatButton( 73 | padding: const EdgeInsets.all(0), 74 | onPressed: (){ 75 | FocusScope.of(context).requestFocus(FocusNode()); // 取消键盘 76 | _inputController.value = TextEditingValue(text: item); 77 | _searchRequest(); 78 | }, 79 | color: WColors.color_ff, 80 | child: Text(item,style: TextStyle(fontSize: 16,color: WColors.color_9d)) 81 | ), 82 | ), 83 | ); 84 | }).toList(), 85 | ), 86 | ), 87 | ); 88 | } 89 | 90 | _searchRequest() { 91 | final String text = _inputController.value.text; 92 | if (text.length == 0) { 93 | return; 94 | } 95 | RouteUtil.routeToListPage(context, text); 96 | } 97 | 98 | } -------------------------------------------------------------------------------- /lib/pages/theme_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mung_flutter/data/const/constant.dart'; 3 | import 'package:mung_flutter/style/base_style.dart'; 4 | import 'package:mung_flutter/utils/ui_util.dart'; 5 | import 'package:mung_flutter/bloc/theme_bloc.dart'; 6 | import 'package:mung_flutter/style/colors.dart'; 7 | 8 | class ThemePage extends StatefulWidget { 9 | @override 10 | State createState() { 11 | return ThemeState(); 12 | } 13 | } 14 | 15 | class ThemeState extends State with SingleTickerProviderStateMixin{ 16 | 17 | AnimationController _animationController; 18 | Animation _animation; 19 | 20 | @override 21 | void initState() { 22 | super.initState(); 23 | 24 | final int itemLength = Constant.ThemeItems.length; 25 | 26 | _animationController = AnimationController( 27 | vsync: this, 28 | duration: Duration(milliseconds: itemLength*300), 29 | ); 30 | _animation = Tween(begin: 0.0,end: itemLength.toDouble()) 31 | .animate(_animationController) 32 | ..addListener((){ 33 | setState(() {}); 34 | }); 35 | _animationController.forward(); 36 | } 37 | 38 | @override 39 | void dispose() { 40 | _animationController.dispose(); 41 | super.dispose(); 42 | } 43 | 44 | @override 45 | Widget build(BuildContext context) { 46 | // 间隙 47 | const _gridSpacing = 8.0; 48 | 49 | return Scaffold( 50 | 51 | appBar: AppBar( 52 | leading: BaseStyle.getIconFontButton(0xeb09,() => Navigator.pop(context)), 53 | title: Text("主题",style: BaseStyle.textStyleWhite(18)), 54 | centerTitle: true, 55 | ), 56 | body: Container( 57 | padding: const EdgeInsets.all(_gridSpacing), 58 | child: GridView.builder( 59 | gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( 60 | childAspectRatio: 5/6, 61 | crossAxisSpacing: _gridSpacing, 62 | mainAxisSpacing: _gridSpacing, 63 | crossAxisCount: 3, 64 | ), 65 | itemCount: Constant.ThemeItems.length, 66 | itemBuilder: (context,index) { 67 | 68 | final _themeModel = Constant.ThemeItems[index]; 69 | 70 | final animateValue = _getScaleValue(index); 71 | 72 | return Opacity( 73 | opacity: animateValue, 74 | child: Transform.scale( 75 | scale: animateValue, 76 | child: FlatButton( 77 | padding: EdgeInsets.all(0), 78 | onPressed: () { 79 | ThemeProvider.of(context).changeTheme(_themeModel['color']); 80 | Navigator.pop(context); 81 | }, 82 | child: Column( 83 | children: [ 84 | Expanded( 85 | child: Container( 86 | decoration: BoxDecoration( 87 | color: Color(_themeModel['color']), 88 | borderRadius: BorderRadius.only( 89 | topLeft: Radius.elliptical(4, 4), 90 | topRight: Radius.elliptical(4, 4) 91 | ) 92 | ), 93 | ), 94 | ), 95 | Container( 96 | height: 40, 97 | alignment: Alignment.center, 98 | color: WColors.color_ff, 99 | child: Text( 100 | _themeModel['name'], 101 | style: TextStyle( 102 | fontSize: 14.0, 103 | color: Color(_themeModel['color']), 104 | fontWeight: FontWeight.bold 105 | ), 106 | ), 107 | ) 108 | ], 109 | ), 110 | ), 111 | ), 112 | ); 113 | } 114 | ), 115 | ), 116 | ); 117 | } 118 | 119 | double _getScaleValue(int index) { 120 | double value = _animation.value; 121 | if (value > index && value < index + 1) { 122 | return value - index; 123 | } else if (value >= index + 1) { 124 | return 1.0; 125 | } 126 | return 0.0; 127 | } 128 | 129 | } -------------------------------------------------------------------------------- /lib/style/base_style.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mung_flutter/style/colors.dart'; 3 | import 'package:smooth_star_rating/smooth_star_rating.dart'; 4 | 5 | class BaseStyle { 6 | 7 | static TextStyle textStyleWhite(double fontSize,[bool isBold = false]) { 8 | return TextStyle(fontSize: fontSize,color: WColors.color_ff,fontWeight: isBold ? FontWeight.bold : FontWeight.normal); 9 | } 10 | 11 | // 带小圆角图片 12 | static Widget clipRRectImg(url,double width,double height,double border) { 13 | return ClipRRect( 14 | borderRadius: BorderRadius.circular(border), 15 | child: Image.network( 16 | url, 17 | width: width, 18 | height: height, 19 | fit: BoxFit.fill, 20 | ), 21 | ); 22 | } 23 | 24 | // 圆角图片 25 | static Widget clipOvalImg(url,double size) { 26 | return ClipOval( 27 | child: Image.network( 28 | url, 29 | width: size, 30 | height: size, 31 | fit: BoxFit.fill, 32 | ), 33 | ); 34 | } 35 | 36 | // 行数限制的Text 37 | static Widget limitLineText(double width,String text, TextStyle textStyle,int maxLines) { 38 | return Container( 39 | width: width, 40 | child: Text( 41 | text, 42 | style: textStyle, 43 | overflow: TextOverflow.ellipsis, 44 | maxLines: maxLines, 45 | ), 46 | ); 47 | } 48 | 49 | // 星级 50 | static Widget starWidgetAndText(double ratingAverage,double size,[bool isCenter = false]) { 51 | return Row( 52 | crossAxisAlignment: CrossAxisAlignment.center, 53 | mainAxisAlignment: isCenter ? MainAxisAlignment.center : MainAxisAlignment.start, 54 | children: [ 55 | SmoothStarRating( 56 | allowHalfRating: true, 57 | starCount: 5, 58 | rating: ratingAverage/2, 59 | size: size, 60 | color: WColors.color_fc3, 61 | borderColor: WColors.color_e6, 62 | ), 63 | Padding(padding: const EdgeInsets.only(left: 10,top: 3), 64 | child: Text(ratingAverage.toString(), 65 | style: TextStyle(fontSize: 14, color: WColors.color_fc3) 66 | ), 67 | ) 68 | ], 69 | ); 70 | } 71 | 72 | static Widget starWidget(double ratingAverage,double size) { 73 | return SmoothStarRating( 74 | allowHalfRating: true, 75 | starCount: 5, 76 | rating: ratingAverage/2, 77 | size: size, 78 | color: WColors.color_fc3, 79 | borderColor: WColors.color_e6, 80 | ); 81 | } 82 | 83 | 84 | 85 | // IconFont 按钮统一管理 86 | static Widget getIconFontButton(iconFontData,_onPressed) { 87 | return IconButton( 88 | icon: Icon( 89 | IconData(iconFontData,fontFamily: 'iconfont'), 90 | size: 28, 91 | ), 92 | color: Color(0xffffffff), 93 | onPressed: _onPressed 94 | ); 95 | } 96 | 97 | } -------------------------------------------------------------------------------- /lib/style/colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class WColors { 4 | 5 | static const color_ff = Color(0xffffffff); 6 | static const color_f5 = Color(0xfff5f5f5); 7 | static const color_fc3 = Color(0xffFFCC33); 8 | static const color_9d = Color(0xff9d9d9d); 9 | static const color_e6 = Color(0xffe6e6e6); 10 | static const color_66 = Color(0xff666666); 11 | 12 | 13 | } -------------------------------------------------------------------------------- /lib/utils/route_util.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mung_flutter/pages/detail_page.dart'; 3 | import 'package:mung_flutter/pages/theme_page.dart'; 4 | import 'package:mung_flutter/pages/photo_detail_page.dart'; 5 | import 'package:mung_flutter/pages/list_page.dart'; 6 | import 'package:mung_flutter/pages/search_page.dart'; 7 | 8 | class RouteUtil { 9 | 10 | static void routeToThemePage(BuildContext context) { 11 | Navigator.of(context).push( 12 | MaterialPageRoute( 13 | builder: (context){ 14 | return ThemePage(); 15 | } 16 | ) 17 | ); 18 | } 19 | 20 | static void routeToDetailPage(BuildContext context,String id) { 21 | Navigator.of(context).push( 22 | MaterialPageRoute( 23 | builder: (context){ 24 | return DetailPage(id: id); 25 | } 26 | ) 27 | ); 28 | } 29 | 30 | static void routeToPhotoDetailPage(BuildContext context, String id,int count) { 31 | Navigator.of(context).push( 32 | MaterialPageRoute( 33 | builder: (context){ 34 | return PhotoDetailPage(id: id,count: count); 35 | } 36 | ) 37 | ); 38 | } 39 | 40 | static void routeToListPage(BuildContext context, String title) { 41 | Navigator.of(context).push( 42 | MaterialPageRoute( 43 | builder: (context){ 44 | return ListPage(title: title); 45 | } 46 | ) 47 | ); 48 | } 49 | 50 | static void routeToSearchPage(BuildContext context) { 51 | Navigator.of(context).push( 52 | MaterialPageRoute( 53 | builder: (context){ 54 | return SearchPage(); 55 | } 56 | ) 57 | ); 58 | } 59 | 60 | } -------------------------------------------------------------------------------- /lib/utils/sp_util.dart: -------------------------------------------------------------------------------- 1 | import 'package:shared_preferences/shared_preferences.dart'; 2 | 3 | // 存储主题色 4 | class SPUtil { 5 | 6 | static const _THEME_COLOR_KEY = 'THEME_COLOR_KEY'; 7 | static setThemeColor(int themeColor) async { 8 | SharedPreferences sp = await SharedPreferences.getInstance(); 9 | sp.setInt(_THEME_COLOR_KEY,themeColor) ; 10 | } 11 | static getThemeColor() async { 12 | SharedPreferences sp = await SharedPreferences.getInstance(); 13 | return sp.getInt(_THEME_COLOR_KEY); 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /lib/utils/ui_util.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class UiUtil { 4 | 5 | static double getSafeBottomPadding(BuildContext context) { 6 | return MediaQuery.of(context).padding.bottom; 7 | } 8 | 9 | static double getSafeTopPadding(BuildContext context) { 10 | return MediaQuery.of(context).padding.top; 11 | } 12 | 13 | static double getDeviceWidth(BuildContext context) { 14 | return MediaQuery.of(context).size.width; 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /lib/widget/loading_footer_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:mung_flutter/model/loading_state.dart'; 3 | import 'package:flutter_spinkit/flutter_spinkit.dart'; 4 | 5 | const loadingFooterHeight = 48.0; 6 | 7 | class LoadingFooterWidget extends StatelessWidget { 8 | 9 | final LoadingState _loadingState; 10 | final VoidCallback reLoad; 11 | 12 | LoadingFooterWidget(this._loadingState,this.reLoad); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | 17 | if (_loadingState == LoadingState.Error || 18 | _loadingState == LoadingState.NoMore) { 19 | 20 | return Container( 21 | height: loadingFooterHeight, 22 | child: FlatButton( 23 | onPressed: () { 24 | if (_loadingState == LoadingState.Error) this.reLoad(); 25 | }, 26 | child: Row( 27 | mainAxisAlignment: MainAxisAlignment.center, 28 | children: [ 29 | Visibility( 30 | child: Icon( 31 | IconData(0xe639,fontFamily: 'iconfont'), 32 | size: 32, 33 | color: Theme.of(context).primaryColor, 34 | ), 35 | visible: _loadingState == LoadingState.Error, 36 | ), 37 | Padding( 38 | padding: const EdgeInsets.only(left: 18), 39 | child: Text( 40 | _loadingState == LoadingState.Error ? "重新加载" : "没有更多了~", 41 | style: TextStyle( 42 | color: Theme.of(context).primaryColor, 43 | fontSize: 18, 44 | fontWeight: FontWeight.bold, 45 | decoration: TextDecoration.none 46 | ) 47 | ), 48 | ) 49 | ], 50 | ), 51 | ), 52 | ); 53 | } 54 | 55 | return Container( 56 | height: loadingFooterHeight, 57 | child: Row( 58 | mainAxisAlignment: MainAxisAlignment.center, 59 | children: [ 60 | SpinKitPouringHourglass( 61 | color: Theme.of(context).primaryColor, 62 | size: 32, 63 | ), 64 | Padding( 65 | padding: const EdgeInsets.only(left: 18), 66 | child: Text("飞速加载中",style: TextStyle( 67 | color: Theme.of(context).primaryColor, 68 | fontSize: 18, 69 | fontWeight: FontWeight.bold, 70 | decoration: TextDecoration.none 71 | )), 72 | ) 73 | ], 74 | ), 75 | ); 76 | 77 | } 78 | 79 | } -------------------------------------------------------------------------------- /lib/widget/loading_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_spinkit/flutter_spinkit.dart'; 3 | import 'package:mung_flutter/style/colors.dart'; 4 | import 'package:mung_flutter/model/loading_state.dart'; 5 | 6 | class LoadingWidget extends StatelessWidget { 7 | 8 | final LoadingState _loadingState; 9 | final VoidCallback reLoad; 10 | 11 | LoadingWidget(this._loadingState,this.reLoad); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | 16 | if (_loadingState == LoadingState.Error || 17 | _loadingState == LoadingState.NoMore) { 18 | return Container( 19 | color: WColors.color_e6, 20 | child: RaisedButton( 21 | onPressed: () { 22 | if (_loadingState == LoadingState.Error) this.reLoad(); 23 | }, 24 | child: Center( 25 | child: Column( 26 | mainAxisAlignment: MainAxisAlignment.center, 27 | children: [ 28 | Icon( 29 | IconData(0xe639,fontFamily: 'iconfont'), 30 | size: 40, 31 | color: Theme.of(context).primaryColor, 32 | ), 33 | Padding( 34 | padding: const EdgeInsets.only(top: 18), 35 | child: Text( 36 | _loadingState == LoadingState.Error ? "重新加载" : '没有数据', 37 | style: TextStyle( 38 | color: Theme.of(context).primaryColor, 39 | fontSize: 18, 40 | fontWeight: FontWeight.bold, 41 | decoration: TextDecoration.none 42 | ) 43 | ), 44 | ) 45 | ], 46 | ), 47 | ), 48 | ), 49 | ); 50 | } 51 | 52 | return Container( 53 | color: WColors.color_e6, 54 | child: Column( 55 | mainAxisAlignment: MainAxisAlignment.center, 56 | crossAxisAlignment: CrossAxisAlignment.center, 57 | children: [ 58 | SpinKitPouringHourglass( 59 | color: Theme.of(context).primaryColor, 60 | size: 40, 61 | ), 62 | Padding( 63 | padding: const EdgeInsets.only(top: 18), 64 | child: Text("飞速加载中",style: TextStyle( 65 | color: Theme.of(context).primaryColor, 66 | fontSize: 18, 67 | fontWeight: FontWeight.bold, 68 | decoration: TextDecoration.none 69 | )), 70 | ) 71 | ], 72 | ), 73 | ); 74 | 75 | } 76 | 77 | } -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://www.dartlang.org/tools/pub/glossary#lockfile 3 | packages: 4 | after_layout: 5 | dependency: transitive 6 | description: 7 | name: after_layout 8 | url: "https://pub.flutter-io.cn" 9 | source: hosted 10 | version: "1.0.7" 11 | async: 12 | dependency: transitive 13 | description: 14 | name: async 15 | url: "https://pub.flutter-io.cn" 16 | source: hosted 17 | version: "2.1.0" 18 | boolean_selector: 19 | dependency: transitive 20 | description: 21 | name: boolean_selector 22 | url: "https://pub.flutter-io.cn" 23 | source: hosted 24 | version: "1.0.4" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.flutter-io.cn" 30 | source: hosted 31 | version: "1.1.2" 32 | collection: 33 | dependency: transitive 34 | description: 35 | name: collection 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "1.14.11" 39 | cookie_jar: 40 | dependency: transitive 41 | description: 42 | name: cookie_jar 43 | url: "https://pub.flutter-io.cn" 44 | source: hosted 45 | version: "1.0.0" 46 | cupertino_icons: 47 | dependency: "direct main" 48 | description: 49 | name: cupertino_icons 50 | url: "https://pub.flutter-io.cn" 51 | source: hosted 52 | version: "0.1.2" 53 | dio: 54 | dependency: "direct main" 55 | description: 56 | name: dio 57 | url: "https://pub.flutter-io.cn" 58 | source: hosted 59 | version: "2.1.3" 60 | flutter: 61 | dependency: "direct main" 62 | description: flutter 63 | source: sdk 64 | version: "0.0.0" 65 | flutter_page_indicator: 66 | dependency: transitive 67 | description: 68 | name: flutter_page_indicator 69 | url: "https://pub.flutter-io.cn" 70 | source: hosted 71 | version: "0.0.3" 72 | flutter_spinkit: 73 | dependency: "direct main" 74 | description: 75 | name: flutter_spinkit 76 | url: "https://pub.flutter-io.cn" 77 | source: hosted 78 | version: "3.1.0" 79 | flutter_swiper: 80 | dependency: "direct main" 81 | description: 82 | name: flutter_swiper 83 | url: "https://pub.flutter-io.cn" 84 | source: hosted 85 | version: "1.1.6" 86 | flutter_test: 87 | dependency: "direct dev" 88 | description: flutter 89 | source: sdk 90 | version: "0.0.0" 91 | matcher: 92 | dependency: transitive 93 | description: 94 | name: matcher 95 | url: "https://pub.flutter-io.cn" 96 | source: hosted 97 | version: "0.12.5" 98 | meta: 99 | dependency: transitive 100 | description: 101 | name: meta 102 | url: "https://pub.flutter-io.cn" 103 | source: hosted 104 | version: "1.1.6" 105 | path: 106 | dependency: transitive 107 | description: 108 | name: path 109 | url: "https://pub.flutter-io.cn" 110 | source: hosted 111 | version: "1.6.2" 112 | pedantic: 113 | dependency: transitive 114 | description: 115 | name: pedantic 116 | url: "https://pub.flutter-io.cn" 117 | source: hosted 118 | version: "1.5.0" 119 | photo_view: 120 | dependency: "direct main" 121 | description: 122 | name: photo_view 123 | url: "https://pub.flutter-io.cn" 124 | source: hosted 125 | version: "0.3.3" 126 | quiver: 127 | dependency: transitive 128 | description: 129 | name: quiver 130 | url: "https://pub.flutter-io.cn" 131 | source: hosted 132 | version: "2.0.2" 133 | rxdart: 134 | dependency: "direct main" 135 | description: 136 | name: rxdart 137 | url: "https://pub.flutter-io.cn" 138 | source: hosted 139 | version: "0.22.0" 140 | shared_preferences: 141 | dependency: "direct main" 142 | description: 143 | name: shared_preferences 144 | url: "https://pub.flutter-io.cn" 145 | source: hosted 146 | version: "0.5.2" 147 | sky_engine: 148 | dependency: transitive 149 | description: flutter 150 | source: sdk 151 | version: "0.0.99" 152 | smooth_star_rating: 153 | dependency: "direct main" 154 | description: 155 | name: smooth_star_rating 156 | url: "https://pub.flutter-io.cn" 157 | source: hosted 158 | version: "1.0.2" 159 | source_span: 160 | dependency: transitive 161 | description: 162 | name: source_span 163 | url: "https://pub.flutter-io.cn" 164 | source: hosted 165 | version: "1.5.5" 166 | stack_trace: 167 | dependency: transitive 168 | description: 169 | name: stack_trace 170 | url: "https://pub.flutter-io.cn" 171 | source: hosted 172 | version: "1.9.3" 173 | stream_channel: 174 | dependency: transitive 175 | description: 176 | name: stream_channel 177 | url: "https://pub.flutter-io.cn" 178 | source: hosted 179 | version: "2.0.0" 180 | string_scanner: 181 | dependency: transitive 182 | description: 183 | name: string_scanner 184 | url: "https://pub.flutter-io.cn" 185 | source: hosted 186 | version: "1.0.4" 187 | term_glyph: 188 | dependency: transitive 189 | description: 190 | name: term_glyph 191 | url: "https://pub.flutter-io.cn" 192 | source: hosted 193 | version: "1.1.0" 194 | test_api: 195 | dependency: transitive 196 | description: 197 | name: test_api 198 | url: "https://pub.flutter-io.cn" 199 | source: hosted 200 | version: "0.2.4" 201 | transformer_page_view: 202 | dependency: transitive 203 | description: 204 | name: transformer_page_view 205 | url: "https://pub.flutter-io.cn" 206 | source: hosted 207 | version: "0.1.6" 208 | typed_data: 209 | dependency: transitive 210 | description: 211 | name: typed_data 212 | url: "https://pub.flutter-io.cn" 213 | source: hosted 214 | version: "1.1.6" 215 | vector_math: 216 | dependency: transitive 217 | description: 218 | name: vector_math 219 | url: "https://pub.flutter-io.cn" 220 | source: hosted 221 | version: "2.0.8" 222 | sdks: 223 | dart: ">=2.2.0 <3.0.0" 224 | flutter: ">=1.4.7 <2.0.0" 225 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: mung_flutter 2 | description: flutter app 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | version: 1.0.0+1 15 | 16 | environment: 17 | sdk: ">=2.1.0 <3.0.0" 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | # The following adds the Cupertino Icons font to your application. 23 | # Use with the CupertinoIcons class for iOS style icons. 24 | cupertino_icons: ^0.1.2 25 | 26 | # swiper 27 | flutter_swiper: ^1.1.6 28 | # state manager 29 | # scoped_model: ^1.0.1 30 | # stream control tool 31 | rxdart: ^0.22.0 32 | # small data storage 33 | shared_preferences: ^0.5.2 34 | # http 35 | dio: 2.1.3 36 | # star 37 | smooth_star_rating: 1.0.2 38 | # loading 39 | flutter_spinkit: "^3.1.0" 40 | # zoom image 41 | photo_view: ^0.3.3 42 | 43 | dev_dependencies: 44 | flutter_test: 45 | sdk: flutter 46 | 47 | 48 | # For information on the generic Dart part of this file, see the 49 | # following page: https://www.dartlang.org/tools/pub/pubspec 50 | 51 | # The following section is specific to Flutter. 52 | flutter: 53 | 54 | # The following line ensures that the Material Icons font is 55 | # included with your application, so that you can use the icons in 56 | # the material Icons class. 57 | uses-material-design: true 58 | 59 | # iconfont 60 | fonts: 61 | - family: iconfont 62 | fonts: 63 | - asset: lib/data/img/iconfont.ttf 64 | 65 | # To add assets to your application, add an assets section, like this: 66 | # assets: 67 | # - images/a_dot_burr.jpeg 68 | # - images/a_dot_ham.jpeg 69 | 70 | # An image asset can refer to one or more resolution-specific "variants", see 71 | # https://flutter.io/assets-and-images/#resolution-aware. 72 | 73 | # For details regarding adding assets from package dependencies, see 74 | # https://flutter.io/assets-and-images/#from-packages 75 | 76 | # To add custom fonts to your application, add a fonts section here, 77 | # in this "flutter" section. Each entry in this list should have a 78 | # "family" key with the font family name, and a "fonts" key with a 79 | # list giving the asset and other descriptors for the font. For 80 | # example: 81 | # fonts: 82 | # - family: Schyler 83 | # fonts: 84 | # - asset: fonts/Schyler-Regular.ttf 85 | # - asset: fonts/Schyler-Italic.ttf 86 | # style: italic 87 | # - family: Trajan Pro 88 | # fonts: 89 | # - asset: fonts/TrajanPro.ttf 90 | # - asset: fonts/TrajanPro_Bold.ttf 91 | # weight: 700 92 | # 93 | # For details regarding fonts from package dependencies, 94 | # see https://flutter.io/custom-fonts/#from-packages 95 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:mung_flutter/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | --------------------------------------------------------------------------------