loadImageFromAssets function
从 assets 加载图片并解码为 ui.Image
Implementation
Future<ui.Image> loadImageFromAssets(
String assetPath, {
AssetBundle? bundle,
}) async {
final ByteData data = await (bundle ?? rootBundle).load(assetPath);
return decodeImageFromBytes(data.buffer.asUint8List());
}