11/1/6
This commit is contained in:
114
lib/views/home/Captin/bottom_bar.dart
Normal file
114
lib/views/home/Captin/bottom_bar.dart
Normal file
@@ -0,0 +1,114 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
|
||||
class BottomBarController extends GetxController {
|
||||
var currentIndex = 0.obs;
|
||||
|
||||
void changePage(int index) {
|
||||
currentIndex.value = index;
|
||||
}
|
||||
}
|
||||
|
||||
class HomeScreen extends StatelessWidget {
|
||||
final BottomBarController controller = Get.put(BottomBarController());
|
||||
|
||||
HomeScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Bottom Bar Example'),
|
||||
),
|
||||
body: Obx(() => IndexedStack(
|
||||
index: controller.currentIndex.value,
|
||||
children: const [
|
||||
HomeView(),
|
||||
ProfileView(),
|
||||
StatisticsView(),
|
||||
WalletView(),
|
||||
],
|
||||
)),
|
||||
bottomNavigationBar: Obx(() => BottomNavigationBar(
|
||||
backgroundColor: Colors.greenAccent,
|
||||
currentIndex: controller.currentIndex.value,
|
||||
onTap: controller.changePage,
|
||||
items: const [
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(
|
||||
Icons.home,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
label: 'Home',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(
|
||||
Icons.person,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
label: 'Profile',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(
|
||||
Icons.bar_chart,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
label: 'Statistics',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(
|
||||
Icons.account_balance_wallet,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
label: 'Wallet',
|
||||
),
|
||||
],
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class HomeView extends StatelessWidget {
|
||||
const HomeView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Center(
|
||||
child: Text('Home View'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ProfileView extends StatelessWidget {
|
||||
const ProfileView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Center(
|
||||
child: Text('Profile View'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class StatisticsView extends StatelessWidget {
|
||||
const StatisticsView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Center(
|
||||
child: Text('Statistics View'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class WalletView extends StatelessWidget {
|
||||
const WalletView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Center(
|
||||
child: Text('Wallet View'),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -24,151 +24,261 @@ 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.width * 3 / 4,
|
||||
width: Get.width,
|
||||
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,
|
||||
builder: (cameraClassController) =>
|
||||
cameraClassController.isCameraInitialized
|
||||
? Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: FittedBox(
|
||||
fit: BoxFit.fitWidth,
|
||||
child: SizedBox(
|
||||
width: Get.width * .9,
|
||||
height: Get.width *
|
||||
.9, // Set the desired aspect ratio here
|
||||
child: 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: 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(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
MyElevatedButton(
|
||||
title: 'Scan ID MklGoogle'.tr,
|
||||
onPressed: () =>
|
||||
cameraClassController.takePictureAndMLGoogleScan()),
|
||||
MyElevatedButton(
|
||||
title: 'Scan ID Tesseract'.tr,
|
||||
onPressed: () =>
|
||||
cameraClassController.takePictureAndTesseractScan()),
|
||||
],
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Scan ID Api'.tr,
|
||||
onPressed: () => cameraClassController.extractCardId()),
|
||||
GetBuilder<CameraClassController>(
|
||||
builder: (cameraClassController) => Expanded(
|
||||
child:
|
||||
Text(cameraClassController.scannedText.toString())))
|
||||
],
|
||||
)
|
||||
],
|
||||
isleading: true);
|
||||
}
|
||||
}
|
||||
|
||||
class CameraWidgetPassPort extends StatelessWidget {
|
||||
final CameraClassController cameraClassController =
|
||||
Get.put(CameraClassController());
|
||||
|
||||
CameraWidgetPassPort({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(
|
||||
title: 'Scan Id'.tr,
|
||||
body: [
|
||||
Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
|
||||
child: GetBuilder<CameraClassController>(
|
||||
builder: (cameraClassController) =>
|
||||
cameraClassController.isCameraInitialized
|
||||
? Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: FittedBox(
|
||||
fit: BoxFit.fitWidth,
|
||||
child: SizedBox(
|
||||
width: Get.width * .9,
|
||||
height: Get.width *
|
||||
.9, // Set the desired aspect ratio here
|
||||
child: CameraPreview(
|
||||
cameraClassController.cameraController,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 35,
|
||||
left: 35,
|
||||
width: Get.width * .77,
|
||||
height:
|
||||
17, //left":95.0,"top":134.0,"width":2909.0,"height":175.0
|
||||
child: Container(
|
||||
// width: 230,
|
||||
// height: 25,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.yellowColor,
|
||||
width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 60,
|
||||
right: 25,
|
||||
width: 90,
|
||||
height: 25,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.blueColor, width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 110,
|
||||
right: 90,
|
||||
child: Container(
|
||||
width: 140,
|
||||
height: 20,
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
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(
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:camera/camera.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/constant/info.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/constant/table_names.dart';
|
||||
import 'package:ride/controller/functions/camer_controller.dart';
|
||||
@@ -10,6 +11,7 @@ import 'package:ride/controller/home/captin/order_request_controller.dart';
|
||||
import 'package:ride/controller/payment/payment_controller.dart';
|
||||
import 'package:ride/main.dart';
|
||||
import 'package:ride/views/Rate/ride_calculate_driver.dart';
|
||||
import 'package:ride/views/home/Captin/bottom_bar.dart';
|
||||
import 'package:ride/views/home/Captin/camer_widget.dart';
|
||||
import 'package:ride/views/home/Captin/text_scanner.dart';
|
||||
import 'package:ride/views/widgets/circle_container.dart';
|
||||
@@ -19,6 +21,7 @@ import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import '../../../controller/functions/location_controller.dart';
|
||||
import '../../../controller/functions/ocr_controller.dart';
|
||||
import '../../../controller/home/captin/widget/connect.dart';
|
||||
import 'passportimage.dart';
|
||||
|
||||
class HomeCaptain extends StatelessWidget {
|
||||
const HomeCaptain({super.key});
|
||||
@@ -109,18 +112,36 @@ class HomeCaptain extends StatelessWidget {
|
||||
width: Get.width * .8,
|
||||
height: 80,
|
||||
child: Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Entypo.wallet,
|
||||
color: AppColor.greenColor,
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Entypo.wallet,
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
Text(
|
||||
' You Earn today is '.tr +
|
||||
homeCaptainController.totalMoneyToday,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
' You Earn today is '.tr +
|
||||
homeCaptainController
|
||||
.totalMoneyToday, //Todo add here number for income
|
||||
style: AppStyle.title,
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Entypo.loop,
|
||||
color: AppColor.yellowColor,
|
||||
),
|
||||
Text(
|
||||
' You Have in ${AppInformation.appName} '.tr +
|
||||
homeCaptainController.totalMoneyInSEFER,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
))),
|
||||
@@ -180,20 +201,37 @@ class HomeCaptain extends StatelessWidget {
|
||||
// );
|
||||
},
|
||||
child: const Icon(MaterialIcons.message)),
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// Get.to(() => TextExtractionView());
|
||||
// },
|
||||
// child: const Text(
|
||||
// "Text FlutterTesseractsOcr",
|
||||
// ),
|
||||
// ),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(() => TextExtractionView());
|
||||
Get.to(() => PassportPage());
|
||||
},
|
||||
child: const Text(
|
||||
"Text FlutterTesseractsOcr",
|
||||
child: Text(
|
||||
'Passport '.tr,
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(() => TextRecognizerWidget());
|
||||
Get.to(() => PassportDataExtractorWidget());
|
||||
},
|
||||
child: Text(
|
||||
'Passport new'.tr,
|
||||
),
|
||||
),
|
||||
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(() => const TextRecognizerWidget());
|
||||
},
|
||||
child: const Text(
|
||||
"Text FlutterMLGoogle",
|
||||
"Driver License ML",
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
@@ -208,11 +246,20 @@ class HomeCaptain extends StatelessWidget {
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
CameraClassController().extractByAPI(
|
||||
'https://img.alwakeelnews.com/Content/Upload/large/b8109dd0d33af5195938104af6835fef.jpg');
|
||||
Get.to(
|
||||
() => CameraWidgetPassPort(),
|
||||
);
|
||||
},
|
||||
child: const Text(
|
||||
"Text By API",
|
||||
" CameraWidgetPassPort",
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(() => HomeScreen());
|
||||
},
|
||||
child: const Text(
|
||||
"Home Screen",
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
|
||||
46
lib/views/home/Captin/passportimage.dart
Normal file
46
lib/views/home/Captin/passportimage.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../../controller/functions/ocr_controller.dart';
|
||||
|
||||
class PassportDataExtractorWidget extends StatelessWidget {
|
||||
final PassportDataExtractor passportDataExtractor =
|
||||
Get.put(PassportDataExtractor());
|
||||
final PassportDataController controller = Get.put(PassportDataController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Passport Data Extractor'),
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: controller.extractDataAndDrawBoundingBoxes,
|
||||
child: const Text('Extract Data'),
|
||||
),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Stack(
|
||||
children: [
|
||||
GetBuilder<PassportDataController>(
|
||||
builder: (controller) => CustomPaint(
|
||||
painter: BoundingBoxPainter(
|
||||
controller.extractedTextWithCoordinates),
|
||||
child: GetBuilder<PassportDataExtractor>(
|
||||
builder: (controller) =>
|
||||
Image.file(File(passportDataExtractor.image!.path)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/views/widgets/mycircular.dart';
|
||||
@@ -36,99 +38,50 @@ class TextExtractionView extends StatelessWidget {
|
||||
}
|
||||
|
||||
class TextRecognizerWidget extends StatelessWidget {
|
||||
const TextRecognizerWidget({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(TextMLGoogleRecognizerController());
|
||||
return GetBuilder<TextMLGoogleRecognizerController>(
|
||||
builder: (controller) => Scaffold(
|
||||
appBar: AppBar(),
|
||||
body: Center(
|
||||
child: Text(controller.scannedText ?? ''),
|
||||
),
|
||||
));
|
||||
appBar: AppBar(),
|
||||
body: Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('${controller.decode['DRIVER_LICENSE'].toString()}'),
|
||||
Text('DL: ${controller.decode['dl_number'].toString()}'),
|
||||
Text(
|
||||
'Expiry Date: ${controller.decode['expiry_date'].toString()}'),
|
||||
Text('Last Name: ${controller.decode['lastName'].toString()}'),
|
||||
Text(
|
||||
'First Name: ${controller.decode['firstName'].toString()}'),
|
||||
Text('Address: ${controller.decode['address'].toString()}'),
|
||||
Text('Date of Birth: ${controller.decode['dob'].toString()}'),
|
||||
Text('RSTR: ${controller.decode['rstr'].toString()}'),
|
||||
Text('Class: ${controller.decode['class'].toString()}'),
|
||||
Text('End: ${controller.decode['end'].toString()}'),
|
||||
Text('DD: ${controller.decode['dd'].toString()}'),
|
||||
Text('Sex: ${controller.decode['sex'].toString()}'),
|
||||
Text('Hair: ${controller.decode['hair'].toString()}'),
|
||||
Text('Eyes: ${controller.decode['eyes'].toString()}'),
|
||||
// and so on for other fields
|
||||
],
|
||||
))));
|
||||
}
|
||||
}
|
||||
|
||||
// class TesseractWidget extends StatelessWidget {
|
||||
// final TesseractController controller = Get.put(TesseractController());
|
||||
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return Scaffold(
|
||||
// appBar: AppBar(
|
||||
// title: Text('Tesseract Implementation'),
|
||||
// ),
|
||||
// body: GetBuilder<TesseractController>(
|
||||
// builder: (controller) => Container(
|
||||
// padding: const EdgeInsets.all(16),
|
||||
// child: ListView(
|
||||
// children: <Widget>[
|
||||
// Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
// children: [
|
||||
// ElevatedButton(
|
||||
// child: Text('Select image'),
|
||||
// onPressed: controller.extractTextFromImage,
|
||||
// ),
|
||||
// controller.scanning
|
||||
// ? const MyCircularProgressIndicator()
|
||||
// : const Icon(Icons.done),
|
||||
// SizedBox(height: 16),
|
||||
// Center(child: SelectableText(controller.text)),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:get/get.dart';
|
||||
// import 'package:image_picker/image_picker.dart';
|
||||
//
|
||||
// import '../../../controller/functions/document_scanner.dart';
|
||||
//
|
||||
// class TextScanner extends StatelessWidget {
|
||||
// // final ImagePickerController _imagePickerController =
|
||||
// // Get.put(ImagePickerController());
|
||||
//
|
||||
// TextScanner({super.key});
|
||||
//
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return Scaffold(
|
||||
// appBar: AppBar(
|
||||
// title: const Text('Image Picker'),
|
||||
// ),
|
||||
// body: Center(
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// children: [
|
||||
// Obx(() {
|
||||
// // final bool textScanning =
|
||||
// // _imagePickerController.textScanning.value;
|
||||
// // final String scannedText =
|
||||
// // _imagePickerController.scannedText.value;
|
||||
//
|
||||
// if (textScanning) {
|
||||
// return const CircularProgressIndicator();
|
||||
// } else if (scannedText.isNotEmpty) {
|
||||
// return Text(scannedText);
|
||||
// } else {
|
||||
// return const Text('No text scanned');
|
||||
// }
|
||||
// }),
|
||||
// ElevatedButton(
|
||||
// onPressed: () =>
|
||||
// _imagePickerController.getImage(ImageSource.camera),
|
||||
// child: const Text('Take Picture'),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
class PassportPage extends StatelessWidget {
|
||||
PassportPage({super.key});
|
||||
PassportRecognizerController passportRecognizerController =
|
||||
Get.put(PassportRecognizerController());
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Driver License'),
|
||||
),
|
||||
body: const Center(child: Text('data')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,33 +61,33 @@ class TimerToPassengerFromDriver extends StatelessWidget {
|
||||
)
|
||||
],
|
||||
),
|
||||
controller.remainingTimeToPassengerFromDriverAfterApplied < 60
|
||||
? MyElevatedButton(
|
||||
title: 'If you in Car Now. Press Start The Ride'.tr,
|
||||
onPressed: () async {
|
||||
//todo start the trip and rest all counter ,start new counter of the trip time
|
||||
|
||||
await CRUD()
|
||||
.post(link: AppLink.updateRides, payload: {
|
||||
'id': controller.rideId,
|
||||
'rideTimeStart': DateTime.now().toString(),
|
||||
'status': 'Applied'
|
||||
});
|
||||
controller.driverArrivePassenger();
|
||||
// Send notification to driver to alert him that trip is begin
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToAnyWithoutData(
|
||||
'BeginTrip',
|
||||
box.read(BoxName.name).toString(),
|
||||
controller.driverToken.toString(),
|
||||
);
|
||||
print(controller.driverToken.toString());
|
||||
// Get.defaultDialog(
|
||||
// title: 'The Ride is Begin'.tr,
|
||||
// backgroundColor: AppColor.greenColor,
|
||||
// );
|
||||
})
|
||||
: const SizedBox()
|
||||
// controller.remainingTimeToPassengerFromDriverAfterApplied < 60
|
||||
// ? MyElevatedButton(
|
||||
// title: 'If you in Car Now. Press Start The Ride'.tr,
|
||||
// onPressed: () async {
|
||||
// //todo start the trip and rest all counter ,start new counter of the trip time
|
||||
//
|
||||
// await CRUD()
|
||||
// .post(link: AppLink.updateRides, payload: {
|
||||
// 'id': controller.rideId,
|
||||
// 'rideTimeStart': DateTime.now().toString(),
|
||||
// 'status': 'Applied'
|
||||
// });
|
||||
// controller.driverArrivePassenger();
|
||||
// // Send notification to driver to alert him that trip is begin
|
||||
// FirebaseMessagesController()
|
||||
// .sendNotificationToAnyWithoutData(
|
||||
// 'BeginTrip',
|
||||
// box.read(BoxName.name).toString(),
|
||||
// controller.driverToken.toString(),
|
||||
// );
|
||||
// print(controller.driverToken.toString());
|
||||
// // Get.defaultDialog(
|
||||
// // title: 'The Ride is Begin'.tr,
|
||||
// // backgroundColor: AppColor.greenColor,
|
||||
// // );
|
||||
// })
|
||||
// : const SizedBox()
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user