WidgetsToImageKey extension

on

Methods

renderImage({double pixelRatio = 6}) Future<Image?>

Available on GlobalKey<State<StatefulWidget>>, provided by the WidgetsToImageKey extension

Render a image from widget by this GlobalKey and return as ui.Image. Remember to surround your widget with WidgetsToImage and give it this GlobalKey
renderImageAsBytes({double pixelRatio = 6, ImageByteFormat format = ui.ImageByteFormat.png}) Future<bytes>

Available on GlobalKey<State<StatefulWidget>>, provided by the WidgetsToImageKey extension

Render a image from widget by this GlobalKey and return as bytes Remember to surround your widget with WidgetsToImage and give it this GlobalKey
saveImage({required File file, double pixelRatio = 6, ImageByteFormat format = ui.ImageByteFormat.png}) Future<File>

Available on GlobalKey<State<StatefulWidget>>, provided by the WidgetsToImageKey extension

Render a image from widget by this GlobalKey and save it to file. Remember to surround your widget with WidgetsToImage and give it this GlobalKey