PickedFile class

A file or folder chosen by the user.

Returned by UnifiedFilePicker.pick, UnifiedFilePicker.pickFiles, UnifiedFilePicker.pickFolder, and UnifiedFilePicker.saveFile.

Use path for platform I/O. On mobile, paths may use content:// or phasset:// schemes for gallery-backed items.

Constructors

PickedFile({required String path, required String name, int? size, String? mimeType, bool isDirectory = false})
Creates a picked item descriptor.
const
PickedFile.fromEntry(FileEntry entry)
Builds a PickedFile from a browsed FileEntry.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isDirectory bool
true when the user selected a directory.
final
mimeType String?
MIME type hint when available.
final
name String
Display file or folder name (basename).
final
path String
Absolute or platform-specific URI of the item.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int?
Size in bytes when known; may be null or -1 for unreadable entries.
final

Methods

copyWith({String? path, String? name, int? size, String? mimeType, bool? isDirectory}) PickedFile
Returns a copy with the given fields replaced.
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