I used this package for printing images using esc/pos thermal printer. A error thrown when trying to convert more than one widgets to images. The error caused by a null value of a variable - boundary in a function - capture() in utils.dart file
Future<Uint8List?> capture() async {
try {
/// boundary widget by GlobalKey
RenderRepaintBoundary? boundary = containerKey.currentContext
?.findRenderObject() as RenderRepaintBoundary?;
/// convert boundary to image
final image = **await boundary!.toImage(pixelRatio: 6);**
Does a variable get nullified after converting a first widget?
I used this package for printing images using esc/pos thermal printer. A error thrown when trying to convert more than one widgets to images. The error caused by a null value of a variable - boundary in a function - capture() in utils.dart file
Does a variable get nullified after converting a first widget?