Viewing version 3.3.0. Open the latest package page.

file_picker_platform_interface

3.3.0

A common platform interface for the file_picker plugin, defining the shared API surface and data contracts across platforms.

Download archive

Readme

file_picker_platform_interface

A common platform interface for the file_picker plugin.

This package defines the interface that all platform implementation packages for file_picker (such as android_file_picker, file_picker_darwin, windows_file_picker, file_picker_linux, file_picker_web) must implement.

Usage

To implement a new platform plugin for file_picker, extend FilePickerPlatform and register your implementation:

class FilePickerCustomPlatform extends FilePickerPlatform {
  static void registerWith() {
    FilePickerPlatform.instance = FilePickerCustomPlatform();
  }

  // Implement methods...
}
Changelog

3.3.0

  • Added PlatformFile.lengthSync(), a nullable int returning the file's length in bytes as provided by the underlying file picker result, or null when it did not report one. Named to pair with the existing length(), the same way dart:io's File does.

3.2.0

  • Added FilePickerPlatform.skipEntitlementsChecks(), a no-op default hook that platform implementations can override. Lets file_picker dispatch through the platform interface instead of importing file_picker_darwin directly, which kept the facade package from being wasm compatible.
  • Added DarwinOptions and DarwinAssetRepresentationMode, letting callers request a specific asset representation (current or compatible) for media selected from the iOS photo library, instead of always using the system default (automatic). Restores functionality that was available before the Darwin implementation was rewritten (previously exposed as a way to disable compression), useful to avoid expensive transcoding for large HEVC, HDR, or slow-motion videos.

3.1.0

  • Added PlatformFile.extension, restoring the pre-12.0 convenience getter that was dropped during the federated rewrite. Returns the file extension of name without the leading dot, or null if there is none.

3.0.1

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

3.0.0

  • Unified platform interface release for federated file_picker architecture.

2.0.0

  • Deprecates interface in favor of standalone file_picker for all platforms.

1.3.1

  • Removes allowCompression from interface as it should only be used from file_picker (Android & iOS).

1.3.0

  • Adds allowCompression parameter.

1.2.0

  • Adds FilePickerStatus.

1.1.0

  • Implements getDirectoryPath().

1.0.0

  • Implements getFiles().

0.0.3

  • Removes getFilePath().

0.0.2

  • Updates methods from File Picker interface.

0.0.1

  • Added File Picker platform interface.

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'file_picker_platform_interface:3.3.0'
pubspec.yaml
name: file_picker_platform_interface
description: A common platform interface for the file_picker plugin, defining the shared API surface and data contracts across platforms.
version: 3.3.0
homepage: https://github.com/vicajilau/flutter_file_picker/tree/main/packages/file_picker_platform_interface
repository: https://github.com/vicajilau/flutter_file_picker/tree/main/packages/file_picker_platform_interface
topics:
  - file-picker
  - platform-interface

resolution: workspace

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

dependencies:
  flutter:
    sdk: flutter
  plugin_platform_interface: ^2.1.8
  cross_file: ^0.3.5+4
  path: ^1.9.1

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^6.0.0

Version history

VersionPublishedArchiveSHA-256
0.0.1Cached · Upstream SHA-256 matchedDownload36693dad…826808
0.0.1+1Cached · Upstream SHA-256 matchedDownloadc1fe6630…0af199
0.0.2Cached · Upstream SHA-256 matchedDownload90dd6269…46fd22
0.0.3Cached · Upstream SHA-256 matchedDownload4e9f9473…5f9506
1.0.0Cached · Upstream SHA-256 matchedDownload1ebbcf61…0913d5
1.1.0Cached · Upstream SHA-256 matchedDownload946955a1…b4c937
1.2.0Cached · Upstream SHA-256 matchedDownloadff068bf7…e59ecb
1.3.0Cached · Upstream SHA-256 matchedDownload00fd05bc…37203e
1.3.1Cached · Upstream SHA-256 matchedDownloadfdd0f666…2abf0e
2.0.0Cached · Upstream SHA-256 matchedDownload70593271…538566
3.0.0Cached · Upstream SHA-256 matchedDownloadbfa1bfc6…2f94f4
3.0.1Cached · Upstream SHA-256 matchedDownload9e7a7e01…bef90c
3.1.0Cached · Upstream SHA-256 matchedDownloadb1ddd790…4c86bd
3.2.0Cached · Upstream SHA-256 matchedDownload11ef1b5c…916fc1
3.3.0Cached · Upstream SHA-256 matchedDownloadd35d8cb6…e5afd8
3.4.0Cached · Upstream SHA-256 matchedDownload0355558f…d0e9ca
4.0.0Cached · Upstream SHA-256 matchedDownloadbbdc085a…107ba5
4.1.0Cached · Upstream SHA-256 matchedDownloada78bd8ec…de7160
4.2.0Cached · Upstream SHA-256 matchedDownload336e7168…97cf20

Dependencies

cross_file "^0.3.5+4"

flutter { "sdk": "flutter" }

path "^1.9.1"

plugin_platform_interface "^2.1.8"