ensureBytesLoaded method

Future<AppFile> ensureBytesLoaded()

Implementation

Future<AppFile> ensureBytesLoaded() async {
  if (hasBytes || xFile == null || isRemote) {
    return this;
  }

  final bytes = await xFile!.readAsBytes();
  return copyWith(
    fileBytes: bytes,
    size: size ?? bytes.lengthInBytes,
  );
}