10/27/3
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:ride/constant/colors.dart';
|
|||||||
import 'package:ride/constant/style.dart';
|
import 'package:ride/constant/style.dart';
|
||||||
import 'package:ride/controller/functions/camer_controller.dart';
|
import 'package:ride/controller/functions/camer_controller.dart';
|
||||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
|
import 'package:ride/views/widgets/my_scafold.dart';
|
||||||
|
|
||||||
class CameraWidgetCardId extends StatelessWidget {
|
class CameraWidgetCardId extends StatelessWidget {
|
||||||
final CameraClassController cameraClassController =
|
final CameraClassController cameraClassController =
|
||||||
@@ -14,169 +15,177 @@ class CameraWidgetCardId extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Column(
|
return MyScafolld(
|
||||||
children: [
|
title: 'Scan Id'.tr,
|
||||||
Padding(
|
body: [
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
|
Column(
|
||||||
child: GetBuilder<CameraClassController>(
|
children: [
|
||||||
builder: (cameraClassController) => cameraClassController
|
Padding(
|
||||||
.isCameraInitialized
|
padding:
|
||||||
? Stack(
|
const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
|
||||||
children: [
|
child: GetBuilder<CameraClassController>(
|
||||||
Container(
|
builder: (cameraClassController) =>
|
||||||
decoration: AppStyle.boxDecoration,
|
cameraClassController.isCameraInitialized
|
||||||
height: Get.height * .3,
|
? Stack(
|
||||||
width: Get.width,
|
children: [
|
||||||
child:
|
Container(
|
||||||
// Image.asset(
|
decoration: AppStyle.boxDecoration,
|
||||||
// 'assets/images/cardid.jpg',
|
height: Get.height * .3,
|
||||||
// fit: BoxFit.cover,
|
width: Get.width,
|
||||||
// )
|
child:
|
||||||
CameraPreview(
|
// Image.asset(
|
||||||
cameraClassController.cameraController,
|
// 'assets/images/cardid.jpg',
|
||||||
// child: IconButton(
|
// fit: BoxFit.cover,
|
||||||
// onPressed: () {
|
// )
|
||||||
// cameraClassController.takePicture();
|
CameraPreview(
|
||||||
// },
|
cameraClassController.cameraController,
|
||||||
// icon: const Icon(Icons.camera),
|
// child: IconButton(
|
||||||
// ),
|
// onPressed: () {
|
||||||
),
|
// cameraClassController.takePicture();
|
||||||
),
|
// },
|
||||||
Positioned(
|
// icon: const Icon(Icons.camera),
|
||||||
top: 50,
|
// ),
|
||||||
child: Container(
|
),
|
||||||
width: 230,
|
),
|
||||||
height: 25,
|
Positioned(
|
||||||
decoration: BoxDecoration(
|
top: 50,
|
||||||
// color: AppColor.blueColor,
|
child: Container(
|
||||||
border: Border.all(
|
width: 230,
|
||||||
color: AppColor.yellowColor, width: 2),
|
height: 25,
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
),
|
// color: AppColor.blueColor,
|
||||||
),
|
border: Border.all(
|
||||||
Positioned(
|
color: AppColor.yellowColor,
|
||||||
top: 38,
|
width: 2),
|
||||||
right: 5,
|
),
|
||||||
child: Container(
|
),
|
||||||
width: 230,
|
),
|
||||||
height: 25,
|
Positioned(
|
||||||
decoration: BoxDecoration(
|
top: 38,
|
||||||
// color: AppColor.blueColor,
|
right: 5,
|
||||||
border:
|
child: Container(
|
||||||
Border.all(color: AppColor.blueColor, width: 2),
|
width: 230,
|
||||||
),
|
height: 25,
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
),
|
// color: AppColor.blueColor,
|
||||||
Positioned(
|
border: Border.all(
|
||||||
top: 130,
|
color: AppColor.blueColor, width: 2),
|
||||||
right: 5,
|
),
|
||||||
child: Container(
|
),
|
||||||
width: 140,
|
),
|
||||||
height: 20,
|
Positioned(
|
||||||
decoration: BoxDecoration(
|
top: 130,
|
||||||
// color: AppColor.blueColor,
|
right: 5,
|
||||||
border:
|
child: Container(
|
||||||
Border.all(color: AppColor.blueColor, width: 2),
|
width: 140,
|
||||||
),
|
height: 20,
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
),
|
// color: AppColor.blueColor,
|
||||||
Positioned(
|
border: Border.all(
|
||||||
top: 148,
|
color: AppColor.blueColor, width: 2),
|
||||||
right: 5,
|
),
|
||||||
child: Container(
|
),
|
||||||
width: 140,
|
),
|
||||||
height: 15,
|
Positioned(
|
||||||
decoration: BoxDecoration(
|
top: 148,
|
||||||
// color: AppColor.blueColor,
|
right: 5,
|
||||||
border:
|
child: Container(
|
||||||
Border.all(color: AppColor.blueColor, width: 2),
|
width: 140,
|
||||||
),
|
height: 15,
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
),
|
// color: AppColor.blueColor,
|
||||||
Positioned(
|
border: Border.all(
|
||||||
top: 165,
|
color: AppColor.blueColor, width: 2),
|
||||||
right: 5,
|
),
|
||||||
child: Container(
|
),
|
||||||
width: 140,
|
),
|
||||||
height: 15,
|
Positioned(
|
||||||
decoration: BoxDecoration(
|
top: 165,
|
||||||
// color: AppColor.blueColor,
|
right: 5,
|
||||||
border:
|
child: Container(
|
||||||
Border.all(color: AppColor.blueColor, width: 2),
|
width: 140,
|
||||||
),
|
height: 15,
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
),
|
// color: AppColor.blueColor,
|
||||||
Positioned(
|
border: Border.all(
|
||||||
top: 182,
|
color: AppColor.blueColor, width: 2),
|
||||||
right: 5,
|
),
|
||||||
child: Container(
|
),
|
||||||
width: 140,
|
),
|
||||||
height: 15,
|
Positioned(
|
||||||
decoration: BoxDecoration(
|
top: 182,
|
||||||
// color: AppColor.blueColor,
|
right: 5,
|
||||||
border:
|
child: Container(
|
||||||
Border.all(color: AppColor.blueColor, width: 2),
|
width: 140,
|
||||||
),
|
height: 15,
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
),
|
// color: AppColor.blueColor,
|
||||||
Positioned(
|
border: Border.all(
|
||||||
top: 198,
|
color: AppColor.blueColor, width: 2),
|
||||||
right: 5,
|
),
|
||||||
child: Container(
|
),
|
||||||
width: 140,
|
),
|
||||||
height: 15,
|
Positioned(
|
||||||
decoration: BoxDecoration(
|
top: 198,
|
||||||
// color: AppColor.blueColor,
|
right: 5,
|
||||||
border:
|
child: Container(
|
||||||
Border.all(color: AppColor.blueColor, width: 2),
|
width: 140,
|
||||||
),
|
height: 15,
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
),
|
// color: AppColor.blueColor,
|
||||||
Positioned(
|
border: Border.all(
|
||||||
top: 80,
|
color: AppColor.blueColor, width: 2),
|
||||||
left: 35,
|
),
|
||||||
child: Container(
|
),
|
||||||
width: 120,
|
),
|
||||||
height: 110,
|
Positioned(
|
||||||
decoration: BoxDecoration(
|
top: 80,
|
||||||
// color: AppColor.blueColor,
|
left: 35,
|
||||||
border:
|
child: Container(
|
||||||
Border.all(color: AppColor.blueColor, width: 2),
|
width: 120,
|
||||||
),
|
height: 110,
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
),
|
// color: AppColor.blueColor,
|
||||||
],
|
border: Border.all(
|
||||||
)
|
color: AppColor.blueColor, width: 2),
|
||||||
: Container(
|
),
|
||||||
decoration: AppStyle.boxDecoration,
|
),
|
||||||
height: Get.height * .3,
|
),
|
||||||
width: Get.width,
|
],
|
||||||
child: Center(
|
)
|
||||||
child: Text(
|
: Container(
|
||||||
'Camera not initilaized yet',
|
decoration: AppStyle.boxDecoration,
|
||||||
style: AppStyle.title,
|
height: Get.height * .3,
|
||||||
),
|
width: Get.width,
|
||||||
),
|
child: Center(
|
||||||
),
|
child: Text(
|
||||||
),
|
'Camera not initilaized yet',
|
||||||
),
|
style: AppStyle.title,
|
||||||
Row(
|
),
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
),
|
||||||
children: [
|
),
|
||||||
MyElevatedButton(
|
),
|
||||||
title: 'Scan ID MklGoogle'.tr,
|
),
|
||||||
onPressed: () =>
|
Row(
|
||||||
cameraClassController.takePictureAndMLGoogleScan()),
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
MyElevatedButton(
|
children: [
|
||||||
title: 'Scan ID Tesseract'.tr,
|
MyElevatedButton(
|
||||||
onPressed: () =>
|
title: 'Scan ID MklGoogle'.tr,
|
||||||
cameraClassController.takePictureAndTesseractScan()),
|
onPressed: () =>
|
||||||
],
|
cameraClassController.takePictureAndMLGoogleScan()),
|
||||||
),
|
MyElevatedButton(
|
||||||
GetBuilder<CameraClassController>(
|
title: 'Scan ID Tesseract'.tr,
|
||||||
builder: (cameraClassController) => Expanded(
|
onPressed: () =>
|
||||||
child: Text(cameraClassController.scannedText.toString())))
|
cameraClassController.takePictureAndTesseractScan()),
|
||||||
],
|
],
|
||||||
);
|
),
|
||||||
|
GetBuilder<CameraClassController>(
|
||||||
|
builder: (cameraClassController) => Expanded(
|
||||||
|
child:
|
||||||
|
Text(cameraClassController.scannedText.toString())))
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
isleading: true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -197,10 +197,9 @@ class HomeCaptain extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.to(() => Scaffold(
|
Get.to(
|
||||||
appBar: AppBar(),
|
() => CameraWidgetCardId(),
|
||||||
body: CameraWidgetCardId(),
|
);
|
||||||
));
|
|
||||||
},
|
},
|
||||||
child: const Text(
|
child: const Text(
|
||||||
"Text IdCamera",
|
"Text IdCamera",
|
||||||
|
|||||||
Reference in New Issue
Block a user