filepicker_windows 2.1.4 copy "filepicker_windows: ^2.1.4" to clipboard
filepicker_windows: ^2.1.4 copied to clipboard

A package that allows file and directory selection for Windows using common dialog controls.

ci Package: filepicker_windows Publisher: halildurmus.dev Language: Dart License: BSD-3-Clause

A package that provides a friendly Dart API for file and directory selection for Windows using common dialog controls.

This package builds on top of the Dart win32 package, offering a high-level Dart wrapper that avoids the need for users to understand FFI or write directly to the Win32 API.

Usage #

File Picker #

Show a file picker dialog, allowing the user to select a file.

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': '*.*'
    }
    ..defaultFilterIndex = 0
    ..defaultExtension = 'doc'
    ..title = 'Select a document';

  final result = file.getFile();
  if (result != null) {
    print(result.path);
  }
}

Directory Picker #

Show a directory picker dialog, allowing the user to select a directory.

import 'package:filepicker_windows/filepicker_windows.dart';

void main() {
  final file = DirectoryPicker()..title = 'Select a directory';

  final result = file.getDirectory();
  if (result != null) {
    print(result.path);
  }
}

Additional examples can be located within the example directory.

For a more advanced demonstration, you can explore a Flutter application in the example\wallpaper\ directory. This application illustrates how to select an image file and set it as your desktop wallpaper.

Feature requests and bugs #

Please file feature requests and bugs at the issue tracker.

112
likes
160
pub points
90%
popularity

Publisher

verified publisherhalildurmus.dev

A package that allows file and directory selection for Windows using common dialog controls.

Repository (GitHub)
View/report issues
Contributing

Topics

#picker #win32 #ffi #windows

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

ffi, win32

More

Packages that depend on filepicker_windows