Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6e7f572
Basic iOS implementation
spesholized Apr 27, 2022
b4e8697
Merge branch 'flutter:main' into main
spesholized Apr 28, 2022
75a1bdc
[file_selector] Basic iOS implementation
spesholized Apr 27, 2022
15f2741
Merge branch 'main' of https://github.com/spesholized/plugins
spesholized Apr 28, 2022
62c60cb
Fix formatting and update environment sdk version
spesholized Apr 28, 2022
696cb78
Basic native unit test for plugin
spesholized Apr 29, 2022
11504f4
Update packages/file_selector/file_selector_ios/example/ios/Runner.xc…
spesholized May 2, 2022
252e110
Add placeholder integration test
spesholized May 3, 2022
cb76a80
Remove unused overrides in file_selector_ios.dart, update pubspec
spesholized May 25, 2022
ecfad9a
Use pigeon, fix Obj-C prefix typo
spesholized May 26, 2022
4ecda0e
Add native unit tests
spesholized May 27, 2022
2a69911
Update tests to use pigeon, change prefix to FFS, update wildcard typ…
spesholized Aug 2, 2022
38742a3
Use non-null properties in messages.dart, use objc associated for the…
spesholized Aug 2, 2022
ec291b6
Merge branch 'main' into file_selector_ios
stuartmorgan-g Aug 19, 2022
f0bbcf1
Remove local analysis options
stuartmorgan-g Aug 19, 2022
edc2881
Resync examples and tweak UTIs
stuartmorgan-g Aug 19, 2022
e521edc
Analysis fixes
stuartmorgan-g Aug 19, 2022
eabcce5
Autoformat
stuartmorgan-g Aug 19, 2022
d39d953
Missing copyright header
stuartmorgan-g Aug 19, 2022
170c260
Supress deprecation warning on legacy codepath
stuartmorgan-g Aug 19, 2022
129a097
Review comments
stuartmorgan-g Aug 21, 2022
0cfa61c
Format
stuartmorgan-g Aug 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unused overrides in file_selector_ios.dart, update pubspec
  • Loading branch information
spesholized committed May 25, 2022
commit cb76a80b37d076d626952ccd52baf04f1933810c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<string>11.0</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -525,7 +525,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -574,7 +574,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,7 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -38,56 +38,6 @@ class FileSelectorIOS extends FileSelectorPlatform {
return path == null ? null : XFile(path.first);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this is why we have a general policy against nullable collections: this line only correctly handles one form of "empty" (null), not the other, making it very fragile.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}

@override
Future<List<XFile>> openFiles({
List<XTypeGroup>? acceptedTypeGroups,
String? initialDirectory,
String? confirmButtonText,
}) async {
final List<String>? pathList = await _channel.invokeListMethod<String>(
'openFile',
<String, dynamic>{
'acceptedTypes': _allowedTypeListFromTypeGroups(acceptedTypeGroups),
'initialDirectory': initialDirectory,
'confirmButtonText': confirmButtonText,
'multiple': true,
},
);
return pathList?.map((String path) => XFile(path)).toList() ?? <XFile>[];
}

@override
Future<String?> getSavePath({
List<XTypeGroup>? acceptedTypeGroups,
String? initialDirectory,
String? suggestedName,
String? confirmButtonText,
}) async {
return _channel.invokeMethod<String>(
'getSavePath',
<String, dynamic>{
'acceptedTypes': _allowedTypeListFromTypeGroups(acceptedTypeGroups),
'initialDirectory': initialDirectory,
'suggestedName': suggestedName,
'confirmButtonText': confirmButtonText,
},
);
}

@override
Future<String?> getDirectoryPath({
String? initialDirectory,
String? confirmButtonText,
}) async {
return _channel.invokeMethod<String>(
'getDirectoryPath',
<String, dynamic>{
'initialDirectory': initialDirectory,
'confirmButtonText': confirmButtonText,
},
);
}

// Converts the type group list into a flat list of all allowed types, since
// iOS doesn't support filter groups.
Map<String, List<String>>? _allowedTypeListFromTypeGroups(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you're only actually using UTI, so you can just make this a List<String> of UTIs, and remove a level of nesting at both ends of the channel.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Expand Down
5 changes: 2 additions & 3 deletions packages/file_selector/file_selector_ios/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version: 0.5.0

environment:
sdk: ">=2.14.4 <3.0.0"
flutter: ">=2.0.0"
flutter: ">=2.8.0"

flutter:
plugin:
Expand All @@ -17,12 +17,11 @@ flutter:
pluginClass: FTLFileSelectorPlugin

dependencies:
cross_file: ^0.3.1
file_selector_platform_interface: ^2.0.4
flutter:
sdk: flutter

dev_dependencies:
flutter_lints: ^1.0.0
flutter_test:
sdk: flutter
sdk: flutter