-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[file_selector] Add macOS support #4381
[file_selector] Add macOS support #4381
Conversation
ccef85c to
daa11d0
Compare
|
@cbracken There are two options for review here:
2 is complicated somewhat by the fact that after I had the unit tests in place I translated the plugin to Swift, but that's its own commit so it can be done as a side-by-side. Either way:
|
|
(Maybe some day :P) |
|
What's the status of this PR? |
Waiting for @cbracken to have time to review it. |
| import 'package:file_selector_platform_interface/file_selector_platform_interface.dart'; | ||
| import 'package:flutter/material.dart'; | ||
|
|
||
| /// Screen that shows an example of getDirectoryPath |
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.
See comments on the Windows patch for the example.
|
@cbracken This is ready for review:
|
cbracken
left a comment
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.
lgtm just two minuscule nits.
| import 'package:flutter/material.dart'; | ||
|
|
||
| /// Screen that allows the user to select a directory using `getDirectoryPath`, | ||
| /// then displays the selected directory in a dialog. |
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.
pedantic nit: s/ then/then/
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.
| Future<void> _saveFile() async { | ||
| final String fileName = _nameController.text; | ||
| final String? path = await FileSelectorPlatform.instance.getSavePath( | ||
| // Operation was canceled by the user. |
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.
Move comment a few lines down.
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.
🤦🏻
|
For some reason I'm not able to add labels to this PR at the moment, so landing manually. |
Brings file_selector_macos into flutter/plugins from FDE, with the following changes:
Does not currently include native UI tests to allow for end-to-end testing (since Flutter integration tests can't be used). They should be added later (they are currently blocked on flutter/flutter#90673), but the unit tests give substantial coverage, making it substantially better to move the plugin now to get those tests running.
macOS portion of flutter/flutter#70221
Pre-launch Checklist
dart format.)[shared_preferences]///).