readFile method

  1. @override
Future<List<int>> readFile(
  1. String path
)
override

Reads and returns the data from the file at the specified path.

Implementation

@override
Future<List<int>> readFile(String path) async {
  final file =
      await getFile(path); // getFile already resolves and handles root
  if (!await file.exists()) {
    throw FileSystemException(
        "File not found: $path (resolved to ${file.path})");
  }
  return file.readAsBytes();
}