getBytesAsync method

Future<Uint8List?> getBytesAsync()

Implementation

Future<Uint8List?> getBytesAsync() async {
  if (_bytes != null) {
    return _bytes!;
  }
  if (xFile != null) {
    _bytes = await xFile!.readAsBytes();
  } else if (platformFile != null) {
    if (platformFile?.bytes == null) {
      _bytes = await File(platformFile!.path!).readAsBytes();
    } else {
      _bytes = platformFile!.bytes!;
    }
  }
  return _bytes;
}