Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flutter: Is there a way to use the front camera?

Tags:

flutter

camera

I want to use the front camera in flutter. Instead of shooting mode, I want to make the front camera without a shooting button appear in real time for only about a third of the page. Do you have any reference material?

like image 308
lele Avatar asked Dec 21 '25 10:12

lele


1 Answers

Reference Material -

https://flutter.dev/docs/cookbook/plugins/picture-using-camera#complete-example

Here, final cameras = await availableCameras(); return the list of available cameras, and motstly the second one (index no 1) is front camera. To use front camera, just change final firstCamera = cameras.first; to final firstCamera = cameras[1];

CameraPreview(_controller)

change or bound it with sized box to determine how much you wanna use to preview the camera's output!

like image 166
xahid_rocks Avatar answered Dec 23 '25 02:12

xahid_rocks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!