11/1/1
This commit is contained in:
@@ -24,146 +24,151 @@ class CameraWidgetCardId extends StatelessWidget {
|
||||
padding:
|
||||
const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
|
||||
child: GetBuilder<CameraClassController>(
|
||||
builder: (cameraClassController) =>
|
||||
cameraClassController.isCameraInitialized
|
||||
? Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: Get.height * .3,
|
||||
width: Get.width,
|
||||
child:
|
||||
// Image.asset(
|
||||
// 'assets/images/cardid.jpg',
|
||||
// fit: BoxFit.cover,
|
||||
// )
|
||||
CameraPreview(
|
||||
cameraClassController.cameraController,
|
||||
// child: IconButton(
|
||||
// onPressed: () {
|
||||
// cameraClassController.takePicture();
|
||||
// },
|
||||
// icon: const Icon(Icons.camera),
|
||||
// ),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 50,
|
||||
child: Container(
|
||||
width: 230,
|
||||
height: 25,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.yellowColor,
|
||||
width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 38,
|
||||
right: 5,
|
||||
child: Container(
|
||||
width: 230,
|
||||
height: 25,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.blueColor, width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 130,
|
||||
right: 5,
|
||||
child: Container(
|
||||
width: 140,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.blueColor, width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 148,
|
||||
right: 5,
|
||||
child: Container(
|
||||
width: 140,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.blueColor, width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 165,
|
||||
right: 5,
|
||||
child: Container(
|
||||
width: 140,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.blueColor, width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 182,
|
||||
right: 5,
|
||||
child: Container(
|
||||
width: 140,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.blueColor, width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 198,
|
||||
right: 5,
|
||||
child: Container(
|
||||
width: 140,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.blueColor, width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 80,
|
||||
left: 35,
|
||||
child: Container(
|
||||
width: 120,
|
||||
height: 110,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.blueColor, width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Container(
|
||||
builder: (cameraClassController) => cameraClassController
|
||||
.isCameraInitialized
|
||||
? Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: Get.height * .3,
|
||||
height: Get.width * 3 / 4,
|
||||
width: Get.width,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Camera not initilaized yet',
|
||||
style: AppStyle.title,
|
||||
child: OverflowBox(
|
||||
alignment: Alignment.center,
|
||||
child: FittedBox(
|
||||
fit: BoxFit.fitWidth,
|
||||
child: SizedBox(
|
||||
width: Get.width,
|
||||
height: Get.width *
|
||||
3 /
|
||||
4, // Set the desired aspect ratio here
|
||||
child:
|
||||
// Image.asset(
|
||||
// 'assets/images/cardid.jpg',
|
||||
// fit: BoxFit.fill,
|
||||
// )
|
||||
CameraPreview(
|
||||
cameraClassController.cameraController,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 72,
|
||||
child: Container(
|
||||
width: 230,
|
||||
height: 25,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.yellowColor, width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 60,
|
||||
right: 5,
|
||||
child: Container(
|
||||
width: 230,
|
||||
height: 25,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.blueColor, width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 156,
|
||||
right: 5,
|
||||
child: Container(
|
||||
width: 140,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.blueColor, width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 175,
|
||||
right: 5,
|
||||
child: Container(
|
||||
width: 140,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.blueColor, width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 191,
|
||||
right: 5,
|
||||
child: Container(
|
||||
width: 140,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.blueColor, width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 207,
|
||||
right: 5,
|
||||
child: Container(
|
||||
width: 140,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.blueColor, width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 225,
|
||||
right: 5,
|
||||
child: Container(
|
||||
width: 140,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.blueColor, width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 115,
|
||||
left: 25,
|
||||
child: Container(
|
||||
width: 120,
|
||||
height: 110,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.blueColor, width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: Get.width * 3 / 4,
|
||||
width: Get.width,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Camera not initilaized yet',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
@@ -179,6 +184,9 @@ class CameraWidgetCardId extends StatelessWidget {
|
||||
cameraClassController.takePictureAndTesseractScan()),
|
||||
],
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Scan ID Api'.tr,
|
||||
onPressed: () => cameraClassController.extractCardId()),
|
||||
GetBuilder<CameraClassController>(
|
||||
builder: (cameraClassController) => Expanded(
|
||||
child:
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:get/get.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/constant/table_names.dart';
|
||||
import 'package:ride/controller/functions/camer_controller.dart';
|
||||
import 'package:ride/controller/home/captin/home_captain_controller.dart';
|
||||
import 'package:ride/controller/home/captin/order_request_controller.dart';
|
||||
import 'package:ride/controller/payment/payment_controller.dart';
|
||||
@@ -205,6 +206,15 @@ class HomeCaptain extends StatelessWidget {
|
||||
"Text IdCamera",
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
CameraClassController().extractByAPI(
|
||||
'https://img.alwakeelnews.com/Content/Upload/large/b8109dd0d33af5195938104af6835fef.jpg');
|
||||
},
|
||||
child: const Text(
|
||||
"Text By API",
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
PaymentController().makePayment(
|
||||
|
||||
Reference in New Issue
Block a user