printWidget method

Future<void> printWidget(
  1. GlobalKey<State<StatefulWidget>> printableKey,
  2. PrintConfig config
)

Prints a widget identified by printableKey using the provided config. Make sure the widget is a Printable-Widget. Only this is able to extract the image data from the widget.

Implementation

Future<void> printWidget(GlobalKey printableKey, PrintConfig config) async =>
    print(await imageFromWidget(printableKey), config);