generateWithKey method
Future<Uint8List>
generateWithKey({
- required GlobalKey<
State< key,StatefulWidget> > - required SnapshotQuality quality,
Implementation
Future<Uint8List> generateWithKey({
required GlobalKey key,
required SnapshotQuality quality,
}) async {
final boundary =
key.currentContext!.findRenderObject() as RenderRepaintBoundary;
final image = await boundary.toImage(pixelRatio: quality.pixelRatio);
return _imageToUint8List(image);
}