getThumbnailFromAsset static method
Implementation
static Future<Uint8List> getThumbnailFromAsset(String assetPath) async {
final imgData = await rootBundle.load(assetPath);
var uint8List = imgData.buffer.asUint8List();
var img = imgpackage.decodeImage(uint8List);
if (img == null) {
throw Exception('Can not decode image from asset $assetPath');
}
var thumbNailData = getThumbnail(img);
return thumbNailData;
}