screenshot
screenshot copied to clipboard
Invalid image dimensions
[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Exception: Invalid image dimensions.
E/flutter (10185): #0 ScreenshotController.capture.<anonymous closure> (package:screenshot/screenshot.dart:58:9)
I used Transform and Positioned in Stack. Using this a corner of an image goes outside.
Looks like the image corner is not an issue, this exception comes on and off.
I'm getting this error every execution with example code. Running from a background task.
E/BackgroundWorker(20720): errorCode: error, errorMessage: Exception: Invalid image dimensions.
ScreenshotController screenshotController = ScreenshotController();
await screenshotController.captureFromWidget(
Container(
height: 200,
width: 200,
padding: const EdgeInsets.all(30.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.blueAccent, width: 5.0),
color: Colors.redAccent,
),
child: Text("This is an invisible widget")
),
pixelRatio: 1.0,
).then((Uint8List image) async {
if (image != null) {
final imagePath = await File('$directory/$filename').create();
await imagePath.writeAsBytes(image);
print('BACKGROUND: img saved.');
}
});
I have the same issue.
I am facing the same issue, too. No updates yet?
same
you can try increase delay time
any update on this issue
Same here on latest version