FileNameUtils class
Platform-agnostic filename utilities
These utilities work on all platforms (mobile + web) and have no dart:io dependencies.
Features:
- Extract base name from filename (remove extensions)
- Validate file extensions
- Determine minimum file sizes
- Generate regex patterns for file matching
Platform Support: All (web + mobile)
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
- extensionRegexPattern → String
-
Creates regex pattern for matching any supported extension
no setter
Static Methods
-
getBaseName(
String filename) → String - Removes all supported extensions from filename to get base name
-
getExtension(
String filename) → String - Extracts file extension from filename
-
getMinimumSize(
String extension) → int - Gets minimum file size based on extension
-
hasValidExtension(
String filename) → bool - Validates if filename has a supported extension
-
isFileValid(
String filename, int fileSize) → bool - Validates if file meets minimum size requirements
-
isSmallFile(
String extension) → bool - Checks if file extension requires smaller minimum size
Constants
-
supportedExtensions
→ const List<
String> - Supported model file extensions (SINGLE SOURCE OF TRUTH)