From af0ec15a94e6f002b92b83d74e016604c629e64c Mon Sep 17 00:00:00 2001 From: Trover Date: Sun, 1 Aug 2021 13:59:54 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=88=B01.17.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/build.gradle | 8 ++++++++ android/gradle.properties | 1 + lib/util/palette_generator.dart | 6 +++--- pubspec.yaml | 8 +++++--- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index bb8a303..a6f135c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,6 +1,10 @@ buildscript { repositories { google() + mavenCentral() + maven{ url'http://maven.aliyun.com/nexus/content/groups/public/' } + maven{ url'http://maven.aliyun.com/nexus/content/repositories/jcenter'} + maven { url "http://download.flutter.io"} jcenter() } @@ -12,6 +16,10 @@ buildscript { allprojects { repositories { google() + mavenCentral() + maven{ url'http://maven.aliyun.com/nexus/content/groups/public/' } + maven{ url'http://maven.aliyun.com/nexus/content/repositories/jcenter'} + maven { url "http://download.flutter.io"} jcenter() } } diff --git a/android/gradle.properties b/android/gradle.properties index 8bd86f6..7be3d8b 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1 +1,2 @@ org.gradle.jvmargs=-Xmx1536M +android.enableR8=true diff --git a/lib/util/palette_generator.dart b/lib/util/palette_generator.dart index b17e2bd..beeb3f3 100644 --- a/lib/util/palette_generator.dart +++ b/lib/util/palette_generator.dart @@ -58,7 +58,7 @@ import 'package:flutter/painting.dart'; /// * [PaletteTarget], to be able to create your own target color types. /// * [PaletteFilter], a function signature for filtering the allowed colors /// in the palette. -class PaletteGenerator extends Diagnosticable { +class PaletteGenerator with Diagnosticable { /// Create a [PaletteGenerator] from a set of paletteColors and targets. /// /// The usual way to create a [PaletteGenerator] is to use the asynchronous @@ -372,7 +372,7 @@ class PaletteGenerator extends Diagnosticable { /// See also: /// /// * [PaletteGenerator], a class for selecting color palettes from images. -class PaletteTarget extends Diagnosticable { +class PaletteTarget with Diagnosticable { /// Creates a [PaletteTarget] for custom palette selection. /// /// None of the arguments can be null. @@ -600,7 +600,7 @@ typedef _ContrastCalculator = double Function(Color a, Color b, int alpha); /// See also: /// /// * [PaletteGenerator], a class for selecting color palettes from images. -class PaletteColor extends Diagnosticable { +class PaletteColor with Diagnosticable { /// Generate a [PaletteColor]. /// /// The `color` and `population` parameters must not be null. diff --git a/pubspec.yaml b/pubspec.yaml index 59d8789..58fcc08 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,7 +24,7 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: 0.1.2 - flutter_cache_manager: 1.1.0 + flutter_cache_manager: 1.2.0 # palette_generator: 0.1.1 @@ -38,9 +38,11 @@ dependencies: fluttertoast: 3.0.4 - cached_network_image: 1.1.0 + cached_network_image: 2.2.0 - shared_preferences: 0.5.3+2 + shared_preferences: 0.5.6 + + palette_generator: 0.2.2 dev_dependencies: flutter_test: From 4d203c27ab0303b2e331dec21534365648a5c510 Mon Sep 17 00:00:00 2001 From: Trover Date: Sun, 1 Aug 2021 16:48:11 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=8D=87=E7=BA=A7flutter=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=B8=BA1.20.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 122 +++++++++--------- android/.gitignore | 11 ++ android/app/build.gradle | 11 +- android/app/src/main/AndroidManifest.xml | 33 +++-- .../com/example/doubanapp/MainActivity.java | 13 -- .../com/example/doubanapp/MainActivity.kt | 6 + android/app/src/main/res/values/styles.xml | 10 ++ android/build.gradle | 16 ++- android/gradle.properties | 2 + .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/settings.gradle | 18 +-- lib/pages/home/home_app_bar.dart | 4 +- lib/pages/home/home_page.dart | 7 +- lib/pages/movie/movie_app_bar.dart | 59 ++++----- pubspec.yaml | 38 +++--- 15 files changed, 189 insertions(+), 163 deletions(-) create mode 100644 android/.gitignore delete mode 100644 android/app/src/main/java/com/example/doubanapp/MainActivity.java create mode 100644 android/app/src/main/kotlin/com/example/doubanapp/MainActivity.kt diff --git a/README.md b/README.md index e20c098..3d53589 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![GitHub stars](https://img.shields.io/github/stars/kaina404/FlutterDouBan.svg)](https://github.com/kaina404/FlutterDouBan/stargazers) [![GitHub forks](https://img.shields.io/github/forks/kaina404/FlutterDouBan.svg)](https://github.com/kaina404/FlutterDouBan/network) -[![GitHub issues](https://img.shields.io/github/issues/kaina404/FlutterDouBan.svg)](https://github.com/kaina404/FlutterDouBan/issues) +[![GitHub issues](https://img.shields.io/github/issues/kaina404/FlutterDouBan.svg)](https://github.com/kaina404/FlutterDouBan/issues) > Flutter SDK (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.13.6 17G2112, locale zh-Hans-CN, Dart SDK : 2.5.0) @@ -16,17 +16,17 @@ **如果您觉得还可以的话,给个Star白~** # 使用Flutter开发一个豆瓣App - + * 此项目,90%还原某瓣APP,所有UI均按照某瓣来实现。 * 项目中的数据均来自豆瓣api真实有效数据 * 项目中用到了几乎所有的Flutter widget * 还有两个比较大的自定义魔改源码实现特效 * 大年初一也在维护的项目 - + > APP中所有数据均为真实数据。但是默认,对于"书影音单个电影tab"的数据,使用模拟数据。因为,频繁的打开关闭APP,会频繁调用 这个接口。接口是有调用限制的,次数过于频繁,会被锁IP。如果想看真实数据,则可以进入 "我的",然后打开"书影音数据来自网络"开关后,重启APP即可。 - + # 下载地址 ## [打开新页面扫码下载](https://upload-images.jianshu.io/upload_images/3884536-d9adbda0e5f61c84.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) #### [Release版本下载地址](https://img.xuvip.top/douya_release.apk) @@ -35,9 +35,9 @@ ![扫一扫下载体验](https://img.xuvip.top/douya.png) - - + + #### Demo(刷不出gif图的,耐心等待一会,或者多刷几次。) ![](https://github.com/kaina404/FlutterDouBan/blob/master-release/0E95A04AE84EFE31104AC8E0A5808CB9.png) ![](https://github.com/kaina404/FlutterDouBan/blob/master-release/041919372752_04CCDD7BC1BDB6015935EE50DDF75C29F.png) @@ -47,33 +47,33 @@ ![](https://github.com/kaina404/FlutterDouBan/blob/master-release/041919381924_01CE541B98F565C72B75567A319271CA1.png) ![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-12-55.gif) - + ![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-13-11.gif) - + ![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-17-38.gif) - + ![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-17-48.gif) - + ![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-18-03.gif) - + ![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-18-12.gif) - -![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-18-23.gif) - -![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-30-58.gif) - -![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-31-13.gif) - -![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-32-29.gif) - -![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-32-41.gif) - -![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-33-02.gif) - - - + +![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-18-23.gif) + +![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-30-58.gif) + +![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-31-13.gif) + +![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-32-29.gif) + +![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-32-41.gif) + +![demo1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/demogif/Mar-10-2019%2014-33-02.gif) + + + # dev-open - + ### 大家可以向这个分支根据豆瓣UI做设计稿,提交代码 * 这个分支供广大Flutter开发者来学习Flutter @@ -81,80 +81,80 @@ * 在此豆芽APP的首页实现与影片详情的UI特效,基于魔改Flutter源码。有兴趣可以看看 * 大家想实战自己的Flutter能力,可以将某瓣APP作为设计稿,完成需求,并提交 * 每位开发者提交的代码,我都会在文档中进行备注 - + #### 注意!!!建议使用模拟数据(mock_request.dart) * 每个接口均有一定的调用限制 * *大家pull下的代码,进行测试调试时,对于特定接口,返回的特定数据。尽量不要每次求请求一次。可以请求到一次真实数据后,转成json保存 到本地。然后,自己调试开发的时候,使用这个模拟数据即可。* [可参考mock_request.dart] - - + + # 未来版本计划(欢迎Flutter爱好者前来认领) **欢迎Flutter爱好者共同完成** - + > 涉及到UI,可参考豆瓣。 - + ### 萌新TASK - + * 完成任意一个未实现的按钮 * 完成任意一个未实现的页面 * 优化原有Widget * 爱好者想实现但是未能实现的需求 * More ... - + ### 进阶TASK - + * 优化代码 * 适当缓存数据 * 解决卡顿(可参考:https://flutter-io.cn/docs/testing/ui-performance) * 优化路由(可参考咸鱼方案:https://www.yuque.com/xytech/flutter/vf1dpf) - + ### 老手TASK * [接入rxdart](https://github.com/ReactiveX/rxdart) * [使用Fish Redux 重构](https://www.yuque.com/xytech/flutter/ycc9ni) - - - + + + # 对魔改源码或者喜欢翻源码的童鞋可以看看下面两个 - + * 魔改Flutter AppBar源码实现豆瓣头部特效 - + ![魔改Flutter AppBar源码实现豆瓣头部特效](https://github.com/kaina404/DouBanProject/blob/dev-0.1/%E4%BB%BF%E8%B1%86%E7%93%A3%E5%A4%B4%E9%83%A8.gif) * 魔改源码实现电影详情抽屉特效(GIF图如果加载不出来,多刷几次) - + ![抽屉特效1](https://github.com/kaina404/DouBanProject/blob/dev-0.1/part1.gif) - + ![抽屉特效2](https://github.com/kaina404/DouBanProject/blob/dev-0.1/part2.gif) - + ![抽屉特效3](https://github.com/kaina404/DouBanProject/blob/dev-0.1/part3.gif) - - + + # 页面介绍 - + * 首页 pages/home - + * homo_app_bar.dart 首页导航头 * home_page.dart 首页 * my_home_tab_bar.dart 首页tab - + * 书影音 pages/movie - + * book_audio_video_page.dart 书影音页面 * detail_page.dart 影片、电视详情页面 * person_detail_page.dart 演员页面介绍 * ... 页面都有注释 - + * 小组 pages/group - - * 市集 shop_page.dart + + * 市集 shop_page.dart * 市集的数据使用两个webview - + * 我的 page/person - - + + # 更新记录 @@ -164,7 +164,7 @@ * 优化页面逻辑 * 优化加载速度 - * master + * master * 基本网络请求框架、UI框架 * 已经填入了"最为复杂的电影TAB页面"、影视详情页面、小组页面(UI与豆瓣一致,数据使用的是热映榜) * 页面上下滑动 @@ -173,7 +173,7 @@ * TAB页面滑动 * .... * 作为基本版本,一些逻辑不够完善,有一些bug。 - + # 默认条约 此项目仅供大家交流沟通使用,不得用于任何商业以及利益活动。由此引起的责任,跟我无关。谢谢! @@ -193,7 +193,7 @@ A few resources to get you started if this is your first Flutter project: - [Lab: Write your first Flutter app](https://flutter.io/docs/get-started/codelab) - [Cookbook: Useful Flutter samples](https://flutter.io/docs/cookbook) -For help getting started with Flutter, view our -[online documentation](https://flutter.io/docs), which offers tutorials, +For help getting started with Flutter, view our +[online documentation](https://flutter.io/docs), which offers tutorials, samples, guidance on mobile development, and a full API reference. - + diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000..0a741cb --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,11 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties diff --git a/android/app/build.gradle b/android/app/build.gradle index e7c4d4c..2fa5b28 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -22,23 +22,26 @@ if (flutterVersionName == null) { } apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdkVersion 28 + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + lintOptions { disable 'InvalidPackage' } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.doubanapp" minSdkVersion 16 targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { @@ -55,7 +58,5 @@ flutter { } dependencies { - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 1525414..85402ba 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + + + + android:name="io.flutter.embedding.android.SplashScreenDrawable" + android:resource="@drawable/launch_background" + /> + + diff --git a/android/app/src/main/java/com/example/doubanapp/MainActivity.java b/android/app/src/main/java/com/example/doubanapp/MainActivity.java deleted file mode 100644 index 574f09d..0000000 --- a/android/app/src/main/java/com/example/doubanapp/MainActivity.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.example.doubanapp; - -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } -} diff --git a/android/app/src/main/kotlin/com/example/doubanapp/MainActivity.kt b/android/app/src/main/kotlin/com/example/doubanapp/MainActivity.kt new file mode 100644 index 0000000..848a37f --- /dev/null +++ b/android/app/src/main/kotlin/com/example/doubanapp/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.doubanapp + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index 00fa441..1f83a33 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -1,8 +1,18 @@ + + + diff --git a/android/build.gradle b/android/build.gradle index a6f135c..6ed76e5 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,15 +1,17 @@ buildscript { + ext.kotlin_version = '1.5.20' repositories { google() mavenCentral() - maven{ url'http://maven.aliyun.com/nexus/content/groups/public/' } - maven{ url'http://maven.aliyun.com/nexus/content/repositories/jcenter'} - maven { url "http://download.flutter.io"} + maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } + maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' } + maven { url "http://download.flutter.io" } jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:4.2.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -17,9 +19,9 @@ allprojects { repositories { google() mavenCentral() - maven{ url'http://maven.aliyun.com/nexus/content/groups/public/' } - maven{ url'http://maven.aliyun.com/nexus/content/repositories/jcenter'} - maven { url "http://download.flutter.io"} + maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } + maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' } + maven { url "http://download.flutter.io" } jcenter() } } diff --git a/android/gradle.properties b/android/gradle.properties index 7be3d8b..38c8d45 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,2 +1,4 @@ org.gradle.jvmargs=-Xmx1536M android.enableR8=true +android.useAndroidX=true +android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 2819f02..601e2a7 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip diff --git a/android/settings.gradle b/android/settings.gradle index 5a2f14f..44e62bc 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,15 +1,11 @@ include ':app' -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } -} +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/lib/pages/home/home_app_bar.dart b/lib/pages/home/home_app_bar.dart index 26d263a..ed9e7a1 100644 --- a/lib/pages/home/home_app_bar.dart +++ b/lib/pages/home/home_app_bar.dart @@ -1132,7 +1132,7 @@ class _SliverAppBarState extends State Widget build(BuildContext context) { assert(!widget.primary || debugCheckHasMediaQuery(context)); final double topPadding = 0.0; - final double collapsedHeight = widget.bottom.preferredSize.height + 26.0; + final double collapsedHeight = widget.bottom.preferredSize.height + 26.0; // final collapsedHeight = 80.0; return MediaQuery.removePadding( @@ -1192,7 +1192,7 @@ getWidget() { // This is not necessary if the "headerSliverBuilder" only builds // widgets that do not overlap the next sliver. handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context), - child: SliverAppBar( + sliver: SliverAppBar( pinned: true, expandedHeight: 100.0, primary: false, diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index 117e79f..5f25117 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -38,7 +38,7 @@ DefaultTabController getWidget() { // This is not necessary if the "headerSliverBuilder" only builds // widgets that do not overlap the next sliver. handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context), - child: myapp.SliverAppBar( + sliver: myapp.SliverAppBar( pinned: true, expandedHeight: 120.0, primary: true, @@ -288,15 +288,16 @@ class _SliverContainerState extends State { } getContentVideo(int index) { - if(!mounted){ + if (!mounted) { return Container(); } return VideoWidget( - index == 1 ? Constant.URL_MP4_DEMO_0 : Constant.URL_MP4_DEMO_1, + index == 1 ? Constant.URL_MP4_DEMO_0 : Constant.URL_MP4_DEMO_1, showProgressBar: false, ); } } + ///动态TAB _loginContainer(BuildContext context) { return Align( diff --git a/lib/pages/movie/movie_app_bar.dart b/lib/pages/movie/movie_app_bar.dart index 68146cf..c84a71e 100644 --- a/lib/pages/movie/movie_app_bar.dart +++ b/lib/pages/movie/movie_app_bar.dart @@ -155,7 +155,7 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget { assert(toolbarOpacity != null), assert(bottomOpacity != null), preferredSize = - Size.fromHeight(1.0 + (bottom?.preferredSize?.height ?? 0.0)), + Size.fromHeight(1.0 + (bottom?.preferredSize?.height ?? 0.0)), super(key: key); /// A widget to display before the [title]. @@ -398,8 +398,8 @@ class _AppBarState extends State { if (widget.toolbarOpacity != 1.0) { final double opacity = - const Interval(0.25, 1.0, curve: Curves.fastOutSlowIn) - .transform(widget.toolbarOpacity); + const Interval(0.25, 1.0, curve: Curves.fastOutSlowIn) + .transform(widget.toolbarOpacity); if (centerStyle?.color != null) centerStyle = centerStyle.copyWith(color: centerStyle.color.withOpacity(opacity)); @@ -468,12 +468,12 @@ class _AppBarState extends State { widget.bottomOpacity == 1.0 ? widget.bottom : Opacity( - opacity: const Interval(0.25, 1.0, curve: Curves.fastOutSlowIn) - .transform(widget.bottomOpacity), - child: Container( - height: 46.0, - ), - ), + opacity: const Interval(0.25, 1.0, curve: Curves.fastOutSlowIn) + .transform(widget.bottomOpacity), + child: Container( + height: 46.0, + ), + ), ], ); // } @@ -516,7 +516,7 @@ class _AppBarState extends State { appBarTheme.color ?? themeData.primaryColor, elevation: - widget.elevation ?? appBarTheme.elevation ?? _defaultElevation, + widget.elevation ?? appBarTheme.elevation ?? _defaultElevation, child: Semantics( explicitChildNodes: true, child: appBar, @@ -632,6 +632,7 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate { Color unselectedColor = Color.fromARGB(255, 117, 117, 117); TextStyle selectStyle = TextStyle(fontSize: 18, color: Colors.black); TextStyle unselectedStyle = TextStyle(fontSize: 18, color: Colors.black); + @override double get minExtent => collapsedHeight ?? (topPadding + kToolbarHeight + _bottomHeight); @@ -669,20 +670,20 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate { // 1.0 -> Collapsed to toolbar final double t = (1.0 - - (math.max(minExtent, maxExtent - shrinkOffset) - minExtent) / - deltaExtent) + (math.max(minExtent, maxExtent - shrinkOffset) - minExtent) / + deltaExtent) .clamp(0.0, 1.0); // List<>getTabBarText(bottom); bottom = TabBar( tabs: bottomList .map((item) => Padding( - padding: const EdgeInsets.only(bottom: 5.0), - child: Text( - '$item', - style: TextStyle(fontSize: 15), - ), - )) + padding: const EdgeInsets.only(bottom: 5.0), + child: Text( + '$item', + style: TextStyle(fontSize: 15), + ), + )) .toList(), isScrollable: false, indicatorColor: selectColor, @@ -708,8 +709,8 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate { : flexibleSpace, bottom: bottom, elevation: forceElevated || - overlapsContent || - (pinned && shrinkOffset > maxExtent - minExtent) + overlapsContent || + (pinned && shrinkOffset > maxExtent - minExtent) ? elevation ?? 4.0 : 0.0, backgroundColor: backgroundColor, @@ -721,7 +722,7 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate { titleSpacing: titleSpacing, toolbarOpacity: toolbarOpacity, bottomOpacity: - pinned ? 1.0 : (visibleMainHeight / _bottomHeight).clamp(0.0, 1.0), + pinned ? 1.0 : (visibleMainHeight / _bottomHeight).clamp(0.0, 1.0), ), ); @@ -869,7 +870,7 @@ class SliverAppBar extends StatefulWidget { assert(pinned != null), assert(snap != null), assert(floating || !snap, - 'The "snap" argument only makes sense for floating app bars.'), + 'The "snap" argument only makes sense for floating app bars.'), super(key: key); /// A widget to display before the [title]. @@ -1192,7 +1193,7 @@ getWidget() { // This is not necessary if the "headerSliverBuilder" only builds // widgets that do not overlap the next sliver. handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context), - child: SliverAppBar( + sliver: SliverAppBar( pinned: true, expandedHeight: 100.0, primary: false, @@ -1222,11 +1223,11 @@ getWidget() { // These are the widgets to put in each tab in the tab bar. tabs: _tabs .map((String name) => Container( - child: Text( - name, - ), - padding: const EdgeInsets.only(bottom: 5.0), - )) + child: Text( + name, + ), + padding: const EdgeInsets.only(bottom: 5.0), + )) .toList(), ), ), @@ -1272,7 +1273,7 @@ getWidget() { // ListTile widgets. itemExtent: 48.0, delegate: SliverChildBuilderDelegate( - (BuildContext context, int index) { + (BuildContext context, int index) { // This builder is called for each child. // In this example, we just number each list item. return ListTile( diff --git a/pubspec.yaml b/pubspec.yaml index 58fcc08..af94d1e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,43 +14,39 @@ description: A new Flutter project. version: 1.0.0+1 environment: - sdk: ">=2.1.0 <3.0.0" + sdk: ">=2.7.0 <3.0.0" dependencies: flutter: sdk: flutter + # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: 0.1.2 - - flutter_cache_manager: 1.2.0 + cupertino_icons: ^0.1.3 -# palette_generator: 0.1.1 + flutter_cache_manager: 2.1.0 + cached_network_image: 2.4.1 - flutter_webview_plugin: 0.3.0+2 - - webview_flutter: 0.3.3+1 + flutter_webview_plugin: 0.3.11 + webview_flutter: 0.3.24 video_player: 0.10.0+2 - # 用来模拟网络返回的数据,这些数据是真实的,这里模拟 - dio: 1.0.13 - fluttertoast: 3.0.4 + dio: 3.0.10 - cached_network_image: 2.2.0 + fluttertoast: 7.1.8 - shared_preferences: 0.5.6 + shared_preferences: 0.5.12+4 - palette_generator: 0.2.2 +# palette_generator: dev_dependencies: flutter_test: sdk: flutter - # For information on the generic Dart part of this file, see the -# following page: https://www.dartlang.org/tools/pub/pubspec +# following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter. flutter: @@ -60,8 +56,8 @@ flutter: # the material Icons class. uses-material-design: true assets: - - assets/images/ - - mock/ + - assets/images/ + - mock/ # To add assets to your application, add an assets section, like this: # assets: @@ -69,10 +65,10 @@ flutter: # - images/a_dot_ham.jpeg # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.io/assets-and-images/#resolution-aware. + # https://flutter.dev/assets-and-images/#resolution-aware. # For details regarding adding assets from package dependencies, see - # https://flutter.io/assets-and-images/#from-packages + # https://flutter.dev/assets-and-images/#from-packages # To add custom fonts to your application, add a fonts section here, # in this "flutter" section. Each entry in this list should have a @@ -92,4 +88,4 @@ flutter: # weight: 700 # # For details regarding fonts from package dependencies, - # see https://flutter.io/custom-fonts/#from-packages + # see https://flutter.dev/custom-fonts/#from-packages From eb4ef754c5b18f5445b13a0e8925771980e79e69 Mon Sep 17 00:00:00 2001 From: Trover Date: Sun, 1 Aug 2021 16:48:51 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8D=87=E7=BA=A7flutter=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=B8=BA1.20.1=20=20=20IOS=E4=B8=BA=E5=88=9D=E5=A7=8B=E7=89=88?= =?UTF-8?q?=E6=9C=AC=EF=BC=8C=E9=9C=80=E8=A6=81=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/.gitignore | 32 ++++ ios/Flutter/AppFrameworkInfo.plist | 2 +- ios/Flutter/Debug.xcconfig | 1 - ios/Flutter/Release.xcconfig | 1 - ios/Podfile | 69 -------- ios/Runner.xcodeproj/project.pbxproj | 153 ++++-------------- .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcshareddata/WorkspaceSettings.xcsettings | 8 + .../xcshareddata/xcschemes/Runner.xcscheme | 4 +- .../contents.xcworkspacedata | 3 - .../xcshareddata/WorkspaceSettings.xcsettings | 4 +- ios/Runner/AppDelegate.h | 6 - ios/Runner/AppDelegate.m | 13 -- ios/Runner/AppDelegate.swift | 13 ++ ios/Runner/Runner-Bridging-Header.h | 1 + 15 files changed, 100 insertions(+), 218 deletions(-) create mode 100644 ios/.gitignore delete mode 100644 ios/Podfile create mode 100644 ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings delete mode 100644 ios/Runner/AppDelegate.h delete mode 100644 ios/Runner/AppDelegate.m create mode 100644 ios/Runner/AppDelegate.swift create mode 100644 ios/Runner/Runner-Bridging-Header.h diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 0000000..e96ef60 --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,32 @@ +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index 9367d48..6b4c0f7 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -3,7 +3,7 @@ CFBundleDevelopmentRegion - en + $(DEVELOPMENT_LANGUAGE) CFBundleExecutable App CFBundleIdentifier diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index e8efba1..592ceee 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1,2 +1 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index 399e934..592ceee 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1,2 +1 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Podfile b/ios/Podfile deleted file mode 100644 index d077b08..0000000 --- a/ios/Podfile +++ /dev/null @@ -1,69 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '9.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def parse_KV_file(file, separator='=') - file_abs_path = File.expand_path(file) - if !File.exists? file_abs_path - return []; - end - pods_ary = [] - skip_line_start_symbols = ["#", "/"] - File.foreach(file_abs_path) { |line| - next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } - plugin = line.split(pattern=separator) - if plugin.length == 2 - podname = plugin[0].strip() - path = plugin[1].strip() - podpath = File.expand_path("#{path}", file_abs_path) - pods_ary.push({:name => podname, :path => podpath}); - else - puts "Invalid plugin specification: #{line}" - end - } - return pods_ary -end - -target 'Runner' do - # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock - # referring to absolute paths on developers' machines. - system('rm -rf .symlinks') - system('mkdir -p .symlinks/plugins') - - # Flutter Pods - generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') - if generated_xcode_build_settings.empty? - puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first." - end - generated_xcode_build_settings.map { |p| - if p[:name] == 'FLUTTER_FRAMEWORK_DIR' - symlink = File.join('.symlinks', 'flutter') - File.symlink(File.dirname(p[:path]), symlink) - pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) - end - } - - # Plugin Pods - plugin_pods = parse_KV_file('../.flutter-plugins') - plugin_pods.map { |p| - symlink = File.join('.symlinks', 'plugins', p[:name]) - File.symlink(p[:path], symlink) - pod p[:name], :path => File.join(symlink, 'ios') - } -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - target.build_configurations.each do |config| - config.build_settings['ENABLE_BITCODE'] = 'NO' - end - end -end diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index ecf69cc..f60bd30 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -9,17 +9,10 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - CFFBC44147880970969C2082 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E03A3995F1D9CFDB2F17B08E /* libPods-Runner.a */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -29,8 +22,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -41,23 +32,16 @@ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; - 5D6E35B6F4F5583377BF139E /* 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 = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - CE693A28B7985666FD4A5822 /* 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 = ""; }; - E03A3995F1D9CFDB2F17B08E /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - FD4CA2C5493585B42E415538 /* 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -65,39 +49,16 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, - CFFBC44147880970969C2082 /* libPods-Runner.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 6F9C0F7BF299B8E2401E4D30 /* Pods */ = { - isa = PBXGroup; - children = ( - 5D6E35B6F4F5583377BF139E /* Pods-Runner.debug.xcconfig */, - CE693A28B7985666FD4A5822 /* Pods-Runner.release.xcconfig */, - FD4CA2C5493585B42E415538 /* Pods-Runner.profile.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; - 9033804A29C1FDBD308D6991 /* Frameworks */ = { - isa = PBXGroup; - children = ( - E03A3995F1D9CFDB2F17B08E /* libPods-Runner.a */, - ); - name = Frameworks; - sourceTree = ""; - }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( - 3B80C3931E831B6300D905FE /* App.framework */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 9740EEB31CF90195004384FC /* Generated.xcconfig */, @@ -111,8 +72,6 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - 6F9C0F7BF299B8E2401E4D30 /* Pods */, - 9033804A29C1FDBD308D6991 /* Frameworks */, ); sourceTree = ""; }; @@ -127,27 +86,18 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, ); path = Runner; sourceTree = ""; }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -155,14 +105,12 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - C8E578498927BCEE20F65486 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - DEFC3506D917473443EE6764 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -179,18 +127,18 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0910; - ORGANIZATIONNAME = "The Chromium Authors"; + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; - DevelopmentTeam = HGUXFJ2W6S; + LastSwiftMigration = 1100; }; }; }; buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -213,7 +161,6 @@ files = ( 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, ); @@ -234,7 +181,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; @@ -250,50 +197,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - C8E578498927BCEE20F65486 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - 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"; - showEnvVarsInLog = 0; - }; - DEFC3506D917473443EE6764 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - ); - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -301,8 +204,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -331,7 +233,6 @@ /* Begin XCBuildConfiguration section */ 249021D3217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -343,12 +244,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -372,6 +275,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -382,8 +286,8 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = HGUXFJ2W6S; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -395,15 +299,16 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.kaina.doubanapp; + PRODUCT_BUNDLE_IDENTIFIER = com.example.doubanapp.FlutterDouBan; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Profile; }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -415,12 +320,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -457,7 +364,6 @@ }; 97C147041CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -469,12 +375,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -498,6 +406,8 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -508,8 +418,8 @@ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = HGUXFJ2W6S; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -521,8 +431,11 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.kaina.doubanapp; + PRODUCT_BUNDLE_IDENTIFIER = com.example.doubanapp.FlutterDouBan; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; @@ -532,8 +445,8 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = HGUXFJ2W6S; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -545,8 +458,10 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.kaina.doubanapp; + PRODUCT_BUNDLE_IDENTIFIER = com.example.doubanapp.FlutterDouBan; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = Release; diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 786d6aa..a28140c 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ @@ -46,7 +45,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata index 21a3cc1..1d526a1 100644 --- a/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,7 +4,4 @@ - - diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings index 949b678..f9b0d7c 100644 --- a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -2,7 +2,7 @@ - BuildSystemType - Original + PreviewsEnabled + diff --git a/ios/Runner/AppDelegate.h b/ios/Runner/AppDelegate.h deleted file mode 100644 index 36e21bb..0000000 --- a/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,6 +0,0 @@ -#import -#import - -@interface AppDelegate : FlutterAppDelegate - -@end diff --git a/ios/Runner/AppDelegate.m b/ios/Runner/AppDelegate.m deleted file mode 100644 index 59a72e9..0000000 --- a/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,13 +0,0 @@ -#include "AppDelegate.h" -#include "GeneratedPluginRegistrant.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [GeneratedPluginRegistrant registerWithRegistry:self]; - // Override point for customization after application launch. - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..70693e4 --- /dev/null +++ b/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h"