repaintBoundaryToImageBytes static method
Future<Uint8List?>
repaintBoundaryToImageBytes(
- RenderRepaintBoundary? boundary, {
- double pixelRatio = 3.0,
- ImageByteFormat format = ui.ImageByteFormat.png,
Implementation
static Future<Uint8List?> repaintBoundaryToImageBytes(
RenderRepaintBoundary? boundary, {
double pixelRatio = 3.0,
ui.ImageByteFormat format = ui.ImageByteFormat.png,
}) async {
final ui.Image? image = await boundary?.toImage(pixelRatio: pixelRatio);
final ByteData? byteData = await image?.toByteData(format: format);
return byteData?.buffer.asUint8List();
}