getAssetImageUint8List static method

Future<Uint8List> getAssetImageUint8List(
  1. String key
)

hàm này dùng để đọc một asset (khai báo trong pubspec) ra Uint8List

Implementation

static Future<Uint8List> getAssetImageUint8List(String key) async {
  final byteData = await rootBundle.load(key);
  return byteData.buffer.asUint8List();
}