Commit 67ff122f authored by Dio Maulana's avatar Dio Maulana

get camera base on list

parent af6dfec2
......@@ -65,10 +65,10 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
getCameraDescrption().then((value) {
cameras = value;
if (cameras!.length > 1) {
_cameraDescription = cameras!.last;
_cameraDescription = cameras![1];
} else {
if (cameras!.isNotEmpty) {
_cameraDescription = cameras!.first;
_cameraDescription = cameras![0];
} else {
_cameraDescription = null;
}
......@@ -149,7 +149,7 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
)
: Image.memory(
imagePath!,
fit: BoxFit.fill,
// fit: BoxFit.fill,
)
: CameraPreview(
_controller!,
......@@ -344,12 +344,12 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
if (cameras!.length > 1) {
setState(() {
if (_cameraDescription ==
cameras!.first) {
cameras![0]) {
_cameraDescription =
cameras!.last;
cameras![1];
} else {
_cameraDescription =
cameras!.first;
cameras![0];
}
_controller = CameraController(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment