FileIO class abstract
Platform-agnostic file I/O interface for reading and writing files Implementations use dart:io for native and dart:html for web
- Implementers
Constructors
- FileIO()
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
-
computeFileHash(
String filePath) → Stream< FileHashProgress> - Computes SHA256 hash of a file by reading it in chunks Returns stream updates with progress and a final event containing FileHashProgress.hash
-
fileExists(
String filePath) → Future< bool> - Checks if a file exists at the given path
-
getFileSize(
String filePath) → Future< int> - Gets the size of a file in bytes
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readFile(
String filePath) → Future< Uint8List> - Reads entire file into memory as Uint8List
-
readFileAsStream(
String filePath, {int chunkSize = 8192}) → Stream< Uint8List> -
Reads a file in chunks and returns a stream of bytes
chunkSizedetermines the size of each chunk (default 8KB) -
toString(
) → String -
A string representation of this object.
inherited
-
writeFile(
String filePath, Uint8List data) → Future< void> - Writes bytes to a file at the given path Creates the file if it doesn't exist, overwrites if it does
-
writeFileStream(
String filePath, Stream< Uint8List> dataStream) → Future<void> - Writes a stream of bytes to a file at the given path Creates the file if it doesn't exist, overwrites if it does
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited