Skip to content

Commit 6b4cdb7

Browse files
FIX/ADJUSTMENT: Don't paint to Canvas before taking photo with FlutterCamera - this broke nuanced render object and layer behavior in follow_the_leader. Instead, use toImageSync() on the RepaintBoundary.
1 parent c904641 commit 6b4cdb7

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

lib/src/flutter/flutter_camera.dart

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,7 @@ class FlutterCamera {
3434
);
3535
}
3636

37-
final pictureRecorder = PictureRecorder();
38-
final canvas = Canvas(pictureRecorder);
39-
final screenSize = fullscreenRenderObject.size;
40-
41-
final paintingContext = TestRecordingPaintingContext(canvas);
42-
fullscreenRenderObject.paint(paintingContext, Offset.zero);
43-
44-
final fullscreenPhoto = await pictureRecorder.endRecording().toImage(
45-
screenSize.width.round(),
46-
screenSize.height.round(),
47-
);
37+
final fullscreenPhoto = fullscreenRenderObject.toImageSync();
4838

4939
final contentFinder = finder ?? find.byType(GoldenImageBounds);
5040
expect(finder, findsOne);

0 commit comments

Comments
 (0)