Skip to content

Commit 69b3972

Browse files
committed
chore: minor code improvements
1 parent 20a2767 commit 69b3972

File tree

9 files changed

+147
-56
lines changed

9 files changed

+147
-56
lines changed

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>8.0</string>
24+
<string>9.0</string>
2525
</dict>
2626
</plist>

example/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+
- integration_test (0.0.1):
6+
- Flutter
7+
8+
DEPENDENCIES:
9+
- Flutter (from `Flutter`)
10+
- image_picker (from `.symlinks/plugins/image_picker/ios`)
11+
- integration_test (from `.symlinks/plugins/integration_test/ios`)
12+
13+
EXTERNAL SOURCES:
14+
Flutter:
15+
:path: Flutter
16+
image_picker:
17+
:path: ".symlinks/plugins/image_picker/ios"
18+
integration_test:
19+
:path: ".symlinks/plugins/integration_test/ios"
20+
21+
SPEC CHECKSUMS:
22+
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
23+
image_picker: e06f7a68f000bd36f552c1847e33cda96ed31f1f
24+
integration_test: 7db6d89f336f671dcbc7563ee27a5b08f6f8aee1
25+
26+
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
27+
28+
COCOAPODS: 1.11.0.beta.2

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
0241950E6AFC32273F4879BD /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 415E6D56249496BC18216782 /* Pods_Runner.framework */; };
1011
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1112
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
1213
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
@@ -31,30 +32,54 @@
3132
/* Begin PBXFileReference section */
3233
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
3334
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
35+
232B36A099A51B005D98642E /* 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 = "<group>"; };
3436
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
37+
415E6D56249496BC18216782 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3538
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
3639
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
3740
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
41+
8E67D36E4924EC5BE00C095E /* 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 = "<group>"; };
3842
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
3943
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
4044
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
4145
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
4246
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
4347
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
4448
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
49+
DC6D8FF20BDCCE3FA4EFA2CE /* 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 = "<group>"; };
4550
/* End PBXFileReference section */
4651

4752
/* Begin PBXFrameworksBuildPhase section */
4853
97C146EB1CF9000F007C117D /* Frameworks */ = {
4954
isa = PBXFrameworksBuildPhase;
5055
buildActionMask = 2147483647;
5156
files = (
57+
0241950E6AFC32273F4879BD /* Pods_Runner.framework in Frameworks */,
5258
);
5359
runOnlyForDeploymentPostprocessing = 0;
5460
};
5561
/* End PBXFrameworksBuildPhase section */
5662

5763
/* Begin PBXGroup section */
64+
1CB3C9DD73FDE8BB98A8D86C /* Pods */ = {
65+
isa = PBXGroup;
66+
children = (
67+
232B36A099A51B005D98642E /* Pods-Runner.debug.xcconfig */,
68+
8E67D36E4924EC5BE00C095E /* Pods-Runner.release.xcconfig */,
69+
DC6D8FF20BDCCE3FA4EFA2CE /* Pods-Runner.profile.xcconfig */,
70+
);
71+
name = Pods;
72+
path = Pods;
73+
sourceTree = "<group>";
74+
};
75+
48EB678179B483658AA268A2 /* Frameworks */ = {
76+
isa = PBXGroup;
77+
children = (
78+
415E6D56249496BC18216782 /* Pods_Runner.framework */,
79+
);
80+
name = Frameworks;
81+
sourceTree = "<group>";
82+
};
5883
9740EEB11CF90186004384FC /* Flutter */ = {
5984
isa = PBXGroup;
6085
children = (
@@ -72,6 +97,8 @@
7297
9740EEB11CF90186004384FC /* Flutter */,
7398
97C146F01CF9000F007C117D /* Runner */,
7499
97C146EF1CF9000F007C117D /* Products */,
100+
1CB3C9DD73FDE8BB98A8D86C /* Pods */,
101+
48EB678179B483658AA268A2 /* Frameworks */,
75102
);
76103
sourceTree = "<group>";
77104
};
@@ -105,12 +132,14 @@
105132
isa = PBXNativeTarget;
106133
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
107134
buildPhases = (
135+
2F026B80CA9FCDE74DB8F582 /* [CP] Check Pods Manifest.lock */,
108136
9740EEB61CF901F6004384FC /* Run Script */,
109137
97C146EA1CF9000F007C117D /* Sources */,
110138
97C146EB1CF9000F007C117D /* Frameworks */,
111139
97C146EC1CF9000F007C117D /* Resources */,
112140
9705A1C41CF9048500538489 /* Embed Frameworks */,
113141
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
142+
EC49821C2A4E12FEA7600682 /* [CP] Embed Pods Frameworks */,
114143
);
115144
buildRules = (
116145
);
@@ -169,6 +198,28 @@
169198
/* End PBXResourcesBuildPhase section */
170199

171200
/* Begin PBXShellScriptBuildPhase section */
201+
2F026B80CA9FCDE74DB8F582 /* [CP] Check Pods Manifest.lock */ = {
202+
isa = PBXShellScriptBuildPhase;
203+
buildActionMask = 2147483647;
204+
files = (
205+
);
206+
inputFileListPaths = (
207+
);
208+
inputPaths = (
209+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
210+
"${PODS_ROOT}/Manifest.lock",
211+
);
212+
name = "[CP] Check Pods Manifest.lock";
213+
outputFileListPaths = (
214+
);
215+
outputPaths = (
216+
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
217+
);
218+
runOnlyForDeploymentPostprocessing = 0;
219+
shellPath = /bin/sh;
220+
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";
221+
showEnvVarsInLog = 0;
222+
};
172223
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
173224
isa = PBXShellScriptBuildPhase;
174225
buildActionMask = 2147483647;
@@ -197,6 +248,23 @@
197248
shellPath = /bin/sh;
198249
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
199250
};
251+
EC49821C2A4E12FEA7600682 /* [CP] Embed Pods Frameworks */ = {
252+
isa = PBXShellScriptBuildPhase;
253+
buildActionMask = 2147483647;
254+
files = (
255+
);
256+
inputFileListPaths = (
257+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
258+
);
259+
name = "[CP] Embed Pods Frameworks";
260+
outputFileListPaths = (
261+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
262+
);
263+
runOnlyForDeploymentPostprocessing = 0;
264+
shellPath = /bin/sh;
265+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
266+
showEnvVarsInLog = 0;
267+
};
200268
/* End PBXShellScriptBuildPhase section */
201269

202270
/* Begin PBXSourcesBuildPhase section */

example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/ios/Runner.xcworkspace/contents.xcworkspacedata

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/pubspec.lock

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,14 @@ packages:
77
name: archive
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.0.13"
11-
args:
12-
dependency: transitive
13-
description:
14-
name: args
15-
url: "https://pub.dartlang.org"
16-
source: hosted
17-
version: "1.6.0"
10+
version: "3.1.2"
1811
async:
1912
dependency: transitive
2013
description:
2114
name: async
2215
url: "https://pub.dartlang.org"
2316
source: hosted
24-
version: "2.5.0"
17+
version: "2.8.1"
2518
boolean_selector:
2619
dependency: transitive
2720
description:
@@ -42,7 +35,7 @@ packages:
4235
name: charcode
4336
url: "https://pub.dartlang.org"
4437
source: hosted
45-
version: "1.2.0"
38+
version: "1.3.1"
4639
clock:
4740
dependency: transitive
4841
description:
@@ -57,20 +50,20 @@ packages:
5750
url: "https://pub.dartlang.org"
5851
source: hosted
5952
version: "1.15.0"
60-
convert:
53+
cross_file:
6154
dependency: transitive
6255
description:
63-
name: convert
56+
name: cross_file
6457
url: "https://pub.dartlang.org"
6558
source: hosted
66-
version: "2.1.1"
59+
version: "0.3.1+5"
6760
crypto:
6861
dependency: transitive
6962
description:
7063
name: crypto
7164
url: "https://pub.dartlang.org"
7265
source: hosted
73-
version: "2.1.5"
66+
version: "3.0.1"
7467
fake_async:
7568
dependency: transitive
7669
description:
@@ -84,7 +77,7 @@ packages:
8477
name: file
8578
url: "https://pub.dartlang.org"
8679
source: hosted
87-
version: "6.0.0"
80+
version: "6.1.2"
8881
flutter:
8982
dependency: "direct main"
9083
description: flutter
@@ -101,7 +94,7 @@ packages:
10194
name: flutter_form_builder
10295
url: "https://pub.dartlang.org"
10396
source: hosted
104-
version: "6.0.0-nullsafety.0"
97+
version: "6.1.0+1"
10598
flutter_localizations:
10699
dependency: transitive
107100
description: flutter
@@ -142,7 +135,7 @@ packages:
142135
name: http
143136
url: "https://pub.dartlang.org"
144137
source: hosted
145-
version: "0.13.1"
138+
version: "0.13.3"
146139
http_parser:
147140
dependency: transitive
148141
description:
@@ -156,26 +149,26 @@ packages:
156149
name: image_picker
157150
url: "https://pub.dartlang.org"
158151
source: hosted
159-
version: "0.7.4"
152+
version: "0.8.4"
160153
image_picker_for_web:
161154
dependency: transitive
162155
description:
163156
name: image_picker_for_web
164157
url: "https://pub.dartlang.org"
165158
source: hosted
166-
version: "2.0.0"
159+
version: "2.1.3"
167160
image_picker_platform_interface:
168161
dependency: transitive
169162
description:
170163
name: image_picker_platform_interface
171164
url: "https://pub.dartlang.org"
172165
source: hosted
173-
version: "2.0.1"
166+
version: "2.4.1"
174167
integration_test:
175168
dependency: "direct dev"
176169
description: flutter
177170
source: sdk
178-
version: "0.9.2+2"
171+
version: "0.0.0"
179172
intl:
180173
dependency: transitive
181174
description:
@@ -203,7 +196,7 @@ packages:
203196
name: meta
204197
url: "https://pub.dartlang.org"
205198
source: hosted
206-
version: "1.3.0"
199+
version: "1.7.0"
207200
path:
208201
dependency: transitive
209202
description:
@@ -238,7 +231,7 @@ packages:
238231
name: process
239232
url: "https://pub.dartlang.org"
240233
source: hosted
241-
version: "4.0.0"
234+
version: "4.2.3"
242235
sky_engine:
243236
dependency: transitive
244237
description: flutter
@@ -250,7 +243,7 @@ packages:
250243
name: source_span
251244
url: "https://pub.dartlang.org"
252245
source: hosted
253-
version: "1.8.0"
246+
version: "1.8.1"
254247
stack_trace:
255248
dependency: transitive
256249
description:
@@ -278,7 +271,7 @@ packages:
278271
name: sync_http
279272
url: "https://pub.dartlang.org"
280273
source: hosted
281-
version: "0.2.0"
274+
version: "0.3.0"
282275
term_glyph:
283276
dependency: transitive
284277
description:
@@ -292,7 +285,7 @@ packages:
292285
name: test_api
293286
url: "https://pub.dartlang.org"
294287
source: hosted
295-
version: "0.2.19"
288+
version: "0.4.2"
296289
typed_data:
297290
dependency: transitive
298291
description:
@@ -313,14 +306,14 @@ packages:
313306
name: vm_service
314307
url: "https://pub.dartlang.org"
315308
source: hosted
316-
version: "5.5.0"
309+
version: "7.1.1"
317310
webdriver:
318311
dependency: transitive
319312
description:
320313
name: webdriver
321314
url: "https://pub.dartlang.org"
322315
source: hosted
323-
version: "2.1.2"
316+
version: "3.0.0"
324317
sdks:
325318
dart: ">=2.12.0 <3.0.0"
326-
flutter: ">=1.20.0"
319+
flutter: ">=2.0.0"

lib/src/image_source_sheet.dart

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,9 @@ class _ImageSourceBottomSheetState extends State<ImageSourceBottomSheet> {
7777
_isPickingImage = false;
7878
if (null != pickedFile) {
7979
if (kIsWeb) {
80-
if (null != widget.onImage) {
81-
widget.onImage!(await pickedFile.readAsBytes());
82-
}
80+
widget.onImage?.call(await pickedFile.readAsBytes());
8381
} else {
84-
if (null != widget.onImageSelected) {
85-
// Warning: this will not work on the web platform because pickedFile
86-
// will instead point to a network resource.
87-
final imageFile = File(pickedFile.path);
88-
// assert(null != imageFile);
89-
widget.onImageSelected!(imageFile);
90-
}
82+
widget.onImageSelected?.call(File(pickedFile.path));
9183
}
9284
}
9385
}

0 commit comments

Comments
 (0)