toUint8ListFromPath property

Future<Uint8List?> toUint8ListFromPath

Implementation

Future<Uint8List?> get toUint8ListFromPath async {
  if (this.isNotEmpty) {
    File file = File(this);
    bool exist = await file.exists();
    if (exist) {
      Uint8List data = await file.readAsBytes();

      return data;
    } else {
      return null;
    }
  }
  return null;
}