🖼️ Content & Type Checks
Reads the file contents synchronously and converts them to a
Base64 encoded string.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
🚀 Flutter_Extend Version 0.3.0 is now live! See our changelog for details.
Powerful extensions for dart:io.File to simplify size formatting, path manipulation, and type checking for local files.
fileFormattedSize() and fileToBase64String() use synchronous I/O (lengthSync, readAsBytesSync) and should be run off the main thread (e.g., in an Isolate or compute) for large files to prevent UI jank.final path = file.filePath();
// Output: /data/user/0/app.name/cache/temp.txt
print(File('/img/photo.png').fileExtension()); // png
print(File('/docs/report.pdf').fileNameWithoutExtension()); // report
Base64 encoded string.final base64 = file.fileToBase64String();
Was this page helpful?
