Pure-Dart file/path helpers that work on every Flutter platform.
Anything touching the real filesystem should use dart:io (or a plugin)
at the call site; these helpers only deal with names and sizes.
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 Methods
-
directory(
String path) → String -
Returns the directory portion of
path(without the trailing slash). -
extensionOf(
String path) → String -
Returns the extension of
pathincluding the dot, or''when absent. -
fileName(
String path) → String -
Returns the file name (last path segment) of
path. -
hasExtension(
String name, List< String> extensions) → bool -
Whether
nameis one ofextensions(case-insensitive, no dot needed). -
isArchive(
String name) → bool -
Whether
namelooks like a compressed archive. -
isAudio(
String name) → bool -
Whether
namelooks like an audio file. -
isImage(
String name) → bool -
Whether
namelooks like an image file. -
isVideo(
String name) → bool -
Whether
namelooks like a video file. -
sizeLabel(
int bytes, {int decimals = 1}) → String - Formats a byte count as a human-readable size.