Viewing version 2.0.1. Open the latest package page.

windows_file_picker

2.0.1

Windows implementation of the file_picker plugin using Win32 COM APIs for native file and directory picking.

Download archive

Readme

File Picker for Windows

windows_file_picker

The Windows implementation of file_picker.

Usage

This package is endorsed, which means you can simply use file_picker as normal, and the Windows implementation will be automatically included.

Changelog

2.0.1

  • Fixed pickFileAndDirectoryPaths() returning URI paths instead of Windows paths. #2225

2.0.0

  • BREAKING CHANGE: PlatformFile.length() now returns Future<int?> instead of Future<int>. Returns null when the length could not be determined (e.g. a failed disk read), instead of 0, matching lengthSync(). #2197

1.3.0

  • Added WindowsOptions.acceptLabel, letting callers set the confirm ("OK") button text on pickFile(), pickFiles(), getDirectoryPath(), and saveFile() dialogs, via IFileDialog.SetOkButtonLabel. #1861

1.2.0

  • Implemented PlatformFile.lengthSync(). The picker only returns a file path, not its size, so this returns null on Windows, use length() to actually read it from disk.

1.1.0

  • Migrated pickFile(), pickFiles(), and saveFile() from the legacy GetOpenFileNameW/GetSaveFileNameW common dialogs to the modern IFileOpenDialog/IFileSaveDialog COM APIs, the same pattern getDirectoryPath() already used. This is a prerequisite for supporting custom dialog button text and other Common Item Dialog features on those entry points. Fixes #2173.
  • Removed the internal Win32 helpers tied to the legacy dialogs (fileTypeToFileFilter, extractSelectedFilesFromOpenFileNameW, OPENFILENAMEW, GetOpenFileNameW, GetSaveFileNameW, and the ofn* constants). These were implementation details of the removed dialog code, not part of the supported plugin API.
  • Tightened the file_picker_platform_interface lower bound to ^3.2.0. This package's pickFile()/pickFiles() signatures reference DarwinOptions, added in that version, so resolving against an older one would fail to compile.

1.0.2

  • Fix saved files missing their extension when the user types a file name without one: set lpstrDefExt on OPENFILENAMEW so Windows appends the default extension (derived from the allowed extensions or the suggested file name). Fixes #2139.

1.0.1

  • Improved package description, added example, and added missing API documentation.

1.0.0

  • Initial release of Windows implementation package for file_picker.

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'windows_file_picker:2.0.1'
pubspec.yaml
name: windows_file_picker
description: Windows implementation of the file_picker plugin using Win32 COM APIs for native file and directory picking.
version: 2.0.1
homepage: https://github.com/vicajilau/flutter_file_picker/tree/main/packages/file_picker_windows
repository: https://github.com/vicajilau/flutter_file_picker/tree/main/packages/file_picker_windows
topics:
  - file-picker
  - windows

resolution: workspace

environment:
  sdk: ">=3.10.0 <4.0.0"
  flutter: ">=3.38.0"

flutter:
  plugin:
    implements: file_picker
    platforms:
      windows:
        dartPluginClass: FilePickerWindows

dependencies:
  flutter:
    sdk: flutter
  file_picker_platform_interface: ^4.0.0
  cross_file: ^0.3.5+4
  ffi: ^2.2.0
  meta: ^1.17.0
  path: ^1.9.1
  win32: ^6.3.0

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^6.0.0

Version history

VersionPublishedArchiveSHA-256
1.0.0On demandDownloadbb25e1b0…f68406
1.0.1On demandDownload72cf2346…33de26
1.0.2On demandDownload1659127c…e3026a
1.1.0On demandDownload225f58e6…c9b5a5
1.2.0On demandDownloadd999c1c0…308caf
1.3.0On demandDownload62e6e6e1…91ad96
2.0.0On demandDownload9f3aa833…43602e
2.0.1Cached · Upstream SHA-256 matchedDownload18452aa2…875072

Dependencies

cross_file "^0.3.5+4"

ffi "^2.2.0"

file_picker_platform_interface "^4.0.0"

flutter { "sdk": "flutter" }

meta "^1.17.0"

path "^1.9.1"

win32 "^6.3.0"