XFiles class
Static facade over the platform's file services — sharing, picking, saving, and scoped access.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- supportsSaveCopy → bool
-
Whether saveCopy has a native implementation — iOS / Android /
macOS / Windows.
no setter
-
Whether share has a native sheet on this platform — iOS /
Android / macOS / Windows. Gate share affordances so they don't
appear where the channel has no handler.
no setter
- supportsShowInFolder → bool
-
Whether the host platform supports showInFolder — macOS and
Windows. Call sites can use this to gate UI affordances ("Show in
Finder" buttons) so they don't appear where they're inert.
no setter
Static Methods
-
open(
{required String path, String? mimeType, Uint8List? bookmark}) → Future< bool> - Open a file on disk with the system's default viewer.
-
pick(
{List< String> ? mimeTypes}) → Future<XPickedFile?> - Present the system file picker. Returns the picked file's local-disk path (and optional metadata), or null if the user cancelled.
-
pickMultiple(
{List< String> ? mimeTypes}) → Future<List< XPickedFile> > - pick with several files selectable at once, served on Windows. Returns the picked files in the order the picker reports them, or an empty list if the user cancelled.
-
saveCopy(
{required String path, String? mimeType}) → Future< XFileSaveStatus> -
Save a user-visible copy of the file at
path. - Present the native share sheet for a file on disk.
-
showInFolder(
{required String path, Uint8List? bookmark}) → Future< bool> - Reveal a file on disk in the system's file browser.
-
videoThumbnail(
{required String path, int atMs = 0, int? maxWidth = 320, List< double> ? transform, int? outWidth, int? outHeight, String? overlayPath, int? maxLongest}) → Future<XVideoThumbnail?> -
Extract a single frame from the video at
path. Returns null if the platform's media decoder couldn't open the file (unsupported codec / corrupt / not actually a video). -
videoThumbnails(
{required String path, required List< int> timestampsMs, int maxWidth = 128}) → Future<List< XVideoThumbnail?> > -
Extract several frames in one native round-trip — the strip of
thumbnails behind a video trim scrubber. Frames come back in
timestampsMsorder; entries whose decode failed are null. Timestamps land on the nearest keyframe on Apple platforms and Android (their fast path), so neighbouring entries may repeat on sparse-keyframe sources; Windows decodes the frame nearest each. -
withScopedAccess<
T> (String path, Uint8List? bookmark, Future< T> body(String path)) → Future<T> -
Run
bodywith scoped access to a file. On macOS / iOS, whenbookmarkis non-null, the plugin resolves the bookmark into a security-scoped URL, starts access, hands the resolved path tobody, and stops access infinally. On all other platforms (and whenbookmarkis null)bodyis invoked withpathdirectly.