From 9c25346b93b9ddaebe8bffdb4ae4f8713e9c73fe Mon Sep 17 00:00:00 2001 From: Tecode <283731869@qq.com> Date: Sat, 8 Aug 2020 16:18:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20flutter=E7=89=88=E6=9C=AC=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E5=88=B01.20.x=EF=BC=8C=E5=9B=BE=E7=89=87=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E7=BC=A9=E6=94=BE=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 12 ++-- ios/Flutter/.last_build_id | 2 +- ios/Podfile | 76 +++++------------------- ios/Podfile.lock | 14 +---- ios/Runner.xcodeproj/project.pbxproj | 2 + lib/containers/DiscoveryDetail.dart | 16 +++-- pubspec.lock | 87 ++++++++++------------------ pubspec.yaml | 7 +-- 8 files changed, 71 insertions(+), 145 deletions(-) diff --git a/README.md b/README.md index 7369759..fd17fdf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# Dynamic Theme +# Dynamic Theme(Flutter 1.20.x) + +## [flutter-1.17.x可以运行的版本](https://github.com/Tecode/dynamic_theme/tree/flutter-1.17.x) ## Android版本下载(iOS下载代码打包📦)
@@ -30,10 +32,10 @@
## Flutter version
```bash
-Flutter 1.17.3 • channel stable • https://github.com/flutter/flutter.git
-Framework • revision b041144f83 (5 days ago) • 2020-06-04 09:26:11 -0700
-Engine • revision ee76268252
-Tools • Dart 2.8.4
+Flutter 1.20.1 • channel stable • https://github.com/flutter/flutter.git
+Framework • revision 2ae34518b8 (2 days ago) • 2020-08-05 19:53:19 -0700
+Engine • revision c8e3b94853
+Tools • Dart 2.9.0
```
## Flutter 集成测试
diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id
index 00fb332..fef6e87 100644
--- a/ios/Flutter/.last_build_id
+++ b/ios/Flutter/.last_build_id
@@ -1 +1 @@
-f17dc7e6ed95f4795fbc6c5611df0eb1
\ No newline at end of file
+5577b0c708455cd17103ffcf783689cc
\ No newline at end of file
diff --git a/ios/Podfile b/ios/Podfile
index 6697f0a..1e8c3c9 100644
--- a/ios/Podfile
+++ b/ios/Podfile
@@ -10,78 +10,32 @@ project 'Runner', {
'Release' => :release,
}
-def parse_KV_file(file, separator='=')
- file_abs_path = File.expand_path(file)
- if !File.exists? file_abs_path
- return [];
+def flutter_root
+ generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
+ unless File.exist?(generated_xcode_build_settings_path)
+ raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
- generated_key_values = {}
- skip_line_start_symbols = ["#", "/"]
- File.foreach(file_abs_path) do |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)
- generated_key_values[podname] = podpath
- else
- puts "Invalid plugin specification: #{line}"
- end
+
+ File.foreach(generated_xcode_build_settings_path) do |line|
+ matches = line.match(/FLUTTER_ROOT\=(.*)/)
+ return matches[1].strip if matches
end
- generated_key_values
+ raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
+require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
+
+flutter_ios_podfile_setup
+
target 'Runner' do
use_frameworks!
use_modular_headers!
- # Flutter Pod
-
- copied_flutter_dir = File.join(__dir__, 'Flutter')
- copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
- copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
- unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
- # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
- # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
- # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
-
- generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
- unless File.exist?(generated_xcode_build_settings_path)
- raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
- end
- generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
- cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
-
- unless File.exist?(copied_framework_path)
- FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
- end
- unless File.exist?(copied_podspec_path)
- FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
- end
- end
-
- # Keep pod path relative so it can be checked into Podfile.lock.
- pod 'Flutter', :path => 'Flutter'
-
- # Plugin Pods
-
- # 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')
- plugin_pods = parse_KV_file('../.flutter-plugins')
- plugin_pods.each do |name, path|
- symlink = File.join('.symlinks', 'plugins', name)
- File.symlink(path, symlink)
- pod name, :path => File.join(symlink, 'ios')
- end
+ flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
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
+ flutter_additional_ios_build_settings(target)
end
end
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index acf22b8..bc0798b 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -5,10 +5,6 @@ PODS:
- FMDB/standard (2.7.5)
- path_provider (0.0.1):
- Flutter
- - path_provider_linux (0.0.1):
- - Flutter
- - path_provider_macos (0.0.1):
- - Flutter
- sqflite (0.0.1):
- Flutter
- FMDB (~> 2.7.2)
@@ -18,8 +14,6 @@ PODS:
DEPENDENCIES:
- Flutter (from `Flutter`)
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- - path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
- - path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- uni_links (from `.symlinks/plugins/uni_links/ios`)
@@ -32,10 +26,6 @@ EXTERNAL SOURCES:
:path: Flutter
path_provider:
:path: ".symlinks/plugins/path_provider/ios"
- path_provider_linux:
- :path: ".symlinks/plugins/path_provider_linux/ios"
- path_provider_macos:
- :path: ".symlinks/plugins/path_provider_macos/ios"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
uni_links:
@@ -45,11 +35,9 @@ SPEC CHECKSUMS:
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
- path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
- path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0
sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
-PODFILE CHECKSUM: c34e2287a9ccaa606aeceab922830efb9a6ff69a
+PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
COCOAPODS: 1.8.4
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index fc40efe..70ee6f2 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -373,6 +373,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ DEVELOPMENT_TEAM = XXB3A2BN5T;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -537,6 +538,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ DEVELOPMENT_TEAM = XXB3A2BN5T;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
diff --git a/lib/containers/DiscoveryDetail.dart b/lib/containers/DiscoveryDetail.dart
index 5b7fa4e..3a16e19 100644
--- a/lib/containers/DiscoveryDetail.dart
+++ b/lib/containers/DiscoveryDetail.dart
@@ -30,12 +30,18 @@ class _DiscoveryDetailState extends State