This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[file_selector] Basic iOS implementation #5448
Merged
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
6e7f572
Basic iOS implementation
spesholized b4e8697
Merge branch 'flutter:main' into main
spesholized 75a1bdc
[file_selector] Basic iOS implementation
spesholized 15f2741
Merge branch 'main' of https://github.com/spesholized/plugins
spesholized 62c60cb
Fix formatting and update environment sdk version
spesholized 696cb78
Basic native unit test for plugin
spesholized 11504f4
Update packages/file_selector/file_selector_ios/example/ios/Runner.xc…
spesholized 252e110
Add placeholder integration test
spesholized cb76a80
Remove unused overrides in file_selector_ios.dart, update pubspec
spesholized ecfad9a
Use pigeon, fix Obj-C prefix typo
spesholized 4ecda0e
Add native unit tests
spesholized 2a69911
Update tests to use pigeon, change prefix to FFS, update wildcard typ…
spesholized 38742a3
Use non-null properties in messages.dart, use objc associated for the…
spesholized ec291b6
Merge branch 'main' into file_selector_ios
stuartmorgan-g f0bbcf1
Remove local analysis options
stuartmorgan-g edc2881
Resync examples and tweak UTIs
stuartmorgan-g e521edc
Analysis fixes
stuartmorgan-g eabcce5
Autoformat
stuartmorgan-g d39d953
Missing copyright header
stuartmorgan-g 170c260
Supress deprecation warning on legacy codepath
stuartmorgan-g 129a097
Review comments
stuartmorgan-g 0cfa61c
Format
stuartmorgan-g File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove unused overrides in file_selector_ios.dart, update pubspec
- Loading branch information
commit cb76a80b37d076d626952ccd52baf04f1933810c
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,56 +38,6 @@ class FileSelectorIOS extends FileSelectorPlatform { | |
| return path == null ? null : XFile(path.first); | ||
| } | ||
|
|
||
| @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( | ||
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done