Skip to content

Commit d38f9ae

Browse files
committed
feat(flutter:mirror): Fix and change rotation.
1 parent 7ddf8b0 commit d38f9ae

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

flutter/mirror/lib/camera_screen.dart

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class _CameraScreenState extends State<CameraScreen> {
2626
late Future<void>
2727
_initializeControllerFuture; //Future to wait until camera initializes
2828
int selectedCamera = 1;
29-
List<File> capturedImages = [];
3029

3130
initializeCamera(int cameraIndex) async {
3231
_controller = CameraController(
@@ -52,20 +51,26 @@ class _CameraScreenState extends State<CameraScreen> {
5251
return Scaffold(
5352
backgroundColor: Colors.blueAccent,
5453
body: Container(
55-
alignment: Alignment.topCenter,
56-
transform: Matrix4.rotationY(0),
57-
color: Colors.black,
58-
child: FutureBuilder<void>(
59-
future: _initializeControllerFuture,
60-
builder: (context, snapshot) {
61-
if (snapshot.connectionState == ConnectionState.done) {
62-
// If the Future is complete, display the preview.
63-
return CameraPreview(_controller);
64-
} else {
65-
// Otherwise, display a loading indicator.
66-
return const Center(child: CircularProgressIndicator());
67-
}
68-
},
54+
child: Container(
55+
alignment: Alignment.center,
56+
// transform: Matrix4.rotationY(1),
57+
color: Colors.black,
58+
child: FutureBuilder<void>(
59+
future: _initializeControllerFuture,
60+
builder: (context, snapshot) {
61+
if (snapshot.connectionState == ConnectionState.done) {
62+
// If the Future is complete, display the preview.
63+
return Container(
64+
alignment: Alignment.center,
65+
transform: Matrix4.rotationZ(0.5),
66+
child: CameraPreview(_controller),
67+
);
68+
} else {
69+
// Otherwise, display a loading indicator.
70+
return const Center(child: CircularProgressIndicator());
71+
}
72+
},
73+
),
6974
),
7075
),
7176
);

0 commit comments

Comments
 (0)