readBytes method

Future<Uint8List> readBytes()

Returns raw bytes, reading from file when necessary.

Implementation

Future<Uint8List> readBytes() async {
  if (bytes != null) return bytes!;
  if (file != null) return file!.readAsBytes();
  throw StateError('UploadFile has neither bytes nor a file path.');
}