This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ## 0.8.1+7
2+
3+ * Fix device orientation sometimes not affecting the camera preview orientation.
4+
15## 0.8.1+6
26
37* Remove references to the Android V1 embedding.
Original file line number Diff line number Diff line change @@ -21,17 +21,23 @@ class CameraPreview extends StatelessWidget {
2121 @override
2222 Widget build (BuildContext context) {
2323 return controller.value.isInitialized
24- ? AspectRatio (
25- aspectRatio: _isLandscape ()
26- ? controller.value.aspectRatio
27- : (1 / controller.value.aspectRatio),
28- child: Stack (
29- fit: StackFit .expand,
30- children: [
31- _wrapInRotatedBox (child: controller.buildPreview ()),
32- child ?? Container (),
33- ],
34- ),
24+ ? ValueListenableBuilder (
25+ valueListenable: controller,
26+ builder: (context, value, child) {
27+ return AspectRatio (
28+ aspectRatio: _isLandscape ()
29+ ? controller.value.aspectRatio
30+ : (1 / controller.value.aspectRatio),
31+ child: Stack (
32+ fit: StackFit .expand,
33+ children: [
34+ _wrapInRotatedBox (child: controller.buildPreview ()),
35+ child ?? Container (),
36+ ],
37+ ),
38+ );
39+ },
40+ child: child,
3541 )
3642 : Container ();
3743 }
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ description: A Flutter plugin for getting information about and controlling the
44 and streaming image buffers to dart.
55repository : https://github.com/flutter/plugins/tree/master/packages/camera/camera
66issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
7- version : 0.8.1+6
7+ version : 0.8.1+7
88
99environment :
1010 sdk : " >=2.12.0 <3.0.0"
You can’t perform that action at this time.
0 commit comments