Ian VanSchooten

Fix scanner overlay examples

... ... @@ -131,15 +131,15 @@ class ScannerOverlay extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
// TODO: use `Offset.zero & size` instead of Rect.largest
// we need to pass the size to the custom paint widget
final backgroundPath = Path()..addRect(Rect.largest);
final backgroundPath = Path()
..addRect(Rect.fromLTWH(0, 0, size.width, size.height));
final cutoutPath = Path()..addRect(scanWindow);
final backgroundPaint = Paint()
..color = Colors.black.withOpacity(0.5)
..style = PaintingStyle.fill
..blendMode = BlendMode.dstOut;
..blendMode = BlendMode.dstOver;
final backgroundWithCutout = Path.combine(
PathOperation.difference,
... ...
... ... @@ -102,9 +102,9 @@ class ScannerOverlay extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
// TODO: use `Offset.zero & size` instead of Rect.largest
// we need to pass the size to the custom paint widget
final backgroundPath = Path()..addRect(Rect.largest);
final backgroundPath = Path()
..addRect(Rect.fromLTWH(0, 0, size.width, size.height));
final cutoutPath = Path()
..addRRect(
... ... @@ -120,7 +120,7 @@ class ScannerOverlay extends CustomPainter {
final backgroundPaint = Paint()
..color = Colors.black.withOpacity(0.5)
..style = PaintingStyle.fill
..blendMode = BlendMode.dstOut;
..blendMode = BlendMode.dstOver;
final backgroundWithCutout = Path.combine(
PathOperation.difference,
... ...