Skip to content

Commit d9ed614

Browse files
committed
chore: updated
1 parent 58979a9 commit d9ed614

File tree

5 files changed

+68
-91
lines changed

5 files changed

+68
-91
lines changed

ios/Podfile

Lines changed: 15 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -10,78 +10,32 @@ project 'Runner', {
1010
'Release' => :release,
1111
}
1212

13-
def parse_KV_file(file, separator='=')
14-
file_abs_path = File.expand_path(file)
15-
if !File.exists? file_abs_path
16-
return [];
13+
def flutter_root
14+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15+
unless File.exist?(generated_xcode_build_settings_path)
16+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
1717
end
18-
generated_key_values = {}
19-
skip_line_start_symbols = ["#", "/"]
20-
File.foreach(file_abs_path) do |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-
generated_key_values[podname] = podpath
28-
else
29-
puts "Invalid plugin specification: #{line}"
30-
end
18+
19+
File.foreach(generated_xcode_build_settings_path) do |line|
20+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
21+
return matches[1].strip if matches
3122
end
32-
generated_key_values
23+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
3324
end
3425

26+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27+
28+
flutter_ios_podfile_setup
29+
3530
target 'Runner' do
3631
use_frameworks!
3732
use_modular_headers!
3833

39-
# Flutter Pod
40-
41-
copied_flutter_dir = File.join(__dir__, 'Flutter')
42-
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
43-
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
44-
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
45-
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
46-
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
47-
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
48-
49-
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
50-
unless File.exist?(generated_xcode_build_settings_path)
51-
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
52-
end
53-
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
54-
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
55-
56-
unless File.exist?(copied_framework_path)
57-
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
58-
end
59-
unless File.exist?(copied_podspec_path)
60-
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
61-
end
62-
end
63-
64-
# Keep pod path relative so it can be checked into Podfile.lock.
65-
pod 'Flutter', :path => 'Flutter'
66-
67-
# Plugin Pods
68-
69-
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
70-
# referring to absolute paths on developers' machines.
71-
system('rm -rf .symlinks')
72-
system('mkdir -p .symlinks/plugins')
73-
plugin_pods = parse_KV_file('../.flutter-plugins')
74-
plugin_pods.each do |name, path|
75-
symlink = File.join('.symlinks', 'plugins', name)
76-
File.symlink(path, symlink)
77-
pod name, :path => File.join(symlink, 'ios')
78-
end
34+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
7935
end
8036

8137
post_install do |installer|
8238
installer.pods_project.targets.each do |target|
83-
target.build_configurations.each do |config|
84-
config.build_settings['ENABLE_BITCODE'] = 'NO'
85-
end
39+
flutter_additional_ios_build_settings(target)
8640
end
8741
end

ios/Podfile.lock

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
PODS:
2+
- Flutter (1.0.0)
3+
- image_picker (0.0.1):
4+
- Flutter
5+
- shared_preferences (0.0.1):
6+
- Flutter
7+
8+
DEPENDENCIES:
9+
- Flutter (from `Flutter`)
10+
- image_picker (from `.symlinks/plugins/image_picker/ios`)
11+
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
12+
13+
EXTERNAL SOURCES:
14+
Flutter:
15+
:path: Flutter
16+
image_picker:
17+
:path: ".symlinks/plugins/image_picker/ios"
18+
shared_preferences:
19+
:path: ".symlinks/plugins/shared_preferences/ios"
20+
21+
SPEC CHECKSUMS:
22+
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
23+
image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09
24+
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
25+
26+
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
27+
28+
COCOAPODS: 1.9.3

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,12 @@
236236
inputPaths = (
237237
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
238238
"${PODS_ROOT}/../Flutter/Flutter.framework",
239-
"${BUILT_PRODUCTS_DIR}/flutter_plugin_android_lifecycle/flutter_plugin_android_lifecycle.framework",
240239
"${BUILT_PRODUCTS_DIR}/image_picker/image_picker.framework",
241240
"${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework",
242241
);
243242
name = "[CP] Embed Pods Frameworks";
244243
outputPaths = (
245244
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
246-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_plugin_android_lifecycle.framework",
247245
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/image_picker.framework",
248246
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework",
249247
);

lib/data/user_repository_imp.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,11 @@ class UserRepositoryImpl implements UserRepository {
174174
/// if future is successful, emit [Success]
175175
/// if future complete with error, emit [Failure]
176176
///
177-
Stream<Result<T>> _execute<T>(Future<T> Function() factory) {
178-
return Rx.defer(() {
179-
return Stream.fromFuture(factory())
177+
Stream<Result<T>> _execute<T>(Future<T> Function() factory) =>
178+
Rx.fromCallable(factory)
180179
.doOnError(_handleUnauthenticatedError)
181180
.map<Result<T>>((result) => Success<T>((b) => b.result = result))
182181
.onErrorReturnWith(_errorToResult);
183-
});
184-
}
185182

186183
///
187184
/// Like error http interceptor

pubspec.lock

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ packages:
2828
name: async
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "2.5.0-nullsafety.3"
31+
version: "2.5.0-nullsafety.1"
3232
boolean_selector:
3333
dependency: transitive
3434
description:
3535
name: boolean_selector
3636
url: "https://pub.dartlang.org"
3737
source: hosted
38-
version: "2.1.0-nullsafety.3"
38+
version: "2.1.0-nullsafety.1"
3939
build:
4040
dependency: transitive
4141
description:
@@ -105,14 +105,14 @@ packages:
105105
name: characters
106106
url: "https://pub.dartlang.org"
107107
source: hosted
108-
version: "1.1.0-nullsafety.5"
108+
version: "1.1.0-nullsafety.3"
109109
charcode:
110110
dependency: transitive
111111
description:
112112
name: charcode
113113
url: "https://pub.dartlang.org"
114114
source: hosted
115-
version: "1.2.0-nullsafety.3"
115+
version: "1.2.0-nullsafety.1"
116116
checked_yaml:
117117
dependency: transitive
118118
description:
@@ -133,7 +133,7 @@ packages:
133133
name: clock
134134
url: "https://pub.dartlang.org"
135135
source: hosted
136-
version: "1.1.0-nullsafety.3"
136+
version: "1.1.0-nullsafety.1"
137137
code_builder:
138138
dependency: transitive
139139
description:
@@ -147,7 +147,7 @@ packages:
147147
name: collection
148148
url: "https://pub.dartlang.org"
149149
source: hosted
150-
version: "1.15.0-nullsafety.5"
150+
version: "1.15.0-nullsafety.3"
151151
convert:
152152
dependency: transitive
153153
description:
@@ -203,7 +203,7 @@ packages:
203203
name: fake_async
204204
url: "https://pub.dartlang.org"
205205
source: hosted
206-
version: "1.2.0-nullsafety.3"
206+
version: "1.2.0-nullsafety.1"
207207
ffi:
208208
dependency: transitive
209209
description:
@@ -316,7 +316,7 @@ packages:
316316
name: image_picker
317317
url: "https://pub.dartlang.org"
318318
source: hosted
319-
version: "0.6.7+12"
319+
version: "0.6.7+14"
320320
image_picker_platform_interface:
321321
dependency: transitive
322322
description:
@@ -344,7 +344,7 @@ packages:
344344
name: js
345345
url: "https://pub.dartlang.org"
346346
source: hosted
347-
version: "0.6.3-nullsafety.3"
347+
version: "0.6.2"
348348
json_annotation:
349349
dependency: transitive
350350
description:
@@ -365,14 +365,14 @@ packages:
365365
name: matcher
366366
url: "https://pub.dartlang.org"
367367
source: hosted
368-
version: "0.12.10-nullsafety.3"
368+
version: "0.12.10-nullsafety.1"
369369
meta:
370370
dependency: transitive
371371
description:
372372
name: meta
373373
url: "https://pub.dartlang.org"
374374
source: hosted
375-
version: "1.3.0-nullsafety.6"
375+
version: "1.3.0-nullsafety.3"
376376
mime:
377377
dependency: transitive
378378
description:
@@ -407,7 +407,7 @@ packages:
407407
name: path
408408
url: "https://pub.dartlang.org"
409409
source: hosted
410-
version: "1.8.0-nullsafety.3"
410+
version: "1.8.0-nullsafety.1"
411411
path_provider_linux:
412412
dependency: transitive
413413
description:
@@ -484,7 +484,7 @@ packages:
484484
name: quiver
485485
url: "https://pub.dartlang.org"
486486
source: hosted
487-
version: "2.1.4+1"
487+
version: "2.1.5"
488488
rx_shared_preferences:
489489
dependency: "direct main"
490490
description:
@@ -573,21 +573,21 @@ packages:
573573
name: source_span
574574
url: "https://pub.dartlang.org"
575575
source: hosted
576-
version: "1.8.0-nullsafety.4"
576+
version: "1.8.0-nullsafety.2"
577577
stack_trace:
578578
dependency: transitive
579579
description:
580580
name: stack_trace
581581
url: "https://pub.dartlang.org"
582582
source: hosted
583-
version: "1.10.0-nullsafety.6"
583+
version: "1.10.0-nullsafety.1"
584584
stream_channel:
585585
dependency: transitive
586586
description:
587587
name: stream_channel
588588
url: "https://pub.dartlang.org"
589589
source: hosted
590-
version: "2.1.0-nullsafety.3"
590+
version: "2.1.0-nullsafety.1"
591591
stream_transform:
592592
dependency: transitive
593593
description:
@@ -601,21 +601,21 @@ packages:
601601
name: string_scanner
602602
url: "https://pub.dartlang.org"
603603
source: hosted
604-
version: "1.1.0-nullsafety.3"
604+
version: "1.1.0-nullsafety.1"
605605
term_glyph:
606606
dependency: transitive
607607
description:
608608
name: term_glyph
609609
url: "https://pub.dartlang.org"
610610
source: hosted
611-
version: "1.2.0-nullsafety.3"
611+
version: "1.2.0-nullsafety.1"
612612
test_api:
613613
dependency: transitive
614614
description:
615615
name: test_api
616616
url: "https://pub.dartlang.org"
617617
source: hosted
618-
version: "0.2.19-nullsafety.6"
618+
version: "0.2.19-nullsafety.2"
619619
timing:
620620
dependency: transitive
621621
description:
@@ -636,14 +636,14 @@ packages:
636636
name: typed_data
637637
url: "https://pub.dartlang.org"
638638
source: hosted
639-
version: "1.3.0-nullsafety.5"
639+
version: "1.3.0-nullsafety.3"
640640
vector_math:
641641
dependency: transitive
642642
description:
643643
name: vector_math
644644
url: "https://pub.dartlang.org"
645645
source: hosted
646-
version: "2.1.0-nullsafety.5"
646+
version: "2.1.0-nullsafety.3"
647647
watcher:
648648
dependency: transitive
649649
description:
@@ -664,7 +664,7 @@ packages:
664664
name: win32
665665
url: "https://pub.dartlang.org"
666666
source: hosted
667-
version: "1.7.3"
667+
version: "1.7.4"
668668
xdg_directories:
669669
dependency: transitive
670670
description:
@@ -680,5 +680,5 @@ packages:
680680
source: hosted
681681
version: "2.2.1"
682682
sdks:
683-
dart: ">=2.12.0-0.0 <3.0.0"
683+
dart: ">=2.10.0-110 <2.11.0"
684684
flutter: ">=1.12.13+hotfix.5 <2.0.0"

0 commit comments

Comments
 (0)