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

jarak swithc camera

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