This commit is contained in:
Hamza-Ayed
2023-11-25 14:05:02 +03:00
parent 1d2ceed031
commit a8d6c509c1
37 changed files with 679 additions and 307 deletions

View File

@@ -210,7 +210,7 @@ class AiPage extends StatelessWidget {
title: 'get sql data',
kolor: AppColor.yellowColor,
onPressed: () {
// sql.deleteAllData(TableName.faceDetectTimes);
sql.deleteAllData(TableName.faceDetectTimes);
sql
.getAllData(TableName.faceDetectTimes)
.then((value) =>

View File

@@ -2,19 +2,23 @@ import 'dart:io';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:ride/controller/auth/captin/ml_google_doc.dart';
import 'package:ride/controller/auth/captin/register_captin_controller.dart';
import 'package:ride/views/widgets/my_scafold.dart';
import 'package:ride/constant/api_key.dart';
import 'package:ride/env/env.dart';
import '../../../controller/functions/ocr_controller.dart';
import '../../../constant/box_name.dart';
import '../../../constant/style.dart';
import '../../../controller/auth/captin/ml_google_doc.dart';
import '../../../controller/auth/captin/register_captin_controller.dart';
import '../../../main.dart';
import '../../widgets/elevated_btn.dart';
import '../../widgets/my_scafold.dart';
class CarLicensePage extends StatelessWidget {
CarLicensePage({super.key});
CarRegistrationRecognizerController carRegistrationRecognizerController =
Get.put(CarRegistrationRecognizerController());
RegisterCaptinController registerCaptainController =
Get.put(RegisterCaptinController());
RegisterCaptainController registerCaptainController =
Get.put(RegisterCaptainController());
@override
Widget build(BuildContext context) {
@@ -28,6 +32,11 @@ class CarLicensePage extends StatelessWidget {
child: MyElevatedButton(
title: 'Take Picture Of ID Card'.tr,
onPressed: () async {
//0vQRyaYYDWpsv73A5CZOknseK7S2sgwE
//3vQRyaYYSWpmv69A58ZOkxmeK6M1mgwEDlXrXlBl
//0pALdqDDYHvzp73Q59SIgbzjG7Z2zkhJXr
// String? visionApi = AK.serverPHP;
// print(AK.visionApi);
await carRegistrationRecognizerController.scanText();
},
)),
@@ -47,6 +56,18 @@ class CarLicensePage extends StatelessWidget {
title: 'Register'.tr,
onPressed: () async {
registerCaptainController.addLisence();
registerCaptainController.addRegisrationCarForDriver(
carRegistrationRecognizerController.extracted['vin'],
carRegistrationRecognizerController.extracted['make'],
carRegistrationRecognizerController.extracted['model'],
carRegistrationRecognizerController.extracted['year'],
carRegistrationRecognizerController.extracted['color'],
carRegistrationRecognizerController.extracted['owner'],
carRegistrationRecognizerController
.extracted['expiration_date'],
carRegistrationRecognizerController
.extracted['registration_date'],
);
registerCaptainController.register();
},
)),
@@ -56,36 +77,120 @@ class CarLicensePage extends StatelessWidget {
}
Widget buildImageWithBoundingBoxes() {
CarRegistrationRecognizerController carRegistrationRecognizerController =
Get.put(CarRegistrationRecognizerController());
if (carRegistrationRecognizerController.image == null) {
return Text('No image selected');
} else {
return Stack(
children: [
Positioned(
// top: 50,
// right: 5,
// left: 5,
// bottom: 50,
child: Image.file(
File(carRegistrationRecognizerController.image!.path),
fit: BoxFit.fill,
)),
// for (var line
// in carRegistrationRecognizerController.extractedTextWithCoordinates)
// Positioned(
// left: line['boundingBox']['left'],
// top: line['boundingBox']['top'] - Get.width * 2,
// width: line['boundingBox']['width'],
// height: line['boundingBox']['height'],
// child: Container(
// decoration: BoxDecoration(
// border: Border.all(color: Colors.red, width: 2),
// ),
// ),
// ),
],
);
}
Get.put(CarRegistrationRecognizerController());
return GetBuilder<CarRegistrationRecognizerController>(
builder: (carRegistrationRecognizerController) =>
carRegistrationRecognizerController.image == null ||
carRegistrationRecognizerController.extracted.isEmpty
? Center(
child: Text(
'No image selected yet'.tr,
style: AppStyle.headtitle2,
))
: Column(
children: [
SizedBox(
width: Get.width * .8,
height: Get.width * .5,
child: Image.file(
File(carRegistrationRecognizerController
.croppedFile!.path),
// fit: BoxFit.fill,
)),
const SizedBox(
height: 20,
),
Container(
decoration: AppStyle.boxDecoration,
height: Get.width * .5,
width: Get.width * .9,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text(
'Made :' +
carRegistrationRecognizerController
.extracted['make']
.toString(),
style: AppStyle.title,
),
Text(
'model :' +
carRegistrationRecognizerController
.extracted['model']
.toString(),
style: AppStyle.title,
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text(
'VIN :' +
carRegistrationRecognizerController
.extracted['vin']
.toString(),
style: AppStyle.title,
),
Text(
'year :' +
carRegistrationRecognizerController
.extracted['year']
.toString(),
style: AppStyle.title,
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Column(
children: [
Text(
'expiration date :' +
carRegistrationRecognizerController
.extracted['expiration_date']
.toString(),
style: AppStyle.title,
),
Text(
'registration date :' +
carRegistrationRecognizerController
.extracted['registration_date']
.toString(),
style: AppStyle.title,
),
],
),
Text(
'color :' +
carRegistrationRecognizerController
.extracted['color']
.toString(),
style: AppStyle.title,
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text(
'owner :' +
carRegistrationRecognizerController
.extracted['owner']
.toString(),
style: AppStyle.title,
),
],
),
],
),
)
],
));
}

View File

@@ -200,7 +200,7 @@ class LoginCaptin extends StatelessWidget {
// await storage.read(key: BoxName.serverAPI) ?? '';
// print(v);
// sql.deleteAllData(TableName.faceDetectTimes);
// AC credentials = AC();
AC credentials = AC();
// String apiKey = AK.secretKey;
// // // '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';
// credentials.gAK();
@@ -215,13 +215,13 @@ class LoginCaptin extends StatelessWidget {
// print('v: $v');
// 'AAAAinYllCo:APA91bF1shTpzSsSxqbfY6c60D8zs1ZsdIsl9ix6nl7GDdjCqWPRK0G0ub5SqFdb1jDpQDvQPxGg-697MWLo0sy3oYImBwBLObyhk0GjtNzyr0PbE3hI-pOvhf8Vp1xgUgBmofbZYXkH'
// 'AAAAinYllCo:APA91bF1shTpzSsSxqbfY6c60D8zs1ZsdIsl9ix6nl7GDdjCqWPRK0G0ub5SqFdb1jDpQDvQPxGg-697MWLo0sy3oYImBwBLObyhk0GjtNzyr0PbE3hI-pOvhf8Vp1xgUgBmofbZYXkH'
// // String convertedStringN = credentials.c(
// credentials.c(
// credentials.c(
// 'QFx0qy456juj3839xuy2194q629q1fj0y7XrXlBl', cs),
// cC),
// // cn);
// print('Converted v: $convertedStringN');
String convertedStringN = credentials.c(
credentials.c(
credentials.c(
'0vQRyaYYDWpsv73A5CZOknseK7S2sgwE', cs),
cC),
cn);
print('Converted v: $convertedStringN');
// //
// String retrievedStringN =
// credentials.r(convertedStringN, n);
@@ -230,14 +230,11 @@ class LoginCaptin extends StatelessWidget {
// credentials.r(retrievedStringN, c);
// print('Retrieved String: $retrievedStringC');
// String retrievedStringS = credentials.r(
// credentials.r(
// credentials.r(
// 'QFx0qy456juj3839xuy2194q629q1fj0y7XrXlBl',
// cn),
// cC),
// cs);
// print('Retrieved String: $retrievedStringS');
String retrievedStringS = credentials.r(
credentials.r(
credentials.r(convertedStringN, cn), cC),
cs);
print('Retrieved String: $retrievedStringS');
// if (retrievedStringS == apiKey) {
// print('same');
@@ -247,59 +244,6 @@ class LoginCaptin extends StatelessWidget {
// print(' ENV is ' + Env.chatGPTkey); //
// // print('storage is ' + v); //
// print('storage is ' + apiKeyf!); //
String input = """
[PAN
I/flutter (28718): wOYARMAN
I/flutter (28718): 2018 CHEV
I/flutter (28718): ASN AORESS
I/flutter (28718): rmv
I/flutter (28718): REGISTRY MOTOR VEHICL ES
I/flutter (28718): NEGIS TRATNWIYPE
I/flutter (28718): RSNTN AORLS( OrreRCNT THAN MALINO)
I/flutter (28718): Passenger Normal Red
I/flutter (28718): 274
I/flutter (28718): SILVERADO
I/flutter (28718): ESSSENOSTOoN
I/flutter (28718): Neso WNRS) ANO MALING ADOSES
I/flutter (28718): 274 CHATTERTON AVE SOMERSET MA 02726-2939
I/flutter (28718): CHRISTOPHER D WALL
I/flutter (28718): 74 CHATTERTON AVE
I/flutter (28718): SOMERSET NA
I/flutter (28718): A 02726-2939
I/flutter (28718): OEL NUMICR
I/flutter (28718): RAIL NUMOER
I/flutter (28718): 4DGY18
I/flutter (28718): oooY aYE
I/flutter (28718): PU
I/flutter (28718): M.G.L. Chapter 90 Section 24B makes it a crime to alter this Certificate
I/flutter (28718): MASSACHUSETTS DEPARTMENT OF TRANSPORTATION
I/flutter (28718): his vehicle is newty acquired, it must be inspected within 7 days
I/flutter (28718): of registration
I/flutter (28718): CERTIFICATE OF REGISTRATION
I/flutter (28718): rECVE DATE
I/flutter (28718): 21-Sep-2023
I/flutter (28718): Cancel the registration plates if:
I/flutter (28718): COLoR
I/flutter (28718): BLACK
I/flutter (28718): CHANGE OF ADORESS
I/flutter (28718): TITLE NUMUER
I/flutter (28718): VEHICLE IDENTIFICATION NUMDCR
I/flutter (28718): EXPIRES ON
I/flutter (28718): 1GCVKREC7JZ169002
I/flutter (28718): TOTAL RE GISTERED WEIGHT FOR A COMMERCIAL VEICLE CR TRALER
I/flutter (28718): US DOT LMBER FOR COMMERCAL, VEHICLE
I/flutter (28718): HSURWCE COMPi
I/flutter (28718): PLYMOUTH ROCK ASSURANCE
I/flutter (28718): CORPORATION
I/flutter (28718): MAMUM SEATVG CAPACIIYFHVEGES FOK HRE
I/flutter (28718): | RESIDENTIAL
I/flutter (28718): Important information for vehicle owners
I/flutter (28718): oun f9nia Rogistrar of Motor Vehicles
I/flutter (28718): 31-Aug-2025
I/flutter (28718): MAILING
I/flutter (28718): Cert]""";
await LlamaAi().getExractionData(input);
},
icon: const Icon(
Icons.close,

View File

@@ -0,0 +1,16 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:ride/views/widgets/my_scafold.dart';
class LogoutCaptain extends StatelessWidget {
const LogoutCaptain({super.key});
@override
Widget build(BuildContext context) {
return MyScafolld(
title: 'Log Out Page'.tr,
body: [],
isleading: true,
);
}
}

View File

@@ -12,11 +12,11 @@ class RegisterCaptin extends StatelessWidget {
@override
Widget build(BuildContext context) {
Get.put(RegisterCaptinController());
Get.put(RegisterCaptainController());
return MyScafolld(
title: 'Register Captain'.tr,
body: [
GetBuilder<RegisterCaptinController>(
GetBuilder<RegisterCaptainController>(
builder: (controller) => Form(
key: controller.formKey,
child: Padding(

View File

@@ -8,8 +8,8 @@ import 'package:ride/views/widgets/my_scafold.dart';
class VerifyEmailCaptainPage extends StatelessWidget {
VerifyEmailCaptainPage({super.key});
RegisterCaptinController registerCaptinController =
Get.put(RegisterCaptinController());
RegisterCaptainController registerCaptinController =
Get.put(RegisterCaptainController());
@override
Widget build(BuildContext context) {
return MyScafolld(
@@ -22,7 +22,7 @@ class VerifyEmailCaptainPage extends StatelessWidget {
'We sent 5 digit to your Email provided'.tr,
style: AppStyle.title.copyWith(fontSize: 20),
)),
GetBuilder<RegisterCaptinController>(
GetBuilder<RegisterCaptainController>(
builder: (controller) => Positioned(
top: 100,
left: 80,