Documentation Index
Fetch the complete documentation index at: https://starrycodes.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Formatting
If true, uses the full unit names (e.g., ‘Kilobytes’); otherwise, uses abbreviations (e.g., ‘KB’).
Retrieves the file size and formats it into human-readable units (B, KB, MB, GB).final size = file.fileFormattedSize(fullySizedName: true);
print(size); // 5.32 Megabytes
Getters
Returns the file size in raw Bytes as a double.final size = file.sizeInBytes; // 1048576.0 for a 1MB file
Returns the file size in Kilobytes (KB) as a [double].print(file.sizeInKB); // 1024.0 for a 1MB file
Returns the file size in Megabytes (MB) as a [double].print(file.sizeInMB); // 1.0 for a 1MB file
Returns the file size in Gigabytes (GB) as a [double].print(file.sizeInGB); // 0.0009765625 for a 1MB file
Comparators
The size limit in megabytes.
Checks if the file size is strictly greater than the specified size in Megabytes (MB).print(file.isLargerThanMb(50)); // true if file is 50.01MB
The size limit in megabytes.
Checks if the file size is strictly less than the specified size in Megabytes (MB).print(file.isSmallerThanMb(0.5)); // true if file is 400KB
The other File object to compare size against.
Checks if this file is larger than another File object by comparing raw byte counts.print(fileA.isLargerThanFile(fileB));
The other File object to compare size against.
Checks if this file is smaller than another File object by comparing raw byte counts.print(fileA.isSmallerThanFile(fileB));
The other File object to compare size against.
Checks if this file has the exact same size (byte count) as another [File] object.print(fileA.isSameSizeAsFile(fileB));
The minimum size limit (inclusive) in megabytes.
The maximum size limit (inclusive) in megabytes.
Checks if the file size falls inclusively between the specified minimum and maximum sizes in Megabytes (MB).// Check if file is between 500 KB (0.5 MB) and 10 MB
print(file.isSizeBetween(minMB: 0.5, maxMB: 10));
Manipulators
The total limit in Megabytes (MB).
Calculates the file’s size as a percentage of a given total size limit.// If file is 5MB and limit is 100MB, returns 5.0
print(file.percentageOfLimitMb(100));