readAsBytesSync method

Uint8List? readAsBytesSync()

Synchronously reads the file bytes if in-memory, or from filesystem on IO.

Implementation

Uint8List? readAsBytesSync() {
  if (bytes != null && bytes!.isNotEmpty) {
    return bytes!;
  }
  if (!kIsWeb && path != null && path!.isNotEmpty) {
    return io_helper.readFileBytesSync(path!);
  }
  return null;
}