getUint8List function
- String filepath
Returns the Futurefilepath
path.
Example: getUint8List('assets/file.jpg')
Implementation
Future<Uint8List> getUint8List(String filepath) async {
final data = await PlatformAssetBundle().load(filepath);
final bytes = data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
return bytes;
}