11/1/9
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import 'package:chat_gpt_flutter/chat_gpt_flutter.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/constant/credential.dart';
|
||||
|
||||
class BottomBarController extends GetxController {
|
||||
var currentIndex = 0.obs;
|
||||
@@ -23,11 +25,11 @@ class HomeScreen extends StatelessWidget {
|
||||
),
|
||||
body: Obx(() => IndexedStack(
|
||||
index: controller.currentIndex.value,
|
||||
children: const [
|
||||
HomeView(),
|
||||
ProfileView(),
|
||||
StatisticsView(),
|
||||
WalletView(),
|
||||
children: [
|
||||
HomeView(chatGpt: ChatGpt(apiKey: AppCredintials.chatGPTkey)),
|
||||
const ProfileView(),
|
||||
const StatisticsView(),
|
||||
const WalletView(),
|
||||
],
|
||||
)),
|
||||
bottomNavigationBar: Obx(() => BottomNavigationBar(
|
||||
@@ -70,12 +72,17 @@ class HomeScreen extends StatelessWidget {
|
||||
}
|
||||
|
||||
class HomeView extends StatelessWidget {
|
||||
const HomeView({super.key});
|
||||
|
||||
const HomeView({super.key, required this.chatGpt});
|
||||
final ChatGpt chatGpt;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Center(
|
||||
child: Text('Home View'),
|
||||
Map<String, dynamic> data;
|
||||
return Center(
|
||||
child: Column(
|
||||
children: [
|
||||
Text('Home View'),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,9 +169,7 @@ class CameraWidgetCardId extends StatelessWidget {
|
||||
onPressed: () =>
|
||||
cameraClassController.takePictureAndMLGoogleScan()),
|
||||
MyElevatedButton(
|
||||
title: 'Scan ID Tesseract'.tr,
|
||||
onPressed: () =>
|
||||
cameraClassController.takePictureAndTesseractScan()),
|
||||
title: 'Scan ID Tesseract'.tr, onPressed: () {}),
|
||||
],
|
||||
),
|
||||
MyElevatedButton(
|
||||
@@ -289,9 +287,7 @@ class CameraWidgetPassPort extends StatelessWidget {
|
||||
onPressed: () =>
|
||||
cameraClassController.takePictureAndMLGoogleScan()),
|
||||
MyElevatedButton(
|
||||
title: 'Scan ID Tesseract'.tr,
|
||||
onPressed: () =>
|
||||
cameraClassController.takePictureAndTesseractScan()),
|
||||
title: 'Scan ID Tesseract'.tr, onPressed: () {}),
|
||||
],
|
||||
),
|
||||
MyElevatedButton(
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import 'package:camera/camera.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.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';
|
||||
import 'package:ride/controller/home/captin/home_captain_controller.dart';
|
||||
import 'package:ride/controller/home/captin/order_request_controller.dart';
|
||||
import 'package:ride/controller/home/captin/widget/left_menu_map_captain.dart';
|
||||
import 'package:ride/controller/payment/payment_controller.dart';
|
||||
import 'package:ride/main.dart';
|
||||
import 'package:ride/views/Rate/ride_calculate_driver.dart';
|
||||
@@ -19,21 +19,24 @@ import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
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 '../../widgets/mycircular.dart';
|
||||
import 'passportimage.dart';
|
||||
|
||||
class HomeCaptain extends StatelessWidget {
|
||||
const HomeCaptain({super.key});
|
||||
|
||||
HomeCaptain({super.key});
|
||||
final LocationController locationController = LocationController();
|
||||
// final HomeCaptainController homeCaptainController = HomeCaptainController();
|
||||
// final LocationController locationController=LocationController();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(LocationController());
|
||||
Get.put(OrderRequestController());
|
||||
Get.put(HomeCaptainController());
|
||||
// Get.put(HomeCaptainController());
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: AppColor.blueColor,
|
||||
backgroundColor: AppColor.greenColor,
|
||||
elevation: 0,
|
||||
title: Text('Captain Home'.tr),
|
||||
actions: [
|
||||
GetBuilder<LocationController>(
|
||||
@@ -71,212 +74,208 @@ class HomeCaptain extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Column(
|
||||
body: Stack(
|
||||
children: [
|
||||
GetBuilder<LocationController>(
|
||||
builder: (locationController) => Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${locationController.myLocation}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
'${DateTime.now()}',
|
||||
style: AppStyle.subtitle,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// MyClass().exampleUsage();
|
||||
// },
|
||||
// child: Text(
|
||||
// "Text Button",
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
)),
|
||||
const ConnectWidget(),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
GetBuilder<HomeCaptainController>(
|
||||
builder: (homeCaptainController) => Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
width: Get.width * .8,
|
||||
height: 80,
|
||||
child: Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Entypo.wallet,
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
Text(
|
||||
' You Earn today is '.tr +
|
||||
homeCaptainController.totalMoneyToday,
|
||||
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,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
))),
|
||||
),
|
||||
GetBuilder<HomeCaptainController>(
|
||||
builder: (homeCaptainController) => Column(
|
||||
children: [
|
||||
Text(
|
||||
'Active Duration:'.tr +
|
||||
' ${homeCaptainController.activeDuration.inSeconds} seconds',
|
||||
style: const TextStyle(fontSize: 20),
|
||||
),
|
||||
Text(
|
||||
'Total Duration:'.tr +
|
||||
' ${homeCaptainController.totalDurationToday} ',
|
||||
style: const TextStyle(fontSize: 20),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(() => const RideCalculateDriver());
|
||||
},
|
||||
child: const Text('Chart')),
|
||||
const Wrap(
|
||||
children: <Widget>[
|
||||
Icon(AntDesign.facebook_square),
|
||||
Icon(AntDesign.wallet),
|
||||
Icon(Entypo.wallet),
|
||||
Icon(
|
||||
Entypo.google__with_circle,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
Icon(EvilIcons.camera),
|
||||
Icon(Feather.activity),
|
||||
Icon(
|
||||
FontAwesome.whatsapp,
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
Icon(FontAwesome5.square),
|
||||
Icon(FontAwesome5Solid.address_book),
|
||||
Icon(FontAwesome5Brands.$500px),
|
||||
Icon(Fontisto.google_play),
|
||||
Icon(Foundation.hearing_aid),
|
||||
Icon(Ionicons.logo_whatsapp),
|
||||
Icon(MaterialCommunityIcons.home_city),
|
||||
Icon(MaterialIcons.ac_unit),
|
||||
Icon(Octicons.watch),
|
||||
Icon(SimpleLineIcons.wrench),
|
||||
Icon(WeatherIcons.wi_day_sleet),
|
||||
Icon(Zocial.github),
|
||||
],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
// TwilioSMS().sendSMS(
|
||||
// recipientPhoneNumber: '+962 7 9858 3052',
|
||||
// message: 'Hello, this is a test message.',
|
||||
// );
|
||||
},
|
||||
child: const Icon(MaterialIcons.message)),
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// Get.to(() => TextExtractionView());
|
||||
// },
|
||||
// child: const Text(
|
||||
// "Text FlutterTesseractsOcr",
|
||||
// ),
|
||||
// ),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(() => PassportPage());
|
||||
},
|
||||
child: Text(
|
||||
'Passport '.tr,
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(() => PassportDataExtractorWidget());
|
||||
},
|
||||
child: Text(
|
||||
'Passport new'.tr,
|
||||
),
|
||||
),
|
||||
builder: (controller) => GoogleMap(
|
||||
onMapCreated: controller.onMapCreated,
|
||||
// cameraTargetBounds: CameraTargetBounds(controller.boundsdata),
|
||||
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
||||
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(() => const TextRecognizerWidget());
|
||||
},
|
||||
child: const Text(
|
||||
"Driver License ML",
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(
|
||||
() => CameraWidgetCardId(),
|
||||
);
|
||||
},
|
||||
child: const Text(
|
||||
"Text IdCamera",
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(
|
||||
() => CameraWidgetPassPort(),
|
||||
);
|
||||
},
|
||||
child: const Text(
|
||||
" CameraWidgetPassPort",
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(() => HomeScreen());
|
||||
},
|
||||
child: const Text(
|
||||
"Home Screen",
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
PaymentController().makePayment(
|
||||
14,
|
||||
'USD',
|
||||
() => Get.snackbar('Yes you pay success', '',
|
||||
backgroundColor: Colors.greenAccent));
|
||||
},
|
||||
child: const Text(
|
||||
"Pay 18 dollar",
|
||||
),
|
||||
),
|
||||
],
|
||||
initialCameraPosition: CameraPosition(
|
||||
target: locationController.myLocation,
|
||||
zoom: 15,
|
||||
),
|
||||
|
||||
mapType: controller.mapType ? MapType.satellite : MapType.normal,
|
||||
myLocationButtonEnabled: true,
|
||||
// liteModeEnabled: true, tiltGesturesEnabled: false,
|
||||
|
||||
// indoorViewEnabled: true,
|
||||
trafficEnabled: controller.mapTrafficON,
|
||||
buildingsEnabled: true,
|
||||
mapToolbarEnabled: true,
|
||||
|
||||
myLocationEnabled: true,
|
||||
// liteModeEnabled: true,
|
||||
),
|
||||
),
|
||||
|
||||
// GetBuilder<LocationController>(
|
||||
// builder: (locationController) => Column(
|
||||
// children: [
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.all(8.0),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Text(
|
||||
// '${locationController.myLocation}',
|
||||
// style: AppStyle.subtitle,
|
||||
// ),
|
||||
// Text(
|
||||
// '${DateTime.now()}',
|
||||
// style: AppStyle.subtitle,
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// // TextButton(
|
||||
// // onPressed: () {
|
||||
// // MyClass().exampleUsage();
|
||||
// // },
|
||||
// // child: Text(
|
||||
// // "Text Button",
|
||||
// // ),
|
||||
// // ),
|
||||
// ],
|
||||
// )),
|
||||
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
right: Get.width * .1,
|
||||
left: Get.width * .1,
|
||||
child: const ConnectWidget()),
|
||||
|
||||
Positioned(
|
||||
top: 5,
|
||||
right: Get.width * .17,
|
||||
left: Get.width * .17,
|
||||
child: GetBuilder<HomeCaptainController>(
|
||||
builder: (homeCaptainController) => Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
width: Get.width * .8,
|
||||
height: 80,
|
||||
child: Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Entypo.wallet,
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
Text(
|
||||
' You Earn today is '.tr +
|
||||
homeCaptainController.totalMoneyToday,
|
||||
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,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
))),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 65,
|
||||
right: Get.width * .1,
|
||||
left: Get.width * .1,
|
||||
child: GetBuilder<HomeCaptainController>(
|
||||
builder: (homeCaptainController) => Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'Active Duration:'.tr +
|
||||
' ${homeCaptainController.stringActiveDuration} ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'Total Connection Duration:'.tr +
|
||||
' ${homeCaptainController.totalDurationToday} ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: Get.height * .17,
|
||||
right: Get.width * .01,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: Get.width * .12,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
// Get.to(
|
||||
// () => CameraWidgetCardId(),
|
||||
// );
|
||||
},
|
||||
icon: const Icon(Fontisto.history),
|
||||
),
|
||||
),
|
||||
),
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// Get.to(
|
||||
// () => CameraWidgetCardId(),
|
||||
// );
|
||||
// },
|
||||
// child: const Text(
|
||||
// "Text IdCamera",
|
||||
// ),
|
||||
// ),
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// Get.to(
|
||||
// () => CameraWidgetPassPort(),
|
||||
// );
|
||||
// },
|
||||
// child: const Text(
|
||||
// " CameraWidgetPassPort",
|
||||
// ),
|
||||
// ),
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// Get.to(() => HomeScreen());
|
||||
// },
|
||||
// child: const Text(
|
||||
// "Home Screen",
|
||||
// ),
|
||||
// ),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(() => const TextRecognizerAPI());
|
||||
},
|
||||
child: const Text(
|
||||
"scan licnse",
|
||||
),
|
||||
),
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// PaymentController().makePayment(
|
||||
// 14,
|
||||
// 'USD',
|
||||
// () => Get.snackbar('Yes you pay success', '',
|
||||
// backgroundColor: Colors.greenAccent));
|
||||
// },
|
||||
// child: const Text(
|
||||
// "Pay 18 dollar",
|
||||
// ),
|
||||
// ),
|
||||
|
||||
leftMainMenuCaptainIcons(),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,46 +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)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
// 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)),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -6,82 +6,170 @@ import 'package:ride/views/widgets/mycircular.dart';
|
||||
|
||||
import '../../../controller/functions/ocr_controller.dart';
|
||||
|
||||
class TextExtractionView extends StatelessWidget {
|
||||
TextExtractionView({super.key});
|
||||
class TextRecognizerAPI extends StatelessWidget {
|
||||
const TextRecognizerAPI({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(TextExtractionController());
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Text Extraction'),
|
||||
),
|
||||
body: GetBuilder<TextExtractionController>(builder: (controller) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: () => controller.pickAndExtractText(),
|
||||
child: const Text('Pick Image and Extract Text'),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
controller.isloading
|
||||
? const MyCircularProgressIndicator()
|
||||
: Text(controller.extractedText),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class TextRecognizerWidget extends StatelessWidget {
|
||||
const TextRecognizerWidget({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(TextMLGoogleRecognizerController());
|
||||
return GetBuilder<TextMLGoogleRecognizerController>(
|
||||
Get.put(ScanDocumentsByApi());
|
||||
return GetBuilder<ScanDocumentsByApi>(
|
||||
builder: (controller) => Scaffold(
|
||||
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
|
||||
appBar: AppBar(
|
||||
title: Text('Api'),
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
controller.matchFaceApi();
|
||||
},
|
||||
icon: const Icon(Icons.face),
|
||||
),
|
||||
],
|
||||
))));
|
||||
),
|
||||
body: Center(
|
||||
child: controller.isLoading
|
||||
? const MyCircularProgressIndicator()
|
||||
: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Image.memory(
|
||||
controller.imagePortrait,
|
||||
width: 60,
|
||||
),
|
||||
Image.memory(
|
||||
controller.imageSignature,
|
||||
width: 60,
|
||||
),
|
||||
Image.memory(
|
||||
controller.imageDocumentFrontSide,
|
||||
width: 250,
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(controller.responseMap['authenticity_meta']
|
||||
.toString()),
|
||||
Text(
|
||||
'countryName: ${controller.responseMap['data']['countryName'].toString()}'),
|
||||
Text(
|
||||
'Expiry Date: ${controller.responseMap['data']['ocr']['dateOfExpiry'].toString()}'),
|
||||
// Add more Text widgets to display other record values
|
||||
Text(
|
||||
'Address: ${controller.responseMap['data']['ocr']['address'].toString()}'),
|
||||
Text(
|
||||
'City: ${controller.responseMap['data']['ocr']['addressCity'].toString()}'),
|
||||
Text(
|
||||
'Jurisdiction Code: ${controller.responseMap['data']['ocr']['addressJurisdictionCode'].toString()}'),
|
||||
Text(
|
||||
'Postal Code: ${controller.responseMap['data']['ocr']['addressPostalCode'].toString()}'),
|
||||
Text(
|
||||
'Street: ${controller.responseMap['data']['ocr']['addressStreet'].toString()}'),
|
||||
Text(
|
||||
'Date of Birth: ${controller.responseMap['data']['ocr']['dateOfBirth'].toString()}'),
|
||||
Text(
|
||||
'Date of Issue: ${controller.responseMap['data']['ocr']['dateOfIssue'].toString()}'),
|
||||
Text(
|
||||
'Drivers License Class: ${controller.responseMap['data']['ocr']['dlClass'].toString()}'),
|
||||
Text(
|
||||
'Document Number: ${controller.responseMap['data']['ocr']['documentNumber'].toString()}'),
|
||||
Text(
|
||||
'Eye Color: ${controller.responseMap['data']['ocr']['eyesColor'].toString()}'),
|
||||
Text(
|
||||
'Given Names: ${controller.responseMap['data']['ocr']['givenNames'].toString()}'),
|
||||
Text(
|
||||
'Height: ${controller.responseMap['data']['ocr']['height'].toString()}'),
|
||||
Text(
|
||||
'Issuing State Code: ${controller.responseMap['data']['ocr']['issuingStateCode'].toString()}'),
|
||||
Text(
|
||||
'Name: ${controller.responseMap['data']['ocr']['name'].toString()}'),
|
||||
Text(
|
||||
'Sex: ${controller.responseMap['data']['ocr']['sex'].toString()}'),
|
||||
Text(
|
||||
'Surname: ${controller.responseMap['data']['ocr']['surname'].toString()}'),
|
||||
Text(
|
||||
'Valid State: ${controller.responseMap['data']['ocr']['validState'].toString()}'),
|
||||
],
|
||||
),
|
||||
))));
|
||||
}
|
||||
}
|
||||
// class TextExtractionView extends StatelessWidget {
|
||||
// TextExtractionView({super.key});
|
||||
//
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// Get.put(TextExtractionController());
|
||||
// return Scaffold(
|
||||
// appBar: AppBar(
|
||||
// title: const Text('Text Extraction'),
|
||||
// ),
|
||||
// body: GetBuilder<TextExtractionController>(builder: (controller) {
|
||||
// return Center(
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// children: [
|
||||
// ElevatedButton(
|
||||
// onPressed: () {},
|
||||
// child: const Text('Pick Image and Extract Text'),
|
||||
// ),
|
||||
// const SizedBox(height: 20),
|
||||
// controller.isloading
|
||||
// ? const MyCircularProgressIndicator()
|
||||
// : Text(controller.extractedText),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
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')));
|
||||
}
|
||||
}
|
||||
// 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: 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 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')));
|
||||
// }
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user