filepicker_windows 2.1.3 filepicker_windows: ^2.1.3 copied to clipboard
A package that allows file and directory selection for Windows using common dialog controls.
// Copyright (c) 2023, Halil Durmus. Please see the AUTHORS file for details.
// All rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
import 'package:filepicker_windows/filepicker_windows.dart';
// Normal file open dialog box example
void main() {
final file = OpenFilePicker()
..filterSpecification = {
'Word Document (*.doc)': '*.doc',
'Web Page (*.htm; *.html)': '*.htm;*.html',
'Text Document (*.txt)': '*.txt',
'All Files': '*.*'
}
..defaultFilterIndex = 0
..defaultExtension = 'doc'
..title = 'Select a document';
final result = file.getFile();
if (result != null) {
print(result.path);
}
}