loadImage method

Future<Image> loadImage(
  1. String path
)

加载canvas绘制的图片

Implementation

static Future<ui.Image> loadImage(String path) async {
  var data = await rootBundle.load(path);
  var codec = await ui.instantiateImageCodec(data.buffer.asUint8List());
  var info = await codec.getNextFrame();

  return info.image;
}