FileHelper class
A utility class that defines file type extensions and related constants.
The FileHelper class provides centralized access to the file extensions supported by your application for various media types (images, audio, video, documents), as well as general file constraints such as size limits.
It is typically used in upload validation, file picking, or MIME type inference.
Example usage:
if (FileHelper.imageExtensions.contains(extension)) {
print('Selected file is an image');
}
if (fileSize > FileHelper.maxSizeInBytes) {
throw Exception('File too large');
}
Constructors
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
-
allSupportedExtensions
→ List<
String> -
Returns a combined list of all supported file extensions.
no setter
-
audioExtensions
→ List<
String> -
Returns a list of supported audio file extensions.
no setter
-
documentExtensions
→ List<
String> -
Returns a list of supported document file extensions.
no setter
-
imageExtensions
→ List<
String> -
Returns a list of supported image file extensions.
no setter
- maxSizeInBytes → double
-
no setter
-
videoExtensions
→ List<
String> -
Returns a list of supported video file extensions.
no setter