Commit 6ae1e7c8 authored by Dio Maulana's avatar Dio Maulana

jarak swithc camera

parent 330cbc50
......@@ -353,7 +353,9 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
),
],
)
: Row(
: Stack(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
......@@ -377,10 +379,7 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
// ),
// ),
const SizedBox(
width: 35,
),
const SizedBox(
width: 20,
width: 100,
),
InkWell(
onTap: () async {
......@@ -388,17 +387,19 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
await _initializeControllerFuture;
// ambil imagenya
XFile image = await _controller!
XFile image =
await _controller!
.takePicture();
String? imageResultPhone;
Uint8List? imageResultWeb;
if (isPhone) {
imageResultPhone = image.path;
imageResultWeb =
await image.readAsBytes();
imageResultPhone =
image.path;
imageResultWeb = await image
.readAsBytes();
} else {
imageResultWeb =
await image.readAsBytes();
imageResultWeb = await image
.readAsBytes();
}
// kalau gak ke ambil gak ngelakuin aksi apa2
......@@ -424,7 +425,8 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
height: 80,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(100),
BorderRadius.circular(
100),
border: Border.all(
width: 1.5,
color: Colors.black,
......@@ -434,7 +436,7 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
),
),
const SizedBox(
width: 20,
width: 60,
),
GestureDetector(
onTap: () {
......@@ -449,7 +451,8 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
cameras![0];
}
_controller = CameraController(
_controller =
CameraController(
// Get a specific camera from the list of available cameras.
_cameraDescription!,
// Define the resolution to use.
......@@ -458,7 +461,8 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
ImageFormatGroup.jpeg,
);
_initializeControllerFuture =
_controller!.initialize();
_controller!
.initialize();
});
}
},
......@@ -470,6 +474,8 @@ class _AbsentCameraViewState extends State<AbsentCameraView> {
)
],
),
],
),
const SizedBox(
height: 30,
)
......
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