Last active
September 22, 2020 05:17
-
-
Save timsneath/37b945bd31d294bd91e4750e79403abf to your computer and use it in GitHub Desktop.
filepicker.dart
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
| import 'package:filepicker_windows/filepicker_windows.dart'; | |
| void main() { | |
| final file = OpenFilePicker() | |
| ..filterSpecification = { | |
| 'Word Document (*.doc)': '*.doc', | |
| 'Web Page (*.htm; *.html)': '*.htm;*.html', | |
| 'Text Document (*.txt)': '*.txt', | |
| 'All Files': '*.*' | |
| } | |
| ..defaultExtension = 'doc' | |
| ..title = 'Please select a document'; | |
| final result = file.getFile(); | |
| if (result != null) { | |
| print(result.path); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment