Skip to content

Instantly share code, notes, and snippets.

@timsneath
Last active September 22, 2020 05:17
Show Gist options
  • Select an option

  • Save timsneath/37b945bd31d294bd91e4750e79403abf to your computer and use it in GitHub Desktop.

Select an option

Save timsneath/37b945bd31d294bd91e4750e79403abf to your computer and use it in GitHub Desktop.
filepicker.dart
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