8/11/1
This commit is contained in:
@@ -1,72 +1,73 @@
|
||||
import 'package:secure_string_operations/secure_string_operations.dart';
|
||||
|
||||
import '../env/env.dart';
|
||||
import 'char_map.dart';
|
||||
import 'credential.dart';
|
||||
|
||||
class AK {
|
||||
static final AC a = AC();
|
||||
|
||||
static final String publishableKey =
|
||||
AC().r(AC().r(AC().r(Env.stripePublishableKe, cn), cC), cs);
|
||||
static final String secretKey = a.r(a.r(a.r(Env.secretKey, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.stripePublishableKe, cn), cC), cs);
|
||||
static final String secretKey = X.r(X.r(X.r(Env.secretKey, cn), cC), cs);
|
||||
static final String basicAuthCredentials =
|
||||
a.r(a.r(a.r(Env.basicAuthCredentials, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.basicAuthCredentials, cn), cC), cs);
|
||||
static final String accountSIDTwillo =
|
||||
a.r(a.r(a.r(Env.accountSIDTwillo, cn), cC), cs);
|
||||
static final String serverAPI = a.r(a.r(a.r(Env.serverAPI, cn), cC), cs);
|
||||
static final String mapAPIKEY = a.r(a.r(a.r(Env.mapAPIKEY, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.accountSIDTwillo, cn), cC), cs);
|
||||
static final String serverAPI = X.r(X.r(X.r(Env.serverAPI, cn), cC), cs);
|
||||
static final String mapAPIKEY = X.r(X.r(X.r(Env.mapAPIKEY, cn), cC), cs);
|
||||
static final String twilloRecoveryCode =
|
||||
a.r(a.r(a.r(Env.twilloRecoveryCode, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.twilloRecoveryCode, cn), cC), cs);
|
||||
static final String authTokenTwillo =
|
||||
a.r(a.r(a.r(Env.authTokenTwillo, cn), cC), cs);
|
||||
static final String chatGPTkey = a.r(a.r(a.r(Env.chatGPTkey, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.authTokenTwillo, cn), cC), cs);
|
||||
static final String chatGPTkey = X.r(X.r(X.r(Env.chatGPTkey, cn), cC), cs);
|
||||
static final String transactionCloude =
|
||||
a.r(a.r(a.r(Env.transactionCloude, cn), cC), cs);
|
||||
static final String visionApi = a.r(a.r(a.r(Env.visionApi, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.transactionCloude, cn), cC), cs);
|
||||
static final String visionApi = X.r(X.r(X.r(Env.visionApi, cn), cC), cs);
|
||||
static final String chatGPTkeySefer =
|
||||
a.r(a.r(a.r(Env.chatGPTkeySefer, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.chatGPTkeySefer, cn), cC), cs);
|
||||
static final String chatGPTkeySeferNew =
|
||||
a.r(a.r(a.r(Env.chatGPTkeySeferNew, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.chatGPTkeySeferNew, cn), cC), cs);
|
||||
static final String serverPHP = Env.serverPHP;
|
||||
static final String llamaKey = a.r(a.r(a.r(Env.llamaKey, cn), cC), cs);
|
||||
static final String cohere = a.r(a.r(a.r(Env.cohere, cn), cC), cs);
|
||||
static final String claudeAiAPI = a.r(a.r(a.r(Env.claudeAiAPI, cn), cC), cs);
|
||||
static final String llamaKey = X.r(X.r(X.r(Env.llamaKey, cn), cC), cs);
|
||||
static final String cohere = X.r(X.r(X.r(Env.cohere, cn), cC), cs);
|
||||
static final String claudeAiAPI = X.r(X.r(X.r(Env.claudeAiAPI, cn), cC), cs);
|
||||
static final String payPalClientId =
|
||||
a.r(a.r(a.r(Env.payPalClientId, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.payPalClientId, cn), cC), cs);
|
||||
static final String payPalSecret =
|
||||
a.r(a.r(a.r(Env.payPalSecret, cn), cC), cs);
|
||||
static final String geminiApi = a.r(a.r(a.r(Env.geminiApi, cn), cC), cs);
|
||||
static final String agoraAppId = a.r(a.r(a.r(Env.agoraAppId, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.payPalSecret, cn), cC), cs);
|
||||
static final String geminiApi = X.r(X.r(X.r(Env.geminiApi, cn), cC), cs);
|
||||
static final String agoraAppId = X.r(X.r(X.r(Env.agoraAppId, cn), cC), cs);
|
||||
static final String agoraAppCertificate =
|
||||
a.r(a.r(a.r(Env.agoraAppCertificate, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.agoraAppCertificate, cn), cC), cs);
|
||||
static final String payPalClientIdLive =
|
||||
a.r(a.r(a.r(Env.payPalClientIdLive, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.payPalClientIdLive, cn), cC), cs);
|
||||
static final String payPalSecretLive =
|
||||
a.r(a.r(a.r(Env.payPalSecretLive, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.payPalSecretLive, cn), cC), cs);
|
||||
static final String integrationIdPayMob =
|
||||
a.r(a.r(a.r(Env.integrationIdPayMob, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.integrationIdPayMob, cn), cC), cs);
|
||||
static final String passwordPayMob =
|
||||
a.r(a.r(a.r(Env.passwordPayMob, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.passwordPayMob, cn), cC), cs);
|
||||
static final String usernamePayMob =
|
||||
a.r(a.r(a.r(Env.usernamePayMob, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.usernamePayMob, cn), cC), cs);
|
||||
static final String payMobApikey =
|
||||
a.r(a.r(a.r(Env.payMobApikey, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.payMobApikey, cn), cC), cs);
|
||||
static final String integrationIdPayMobWallet =
|
||||
a.r(a.r(a.r(Env.integrationIdPayMobWallet, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.integrationIdPayMobWallet, cn), cC), cs);
|
||||
static final String smsPasswordEgypt =
|
||||
a.r(a.r(a.r(Env.smsPasswordEgypt, cn), cC), cs);
|
||||
static final String ocpApimSubscriptionKey =
|
||||
a.r(a.r(a.r(Env.ocpApimSubscriptionKey, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.smsPasswordEgypt, cn), cC), cs);
|
||||
static final String ocpApimSubscriptionKey = Env.ocpApimSubscriptionKey;
|
||||
static final String chatGPTkeySeferNew4 =
|
||||
a.r(a.r(a.r(Env.chatGPTkeySeferNew4, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.chatGPTkeySeferNew4, cn), cC), cs);
|
||||
static final String anthropicAIkeySeferNew =
|
||||
a.r(a.r(a.r(Env.anthropicAIkeySeferNew, cn), cC), cs);
|
||||
static final String llama3Key = a.r(a.r(a.r(Env.llama3Key, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.anthropicAIkeySeferNew, cn), cC), cs);
|
||||
static final String llama3Key = X.r(X.r(X.r(Env.llama3Key, cn), cC), cs);
|
||||
static final String payMobOutClientSecrret =
|
||||
a.r(a.r(a.r(Env.payMobOutClientSecrret, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.payMobOutClientSecrret, cn), cC), cs);
|
||||
static final String payMobOutClient_id =
|
||||
a.r(a.r(a.r(Env.payMobOutClient_id, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.payMobOutClient_id, cn), cC), cs);
|
||||
static final String payMobOutPassword =
|
||||
a.r(a.r(a.r(Env.payMobOutPassword, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.payMobOutPassword, cn), cC), cs);
|
||||
static final String payMobOutUserName =
|
||||
a.r(a.r(a.r(Env.payMobOutUserName, cn), cC), cs);
|
||||
X.r(X.r(X.r(Env.payMobOutUserName, cn), cC), cs);
|
||||
|
||||
///////////
|
||||
static final String keyOfApp = X.r(X.r(X.r(Env.keyOfApp, cn), cC), cs);
|
||||
}
|
||||
|
||||
@@ -6,9 +6,10 @@ class AppInformation {
|
||||
'https://www.linkedin.com/in/hamza-ayed/';
|
||||
static const String website = 'https://mobile-app.store';
|
||||
static const String email = 'hamzaayed@mobile-app.store';
|
||||
static const String complaintPrompt =
|
||||
'for this data for complaint from driver or passenger i collect all data i want you analyze this complaint and show what is reason and what is solution .this data collected from many table to find solution if payment in visa not complete and if ride status is finished it will be paymnet in payment table if ride status is not finished there is no need to pay and payment table is null for this ride and if paymentFromPaymentTable not null and visa type not cash the payment sucssessed . if ratingpassenger is low or passengr rating drivers low grade then dont mine of this passenger ,look at driver too like passengerratingdriver with rating or ratingtopassenger .in json add status of complaint and message to passenger and message to driver and message to call center write in arabic in json output with key in english .for output please just json i want';
|
||||
|
||||
static const String privacyPolicy =
|
||||
'''
|
||||
static const String privacyPolicy = '''
|
||||
|
||||
<body monica-version="2.4.0" monica-id="ofpnmcalabcbjgholdjcjblkibolbppb">
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import '../env/env.dart';
|
||||
|
||||
class AppLink {
|
||||
// static const String server = 'https://globalsefer.online/sefer/';
|
||||
static final String server = Env.serverPHP;
|
||||
static String googleMapsLink = 'https://maps.googleapis.com/maps/api/';
|
||||
static String llama = 'https://api.llama-api.com/chat/completions';
|
||||
@@ -222,8 +223,27 @@ class AppLink {
|
||||
static String getRidesPerMonth =
|
||||
"$server/Admin/AdminRide/getRidesPerMonth.php";
|
||||
static String getRidesDetails = "$server/Admin/AdminRide/get.php";
|
||||
static String getPassengersStatic =
|
||||
"https://api.sefer.live/sefer/serviceApp/getPassengersStatic.php";
|
||||
static String getPassengersStatic = "$serviceApp/getPassengersStatic.php";
|
||||
static String getdriverstotalMonthly =
|
||||
"https://api.sefer.live/sefer/serviceApp/getdriverstotalMonthly.php";
|
||||
"$serviceApp/getdriverstotalMonthly.php";
|
||||
|
||||
////////////////////////
|
||||
static String serviceApp = "$server/serviceApp";
|
||||
static String editCarPlate = "$serviceApp/editCarPlate.php";
|
||||
static String getComplaintAllData = "$serviceApp/getComplaintAllData.php";
|
||||
static String getComplaintAllDataForDriver =
|
||||
"$serviceApp/getComplaintAllDataForDriver.php";
|
||||
static String addCriminalDocuments = "$authCaptin/addCriminalDocuments.php";
|
||||
static String getPassengersByPhone =
|
||||
"$server/serviceApp/getPassengersByPhone.php";
|
||||
static String getDriverByPhone = "$serviceApp/getDriverByPhone.php";
|
||||
static String getNewDriverRegister = "$serviceApp/getNewDriverRegister.php";
|
||||
static String addWelcomeDriverNote = "$serviceApp/addWelcomeDriverNote.php";
|
||||
static String getDriverNotCompleteRegistration =
|
||||
"$serviceApp/getDriverNotCompleteRegistration.php";
|
||||
static String getPassengersNotCompleteRegistration =
|
||||
"$serviceApp/getPassengersNotCompleteRegistration.php";
|
||||
static String addNotesDriver = "$serviceApp/addNotesDriver.php";
|
||||
static String getCarPlateNotEdit = "$serviceApp/getCarPlateNotEdit.php";
|
||||
static String addNotesPassenger = "$serviceApp/addNotesPassenger.php";
|
||||
}
|
||||
|
||||
@@ -6,47 +6,31 @@ import 'box_name.dart';
|
||||
import 'colors.dart';
|
||||
|
||||
class AppStyle {
|
||||
static TextStyle headTitle = TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 40,
|
||||
color: AppColor.accentColor,
|
||||
fontFamily: box.read(BoxName.lang) == 'en'
|
||||
? GoogleFonts.josefinSans().fontFamily
|
||||
: box.read(BoxName.lang) == 'ar'
|
||||
? GoogleFonts.habibi().fontFamily
|
||||
: GoogleFonts.josefinSans().fontFamily);
|
||||
static TextStyle headTitle2 = TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 26,
|
||||
color: AppColor.primaryColor,
|
||||
fontFamily: box.read(BoxName.lang) == 'en'
|
||||
? GoogleFonts.josefinSans().fontFamily
|
||||
: box.read(BoxName.lang) == 'ar'
|
||||
? GoogleFonts.amiri().fontFamily
|
||||
: GoogleFonts.josefinSans().fontFamily);
|
||||
static TextStyle title = TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
color: AppColor.primaryColor,
|
||||
fontFamily: box.read(BoxName.lang) == 'en'
|
||||
? GoogleFonts.josefinSans().fontFamily
|
||||
: box.read(BoxName.lang) == 'ar'
|
||||
? GoogleFonts.amiri().fontFamily
|
||||
: GoogleFonts.josefinSans().fontFamily);
|
||||
static TextStyle subtitle = TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13,
|
||||
color: AppColor.primaryColor,
|
||||
fontFamily: box.read(BoxName.lang) == 'en'
|
||||
? GoogleFonts.josefinSans().fontFamily
|
||||
: box.read(BoxName.lang) == 'ar'
|
||||
? GoogleFonts.amiri().fontFamily
|
||||
: GoogleFonts.josefinSans().fontFamily);
|
||||
static TextStyle number = TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14,
|
||||
color: AppColor.primaryColor,
|
||||
fontFamily: GoogleFonts.averiaSansLibre().fontFamily);
|
||||
static TextStyle headTitle = const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 40,
|
||||
color: AppColor.accentColor,
|
||||
);
|
||||
static TextStyle headTitle2 = const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 26,
|
||||
color: AppColor.primaryColor,
|
||||
);
|
||||
static TextStyle title = const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
color: AppColor.primaryColor,
|
||||
);
|
||||
static TextStyle subtitle = const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 13,
|
||||
color: AppColor.primaryColor,
|
||||
);
|
||||
static TextStyle number = const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14,
|
||||
color: AppColor.primaryColor,
|
||||
);
|
||||
|
||||
static BoxDecoration boxDecoration = const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
|
||||
590
lib/controller/admin/register_captain_controller.dart
Normal file
590
lib/controller/admin/register_captain_controller.dart
Normal file
@@ -0,0 +1,590 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:ffi';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import '../../constant/api_key.dart';
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../constant/colors.dart';
|
||||
import '../../constant/info.dart';
|
||||
import '../../constant/links.dart';
|
||||
import '../../constant/style.dart';
|
||||
import '../../main.dart';
|
||||
import '../functions/crud.dart';
|
||||
|
||||
class RegisterCaptainController extends GetxController {
|
||||
bool isDriverSaved = false;
|
||||
bool isCarSaved = false;
|
||||
Map<String, dynamic>? arguments;
|
||||
String? driverId;
|
||||
String? email;
|
||||
String? phone;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
arguments = Get.arguments;
|
||||
initArguments();
|
||||
}
|
||||
|
||||
void driveInit() {
|
||||
arguments = Get.arguments;
|
||||
initArguments();
|
||||
}
|
||||
|
||||
void initArguments() {
|
||||
if (arguments != null) {
|
||||
driverId = arguments!['driverId'];
|
||||
email = arguments!['email'];
|
||||
phone = arguments!['phone_number'];
|
||||
} else {
|
||||
print('Arguments are null');
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> responseMap = {};
|
||||
Map<String, dynamic> responseCarLicenseMapJordan = {};
|
||||
Map<String, dynamic> responseBackCarLicenseMap = {};
|
||||
Map<String, dynamic> responseIdCardMap = {};
|
||||
Map<String, dynamic> responseIdCardDriverEgyptBack = {};
|
||||
Map<String, dynamic> responseForComplaint = {};
|
||||
Map<String, dynamic> responseIdCardDriverEgyptFront = {};
|
||||
Map<String, dynamic> responseIdEgyptFront = {};
|
||||
Map<String, dynamic> responseCriminalRecordEgypt = {};
|
||||
Map<String, dynamic> responseIdEgyptBack = {};
|
||||
Map<String, dynamic> responseIdEgyptDriverLicense = {};
|
||||
String? responseIdCardDriverEgypt1;
|
||||
bool isloading = false;
|
||||
var image;
|
||||
DateTime now = DateTime.now();
|
||||
|
||||
bool isLoading = false;
|
||||
Future allMethodForAI(String prompt, imagePath, driverID) async {
|
||||
isLoading = true;
|
||||
update();
|
||||
|
||||
var extractedString = await CRUD().arabicTextExtractByVisionAndAI(
|
||||
imagePath: imagePath, driverID: driverID);
|
||||
var json = jsonDecode(extractedString);
|
||||
var textValues = extractTextFromLines(json);
|
||||
// await Get.put(AI()).geminiAiExtraction(prompt, textValues, imagePath);
|
||||
await Get.put(RegisterCaptainController())
|
||||
.anthropicAI(textValues, prompt, imagePath);
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
String extractTextFromLines(Map<String, dynamic> jsonData) {
|
||||
final readResult = jsonData['readResult'];
|
||||
final blocks = readResult['blocks'];
|
||||
|
||||
final StringBuffer buffer = StringBuffer();
|
||||
|
||||
for (final block in blocks) {
|
||||
final lines = block['lines'];
|
||||
for (final line in lines) {
|
||||
final text = line['text'];
|
||||
buffer.write(text);
|
||||
buffer.write('\n');
|
||||
}
|
||||
}
|
||||
|
||||
return buffer.toString().trim();
|
||||
}
|
||||
|
||||
List driverNotCompleteRegistration = [];
|
||||
getDriverNotCompleteRegistration() async {
|
||||
var res = await CRUD()
|
||||
.get(link: AppLink.getDriverNotCompleteRegistration, payload: {});
|
||||
if (res != 'failure') {
|
||||
var d = jsonDecode(res)['message'];
|
||||
driverNotCompleteRegistration = d;
|
||||
update();
|
||||
} else {
|
||||
Get.snackbar(res, '');
|
||||
}
|
||||
}
|
||||
|
||||
final today = DateTime.now();
|
||||
|
||||
Future<void> addDriverAndCarEgypt() async {
|
||||
final expiryDate = responseIdEgyptDriverLicense['expiry_date'];
|
||||
final expiryDateTime = DateTime.tryParse(expiryDate);
|
||||
final isExpired = expiryDateTime != null && expiryDateTime.isBefore(today);
|
||||
|
||||
final taxExpiryDate = responseIdCardDriverEgyptBack['tax_expiry'];
|
||||
|
||||
// Get the inspection date from the response
|
||||
final inspectionDate = responseIdCardDriverEgyptBack['inspection_date'];
|
||||
final year = int.parse(inspectionDate.split('-')[0]);
|
||||
// Try parsing the tax expiry date. If it fails, set it to null.
|
||||
final taxExpiryDateTime = DateTime.tryParse(taxExpiryDate ?? '');
|
||||
final isExpiredCar =
|
||||
taxExpiryDateTime != null && taxExpiryDateTime.isBefore(today);
|
||||
|
||||
// Check if the inspection date is before today
|
||||
final inspectionDateTime = DateTime(year, 1, 1);
|
||||
final isInspectionExpired = inspectionDateTime.isBefore(today);
|
||||
|
||||
if (isExpiredCar || isInspectionExpired) {
|
||||
Get.defaultDialog(
|
||||
title: 'Expired Driver’s License'.tr,
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.warning, size: 48, color: Colors.red),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
'Your driver’s license and/or car tax has expired. Please renew them before proceeding.'
|
||||
.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
// await Get.find<TextToSpeechController>().speakText(
|
||||
// 'Your driver’s license and/or car tax has expired. Please renew them before proceeding.'
|
||||
// .tr,
|
||||
// );
|
||||
},
|
||||
icon: const Icon(Icons.volume_up),
|
||||
),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
child: const Text('OK'),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else if (isExpired) {
|
||||
Get.defaultDialog(
|
||||
title: 'Expired Driver’s License'.tr,
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.warning, size: 48, color: Colors.red),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
'Your driver’s license has expired. Please renew it before proceeding.'
|
||||
.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
// await Get.find<TextToSpeechController>().speakText(
|
||||
// 'Your driver’s license has expired. Please renew it before proceeding.'
|
||||
// .tr,
|
||||
// );
|
||||
},
|
||||
icon: const Icon(Icons.volume_up),
|
||||
),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
child: const Text('OK'),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else if (responseIdEgyptDriverLicense['national_number']
|
||||
.toString()
|
||||
.substring(0, 12) !=
|
||||
responseIdEgyptBack['nationalID'].toString().substring(0, 12)) {
|
||||
Get.defaultDialog(
|
||||
barrierDismissible: false,
|
||||
title: 'ID Mismatch',
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.warning, size: 48, color: Colors.red),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
'The national number on your driver’s license does not match the one on your ID document. Please verify and provide the correct documents.'
|
||||
.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
// await Get.find<TextToSpeechController>().speakText(
|
||||
// 'The national number on your driver’s license does not match the one on your ID document. Please verify and provide the correct documents.',
|
||||
// );
|
||||
},
|
||||
icon: const Icon(Icons.volume_up),
|
||||
),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
child: const Text('OK'),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
// else if (responseCriminalRecordEgypt['FullName'] !=
|
||||
// responseIdEgyptDriverLicense['name_arabic']) {
|
||||
// Get.defaultDialog(
|
||||
// barrierDismissible: false,
|
||||
// title: 'Criminal Record Mismatch',
|
||||
// content: Column(
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
// children: [
|
||||
// const Icon(Icons.warning, size: 48, color: Colors.red),
|
||||
// const SizedBox(height: 16),
|
||||
// Text(
|
||||
// 'The full name on your criminal record does not match the one on your driver’s license. Please verify and provide the correct documents.'
|
||||
// .tr,
|
||||
// textAlign: TextAlign.center,
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// const SizedBox(height: 16),
|
||||
// IconButton(
|
||||
// onPressed: () async {
|
||||
// await Get.find<TextToSpeechController>().speakText(
|
||||
// 'The full name on your criminal record does not match the one on your driver’s license. Please verify and provide the correct documents.'
|
||||
// .tr,
|
||||
// );
|
||||
// },
|
||||
// icon: const Icon(Icons.volume_up),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// actions: [
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// Get.back();
|
||||
// },
|
||||
// child: const Text('OK'),
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// }
|
||||
else {
|
||||
await addDriverEgypt();
|
||||
await addRegistrationCarEgypt();
|
||||
|
||||
if (isCarSaved && isDriverSaved) {
|
||||
Get.snackbar('added', '',
|
||||
backgroundColor:
|
||||
AppColor.greenColor); // Get.offAll(() => HomeCaptain());
|
||||
// Get.offAll(() => HomeCaptain());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> addDriverEgypt() async {
|
||||
isLoading = true;
|
||||
update();
|
||||
|
||||
var payload = {
|
||||
'first_name': responseIdEgyptDriverLicense['firstName']?.toString() ??
|
||||
'Not specified',
|
||||
'last_name': responseIdEgyptDriverLicense['lastName']?.toString() ??
|
||||
'Not specified',
|
||||
'email': email?.toString() ?? 'Not specified',
|
||||
'phone': phone?.toString() ?? 'Not specified',
|
||||
'id': driverId?.toString() ?? 'Not specified',
|
||||
'password': '123456',
|
||||
'gender': responseIdEgyptBack['gender']?.toString() ?? 'Not specified',
|
||||
'license_type':
|
||||
responseIdEgyptDriverLicense['license_type']?.toString() ??
|
||||
'Not specified',
|
||||
'national_number':
|
||||
responseIdEgyptBack['nationalID']?.toString() ?? 'Not specified',
|
||||
'name_arabic': responseIdEgyptDriverLicense['name_arabic']?.toString() ??
|
||||
'Not specified',
|
||||
'name_english':
|
||||
responseIdEgyptDriverLicense['name_english']?.toString() ??
|
||||
'Not specified',
|
||||
'issue_date': responseIdEgyptDriverLicense['issue_date']?.toString() ??
|
||||
'Not specified',
|
||||
'expiry_date': responseIdEgyptDriverLicense['expiry_date']?.toString() ??
|
||||
'Not specified',
|
||||
'license_categories': responseIdEgyptDriverLicense['license_categories']
|
||||
is List
|
||||
? responseIdEgyptDriverLicense['license_categories'].join(', ')
|
||||
: responseIdEgyptDriverLicense['license_categories']?.toString() ??
|
||||
'Not specified',
|
||||
'address': responseIdEgyptFront['address']?.toString() ?? 'Not specified',
|
||||
'card_id': responseIdEgyptFront['card_id']?.toString() ?? 'Not specified',
|
||||
'occupation':
|
||||
responseIdEgyptBack['occupation']?.toString() ?? 'Not specified',
|
||||
'education':
|
||||
responseIdEgyptBack['occupation']?.toString() ?? 'Not specified',
|
||||
'licenseIssueDate':
|
||||
responseIdEgyptDriverLicense['issue_date']?.toString() ??
|
||||
'Not specified',
|
||||
'religion':
|
||||
responseIdEgyptBack['religion']?.toString() ?? 'Not specified',
|
||||
'status': 'yet',
|
||||
'birthdate': responseIdEgyptFront['dob']?.toString() ?? 'Not specified',
|
||||
'maritalStatus':
|
||||
responseIdEgyptBack['maritalStatus']?.toString() ?? 'Not specified',
|
||||
'site': responseIdEgyptDriverLicense['address']?.toString() ??
|
||||
'Not specified',
|
||||
'employmentType':
|
||||
responseIdEgyptDriverLicense['employmentType']?.toString() ??
|
||||
'Not specified',
|
||||
};
|
||||
var res = await CRUD().post(link: AppLink.signUpCaptin, payload: payload);
|
||||
var status1 = jsonDecode(res);
|
||||
isLoading = false;
|
||||
update();
|
||||
// Handle response
|
||||
if (status1['status'] == 'success') {
|
||||
isDriverSaved = true;
|
||||
Get.snackbar('Success', 'Driver data saved successfully',
|
||||
backgroundColor: AppColor.greenColor);
|
||||
} else {
|
||||
Get.snackbar('Error', 'Failed to save driver data',
|
||||
backgroundColor: Colors.red);
|
||||
}
|
||||
}
|
||||
|
||||
addCriminalDeocuments() async {
|
||||
var res = await CRUD().post(link: AppLink.addCriminalDocuments, payload: {
|
||||
"driverId": box.read(BoxName.driverID),
|
||||
"IssueDate": responseCriminalRecordEgypt['IssueDate'],
|
||||
"InspectionResult": responseCriminalRecordEgypt['InspectionResult'],
|
||||
});
|
||||
if (res != 'failure') {
|
||||
Get.snackbar('uploaded sucssefuly'.tr, '');
|
||||
}
|
||||
}
|
||||
|
||||
Future addRegistrationCarEgypt() async {
|
||||
try {
|
||||
isLoading = true;
|
||||
update();
|
||||
var res = await CRUD().post(link: AppLink.addRegisrationCar, payload: {
|
||||
'driverID': driverId,
|
||||
'vin': responseIdCardDriverEgyptBack['chassis'].toString(),
|
||||
'car_plate': responseIdCardDriverEgyptFront['car_plate'].toString(),
|
||||
'make': responseIdCardDriverEgyptBack['make'].toString(),
|
||||
'model': responseIdCardDriverEgyptBack['model'],
|
||||
'year': responseIdCardDriverEgyptBack['year'].toString(),
|
||||
'expiration_date':
|
||||
responseIdCardDriverEgyptFront['LicenseExpirationDate'].toString(),
|
||||
'color': responseIdCardDriverEgyptBack['color'],
|
||||
'owner': responseIdCardDriverEgyptFront['owner'],
|
||||
'color_hex': responseIdCardDriverEgyptBack['color_hex'].toString(),
|
||||
'address': responseIdCardDriverEgyptFront['address'].toString(),
|
||||
'displacement': responseIdCardDriverEgyptBack['engine'].toString(),
|
||||
'fuel': responseIdCardDriverEgyptBack['fuel'].toString(),
|
||||
'registration_date':
|
||||
'${responseIdCardDriverEgyptBack['inspection_date']}',
|
||||
});
|
||||
isLoading = false;
|
||||
update();
|
||||
var status = jsonDecode(res);
|
||||
if (status['status'] == 'success') {
|
||||
isCarSaved = true;
|
||||
Get.snackbar('Success', 'message',
|
||||
backgroundColor: AppColor.greenColor);
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
Future getComplaintDataToAI() async {
|
||||
var res = await CRUD().get(
|
||||
link: AppLink.getComplaintAllDataForDriver,
|
||||
payload: {'driver_id': driverId.toString()},
|
||||
);
|
||||
if (res != 'failure') {
|
||||
var d = jsonDecode(res)['message'];
|
||||
return d;
|
||||
} else {
|
||||
return [
|
||||
{'data': 'no data'}
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Future<dynamic> anthropicAIForComplaint() async {
|
||||
var dataComplaint = await getComplaintDataToAI();
|
||||
var messagesData = [
|
||||
{
|
||||
"role": "user",
|
||||
"content": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "$dataComplaint ${AppInformation.complaintPrompt} "
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
var requestBody = jsonEncode({
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 1024,
|
||||
"temperature": 0,
|
||||
"system": "Json output only without any additional ",
|
||||
"messages": messagesData,
|
||||
});
|
||||
final response = await http.post(
|
||||
Uri.parse('https://api.anthropic.com/v1/messages'),
|
||||
headers: {
|
||||
'x-api-key': AK.anthropicAIkeySeferNew,
|
||||
'anthropic-version': '2023-06-01',
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
body: requestBody,
|
||||
);
|
||||
if (response.statusCode == 200) {
|
||||
var responseData = jsonDecode(utf8.decode(response.bodyBytes));
|
||||
// Process the responseData as needed
|
||||
|
||||
responseForComplaint = jsonDecode(responseData['content'][0]['text']);
|
||||
}
|
||||
}
|
||||
|
||||
Future<dynamic> anthropicAI(
|
||||
String payload, String prompt, String idType) async {
|
||||
var messagesData = [
|
||||
{
|
||||
"role": "user",
|
||||
"content": [
|
||||
{"type": "text", "text": "$payload $prompt"}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
var requestBody = jsonEncode({
|
||||
"model": "claude-3-haiku-20240307",
|
||||
"max_tokens": 1024,
|
||||
"temperature": 0,
|
||||
"system": "Json output only without any additional ",
|
||||
"messages": messagesData,
|
||||
});
|
||||
|
||||
final response = await http.post(
|
||||
Uri.parse('https://api.anthropic.com/v1/messages'),
|
||||
headers: {
|
||||
'x-api-key': AK.anthropicAIkeySeferNew,
|
||||
'anthropic-version': '2023-06-01',
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
body: requestBody,
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
var responseData = jsonDecode(utf8.decode(response.bodyBytes));
|
||||
// Process the responseData as needed
|
||||
if (idType == 'car_back') {
|
||||
responseIdCardDriverEgyptBack =
|
||||
jsonDecode(responseData['content'][0]['text']);
|
||||
} else if (idType == 'car_front') {
|
||||
responseIdCardDriverEgyptFront =
|
||||
jsonDecode(responseData['content'][0]['text']);
|
||||
} else if (idType == 'id_front') {
|
||||
responseIdEgyptFront = jsonDecode(responseData['content'][0]['text']);
|
||||
} else if (idType == 'id_back') {
|
||||
responseIdEgyptBack = jsonDecode(responseData['content'][0]['text']);
|
||||
} else if (idType == 'driver_license') {
|
||||
responseIdEgyptDriverLicense =
|
||||
jsonDecode(responseData['content'][0]['text']);
|
||||
} else if (idType == 'criminalRecord') {
|
||||
responseCriminalRecordEgypt =
|
||||
jsonDecode(responseData['content'][0]['text']);
|
||||
}
|
||||
|
||||
update();
|
||||
return responseData.toString();
|
||||
}
|
||||
return responseIdCardDriverEgyptBack.toString();
|
||||
}
|
||||
|
||||
Future<void> geminiAiExtraction(String prompt, payload, String idType) async {
|
||||
var requestBody = jsonEncode({
|
||||
"contents": [
|
||||
{
|
||||
"parts": [
|
||||
{"text": "$payload $prompt"}
|
||||
]
|
||||
}
|
||||
],
|
||||
"generationConfig": {
|
||||
"temperature": 1,
|
||||
"topK": 64,
|
||||
"topP": 0.95,
|
||||
"maxOutputTokens": 8192,
|
||||
"stopSequences": []
|
||||
},
|
||||
"safetySettings": [
|
||||
{
|
||||
"category": "HARM_CATEGORY_HARASSMENT",
|
||||
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
|
||||
},
|
||||
{
|
||||
"category": "HARM_CATEGORY_HATE_SPEECH",
|
||||
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
|
||||
},
|
||||
{
|
||||
"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
|
||||
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
|
||||
},
|
||||
{
|
||||
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
|
||||
"threshold": "BLOCK_MEDIUM_AND_ABOVE"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
final response = await http.post(
|
||||
Uri.parse(
|
||||
// 'https://generativelanguage.googleapis.com/v1beta/models/gemini-pro-vision:generateContent?key=${AK.geminiApi}'),
|
||||
// 'https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:generateContent?key=${AK.geminiApi}'),
|
||||
'https://generativelanguage.googleapis.com/v1beta/models/gemini-1.0-pro:generateContent?key=${AK.geminiApi}'),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: requestBody,
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
var responseData = jsonDecode(response.body);
|
||||
// Process the responseData as needed
|
||||
|
||||
var result = responseData['candidates'][0]['content']['parts'][0]['text'];
|
||||
RegExp regex = RegExp(r"```json([^`]*)```");
|
||||
String? jsonString =
|
||||
regex.firstMatch(responseData.toString())?.group(1)?.trim();
|
||||
|
||||
if (jsonString != null) {
|
||||
// Convert the JSON object to a String
|
||||
jsonString = jsonEncode(json.decode(jsonString));
|
||||
|
||||
if (idType == 'car_back') {
|
||||
responseIdCardDriverEgyptBack = jsonDecode(jsonString);
|
||||
} else if (idType == 'car_front') {
|
||||
responseIdCardDriverEgyptFront = jsonDecode(jsonString);
|
||||
} else if (idType == 'id_front') {
|
||||
responseIdEgyptFront = jsonDecode(jsonString);
|
||||
} else if (idType == 'id_back') {
|
||||
responseIdEgyptBack = jsonDecode(jsonString);
|
||||
} else if (idType == 'driver_license') {
|
||||
responseIdEgyptDriverLicense = jsonDecode(jsonString);
|
||||
}
|
||||
|
||||
update();
|
||||
} else {
|
||||
Get.snackbar('Error', "JSON string not found",
|
||||
backgroundColor: AppColor.redColor);
|
||||
}
|
||||
|
||||
// Rest of your code...
|
||||
} else {}
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,11 @@ import '../functions/crud.dart';
|
||||
class StaticController extends GetxController {
|
||||
Map<String, dynamic> jsonData1 = {};
|
||||
Map<String, dynamic> jsonData2 = {};
|
||||
List staticList = [];
|
||||
var chartDataPassengers;
|
||||
var chartDataDrivers;
|
||||
var chartDataDriversCalling;
|
||||
var chartDataDriversMatchingNotes;
|
||||
bool isLoading = false;
|
||||
String totalMonthlyPassengers = '';
|
||||
String totalMonthlyDrivers = '';
|
||||
@@ -57,17 +60,32 @@ class StaticController extends GetxController {
|
||||
var jsonResponse = jsonDecode(res) as Map<String, dynamic>;
|
||||
isLoading = false;
|
||||
final List<dynamic> jsonData = jsonResponse['message'];
|
||||
totalMonthlyDrivers = jsonData[0]['totalMonthly'].toString();
|
||||
staticList = jsonData;
|
||||
totalMonthlyDrivers = jsonData[0]['totalDrivers'].toString();
|
||||
driversData = jsonData.map<MonthlyDriverInstall>((item) {
|
||||
return MonthlyDriverInstall.fromJson(item);
|
||||
}).toList();
|
||||
final List<FlSpot> spots = driversData
|
||||
.map((data) => FlSpot(
|
||||
data.day.toDouble(),
|
||||
data.totalDrivers.toDouble(),
|
||||
data.dailyTotalDrivers.toDouble(),
|
||||
))
|
||||
.toList();
|
||||
chartDataDrivers = spots;
|
||||
final List<FlSpot> spotsCalling = driversData
|
||||
.map((data) => FlSpot(
|
||||
data.day.toDouble(),
|
||||
data.dailyTotalCallingDrivers.toDouble(),
|
||||
))
|
||||
.toList();
|
||||
chartDataDriversCalling = spotsCalling;
|
||||
final List<FlSpot> spotsTotalMatchingNotes = driversData
|
||||
.map((data) => FlSpot(
|
||||
data.day.toDouble(),
|
||||
data.dailyMatchingNotes.toDouble(),
|
||||
))
|
||||
.toList();
|
||||
chartDataDriversMatchingNotes = spotsTotalMatchingNotes;
|
||||
|
||||
update(); // Notify the observers about the data and loading state change
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import '../../constant/links.dart';
|
||||
import '../../constant/style.dart';
|
||||
import '../../main.dart';
|
||||
import '../../views/widgets/elevated_btn.dart';
|
||||
import '../notification_controller.dart';
|
||||
import 'local_notification.dart';
|
||||
|
||||
class FirebaseMessagesController extends GetxController {
|
||||
@@ -20,10 +21,11 @@ class FirebaseMessagesController extends GetxController {
|
||||
List<String> tokens = [];
|
||||
List<String> tokensPassengers = [];
|
||||
List dataTokens = [];
|
||||
List dataTokensPassenger = [];
|
||||
late String driverID;
|
||||
late String driverToken;
|
||||
NotificationSettings? notificationSettings;
|
||||
|
||||
bool isLoading = false;
|
||||
Future<void> getNotificationSettings() async {
|
||||
// Get the current notification settings
|
||||
NotificationSettings? notificationSettings =
|
||||
@@ -78,27 +80,126 @@ class FirebaseMessagesController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
Future getAllTokenDrivers() async {
|
||||
var res = await http.post(
|
||||
Uri.parse(AppLink.getAllTokenDrivers),
|
||||
headers: {
|
||||
'Authorization':
|
||||
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
|
||||
},
|
||||
body: {},
|
||||
);
|
||||
var jsonResponse = jsonDecode(res.body);
|
||||
if (jsonResponse['status'] == 'success') {
|
||||
dataTokens = jsonResponse['data'];
|
||||
for (var i = 0; i < dataTokens.length; i++) {
|
||||
tokens.add(jsonResponse['data'][i]['token']);
|
||||
var currentPage = 1;
|
||||
var totalPages = 1;
|
||||
Future<void> getAllTokenDrivers({int page = 1}) async {
|
||||
isLoading = true;
|
||||
try {
|
||||
var res = await http.post(
|
||||
Uri.parse(AppLink.getAllTokenDrivers),
|
||||
headers: {
|
||||
'Authorization':
|
||||
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
|
||||
},
|
||||
body: {
|
||||
'page': page.toString(),
|
||||
},
|
||||
);
|
||||
|
||||
var jsonResponse = jsonDecode(res.body);
|
||||
if (jsonResponse['status'] == 'success') {
|
||||
var newData = jsonResponse['data'] as List;
|
||||
if (page == 1) {
|
||||
dataTokens.clear();
|
||||
tokens.clear();
|
||||
}
|
||||
dataTokens.addAll(newData);
|
||||
for (var item in newData) {
|
||||
tokens.add(item['token']);
|
||||
}
|
||||
currentPage = int.parse(jsonResponse['currentPage']);
|
||||
totalPages = jsonResponse['totalPages'];
|
||||
box.write(BoxName.tokensDrivers, tokens);
|
||||
} else {
|
||||
Get.defaultDialog(
|
||||
title: "Warning", middleText: "No more data available");
|
||||
}
|
||||
box.write(BoxName.tokensDrivers, tokens);
|
||||
} else {
|
||||
Get.defaultDialog(title: "Warning", middleText: "Server Error");
|
||||
} catch (e) {
|
||||
Get.defaultDialog(title: "Error", middleText: "Server Error: $e");
|
||||
} finally {
|
||||
isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
var currentPagePassenger = 1;
|
||||
var totalPagesPassenger = 1;
|
||||
Future<void> getAllTokenPassenger({int page = 1}) async {
|
||||
isLoading = true;
|
||||
try {
|
||||
var res = await http.post(
|
||||
Uri.parse(AppLink.getAllTokenDrivers),
|
||||
headers: {
|
||||
'Authorization':
|
||||
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
|
||||
},
|
||||
body: {
|
||||
'page': page.toString(),
|
||||
},
|
||||
);
|
||||
|
||||
var jsonResponse = jsonDecode(res.body);
|
||||
if (jsonResponse['status'] == 'success') {
|
||||
var newData = jsonResponse['data'] as List;
|
||||
if (page == 1) {
|
||||
dataTokensPassenger.clear();
|
||||
tokensPassengers.clear();
|
||||
}
|
||||
dataTokensPassenger.addAll(newData);
|
||||
for (var item in newData) {
|
||||
tokensPassengers.add(item['token']);
|
||||
}
|
||||
currentPagePassenger = int.parse(jsonResponse['currentPage']);
|
||||
totalPagesPassenger = jsonResponse['totalPages'];
|
||||
box.write(BoxName.tokensPassengers, tokensPassengers);
|
||||
} else {
|
||||
Get.defaultDialog(
|
||||
title: "Warning", middleText: "No more data available");
|
||||
}
|
||||
} catch (e) {
|
||||
Get.defaultDialog(title: "Error", middleText: "Server Error: $e");
|
||||
} finally {
|
||||
isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
bool isSendingNotifications = false;
|
||||
Future<void> loadAllPagesAndSendNotifications() async {
|
||||
isSendingNotifications = true;
|
||||
currentPage = 1;
|
||||
|
||||
while (currentPage <= totalPages) {
|
||||
await getAllTokenDrivers(page: currentPage);
|
||||
await NotificationController().sendNotificationDrivers();
|
||||
print(tokens);
|
||||
if (currentPage < totalPages) {
|
||||
await Future.delayed(const Duration(seconds: 3));
|
||||
}
|
||||
currentPage++;
|
||||
}
|
||||
|
||||
isSendingNotifications = false;
|
||||
Get.snackbar("Success", "All notifications sent!");
|
||||
}
|
||||
|
||||
bool isSendingNotificationsPassenger = false;
|
||||
Future<void> loadAllPagesAndSendNotificationsPassengers() async {
|
||||
isSendingNotificationsPassenger = true;
|
||||
currentPage = 1;
|
||||
|
||||
while (currentPagePassenger <= totalPagesPassenger) {
|
||||
await getAllTokenPassenger(page: currentPagePassenger);
|
||||
await NotificationController().sendNotificationDrivers();
|
||||
print(tokensPassengers);
|
||||
if (currentPagePassenger < totalPagesPassenger) {
|
||||
await Future.delayed(const Duration(seconds: 3));
|
||||
}
|
||||
currentPagePassenger++;
|
||||
}
|
||||
|
||||
isSendingNotificationsPassenger = false;
|
||||
Get.snackbar("Success", "All notifications sent!");
|
||||
}
|
||||
|
||||
Future getAllTokenPassengers() async {
|
||||
var res = await http.post(
|
||||
Uri.parse(AppLink.getAllTokenPassengers),
|
||||
|
||||
@@ -8,9 +8,7 @@ import '../../constant/box_name.dart';
|
||||
import '../../constant/links.dart';
|
||||
import '../../env/env.dart';
|
||||
import '../../main.dart';
|
||||
import 'gemeni.dart';
|
||||
import 'llama_ai.dart';
|
||||
import 'upload_image.dart';
|
||||
import '../../print.dart';
|
||||
|
||||
class CRUD {
|
||||
Future<dynamic> get({
|
||||
@@ -93,11 +91,11 @@ class CRUD {
|
||||
return response.statusCode;
|
||||
}
|
||||
|
||||
Future allMethodForAI(String prompt, linkPHP, imagePath) async {
|
||||
Future allMethodForAI(String prompt, driverID, imagePath) async {
|
||||
// await ImageController().choosImage(linkPHP, imagePath);
|
||||
Future.delayed(const Duration(seconds: 2));
|
||||
var extractedString =
|
||||
await arabicTextExtractByVisionAndAI(imagePath: imagePath);
|
||||
var extractedString = await arabicTextExtractByVisionAndAI(
|
||||
imagePath: imagePath, driverID: driverID);
|
||||
var json = jsonDecode(extractedString);
|
||||
var textValues = getAllTextValuesWithLineNumbers(json);
|
||||
// List<String> textValues = getAllTextValues(json);
|
||||
@@ -166,23 +164,24 @@ class CRUD {
|
||||
|
||||
Future<dynamic> arabicTextExtractByVisionAndAI({
|
||||
required String imagePath,
|
||||
required String driverID,
|
||||
}) async {
|
||||
var headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'Ocp-Apim-Subscription-Key': '21010e54b50f41a4904708c526e102df'
|
||||
'Ocp-Apim-Subscription-Key': AK.ocpApimSubscriptionKey
|
||||
};
|
||||
// var url = Uri.parse(
|
||||
// 'https://ocrhamza.cognitiveservices.azure.com/vision/v2.1/ocr?language=ar',
|
||||
// );
|
||||
String imagePathFull =
|
||||
'${AppLink.server}card_image/$imagePath-${box.read(BoxName.driverID)}.jpg';
|
||||
|
||||
String imagePathFull =
|
||||
'${AppLink.server}/card_image/$imagePath-$driverID.jpg';
|
||||
Log.print('imagePathFull: $imagePathFull');
|
||||
var request = http.Request(
|
||||
'POST',
|
||||
Uri.parse(
|
||||
'https://ocrhamza.cognitiveservices.azure.com/vision/v2.1/ocr?language=ar'));
|
||||
'https://eastus.api.cognitive.microsoft.com/computervision/imageanalysis:analyze?features=caption,read&model-version=latest&language=en&api-version=2024-02-01'));
|
||||
request.body = json.encode({"url": imagePathFull});
|
||||
Log.print('request.body: ${request.body}');
|
||||
request.headers.addAll(headers);
|
||||
Log.print('request.headers: ${request.headers}');
|
||||
|
||||
http.StreamedResponse response = await request.send();
|
||||
|
||||
|
||||
@@ -16,11 +16,12 @@ class NotificationController extends GetxController {
|
||||
List<String> tokensPassengers = [];
|
||||
|
||||
getTokensDrivers() async {
|
||||
await FirebaseMessagesController().getAllTokenDrivers();
|
||||
await FirebaseMessagesController().loadAllPagesAndSendNotifications();
|
||||
}
|
||||
|
||||
getTokensPassengers() async {
|
||||
await FirebaseMessagesController().getAllTokenPassengers();
|
||||
await FirebaseMessagesController()
|
||||
.loadAllPagesAndSendNotificationsPassengers();
|
||||
}
|
||||
|
||||
Future<dynamic> sendNotificationDrivers() {
|
||||
@@ -56,8 +57,9 @@ class NotificationController extends GetxController {
|
||||
tokensDriver = box.read(BoxName.tokensDrivers);
|
||||
if (formKey.currentState!.validate()) {
|
||||
for (var i = 0; i < tokensDriver.length; i++) {
|
||||
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||
title.text, body.text, tokensDriver[i]);
|
||||
print(tokensDriver.length);
|
||||
// FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||
// title.text, body.text, tokensDriver[i]);
|
||||
}
|
||||
}
|
||||
}),
|
||||
|
||||
@@ -14,12 +14,36 @@ class MonthlyPassengerInstall {
|
||||
class MonthlyDriverInstall {
|
||||
int day;
|
||||
int totalDrivers;
|
||||
int dailyTotalDrivers;
|
||||
int dailyTotalCallingDrivers;
|
||||
int dailyMatchingNotes;
|
||||
int totalMonthlyDrivers;
|
||||
int totalMonthlyCallingDrivers;
|
||||
int totalMonthlyMatchingNotes;
|
||||
|
||||
MonthlyDriverInstall({required this.day, required this.totalDrivers});
|
||||
MonthlyDriverInstall({
|
||||
required this.day,
|
||||
required this.totalDrivers,
|
||||
required this.dailyTotalDrivers,
|
||||
required this.dailyTotalCallingDrivers,
|
||||
required this.dailyMatchingNotes,
|
||||
required this.totalMonthlyDrivers,
|
||||
required this.totalMonthlyCallingDrivers,
|
||||
required this.totalMonthlyMatchingNotes,
|
||||
});
|
||||
|
||||
factory MonthlyDriverInstall.fromJson(Map<String, dynamic> json) =>
|
||||
MonthlyDriverInstall(
|
||||
day: int.parse(json['day'].toString().split('-')[2]),
|
||||
totalDrivers:
|
||||
int.parse(json['totalDrivers'].toString().split(':')[0]));
|
||||
day: int.parse(json['day'].toString().split('-')[2]),
|
||||
totalDrivers: int.parse(json['totalDrivers'].toString()),
|
||||
dailyTotalDrivers: int.parse(json['dailyTotalDrivers'].toString()),
|
||||
dailyTotalCallingDrivers:
|
||||
int.parse(json['dailyTotalCallingDrivers'].toString()),
|
||||
dailyMatchingNotes: int.parse(json['dailyMatchingNotes'].toString()),
|
||||
totalMonthlyDrivers: int.parse(json['totalMonthlyDrivers'].toString()),
|
||||
totalMonthlyCallingDrivers:
|
||||
int.parse(json['totalMonthlyCallingDrivers'].toString()),
|
||||
totalMonthlyMatchingNotes:
|
||||
int.parse(json['totalMonthlyMatchingNotes'].toString()),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,8 +3,11 @@ import 'package:get/get.dart';
|
||||
import 'package:get/get_rx/src/rx_typedefs/rx_typedefs.dart';
|
||||
import 'package:sefer_admin1/constant/colors.dart';
|
||||
import 'package:sefer_admin1/controller/admin/dashboard_controller.dart';
|
||||
import 'package:sefer_admin1/controller/admin/register_captain_controller.dart';
|
||||
import 'package:sefer_admin1/controller/admin/static_controller.dart';
|
||||
import 'package:sefer_admin1/controller/notification_controller.dart';
|
||||
import 'package:sefer_admin1/views/admin/captain/drivers_cant_registe.dart';
|
||||
import 'package:sefer_admin1/views/admin/captain/register_captain.dart';
|
||||
import 'package:sefer_admin1/views/widgets/mycircular.dart';
|
||||
|
||||
import '../../constant/links.dart';
|
||||
@@ -341,19 +344,22 @@ class AdminHomePage extends StatelessWidget {
|
||||
onPressed: () async {
|
||||
await Get.put(NotificationController())
|
||||
.getTokensDrivers();
|
||||
NotificationController()
|
||||
.sendNotificationDrivers();
|
||||
}),
|
||||
AdminWidgetsDashBoard(
|
||||
title: 'send notification Passengers',
|
||||
onPressed: () async {
|
||||
await Get.put(NotificationController())
|
||||
.getTokensPassengers();
|
||||
NotificationController()
|
||||
.sendNotificationPassengers();
|
||||
}),
|
||||
// AdminWidgetsDashBoard(
|
||||
// title: 'JordanID', onPressed: () => AI().jordanID()),
|
||||
AdminWidgetsDashBoard(
|
||||
title: 'register captain'.tr,
|
||||
onPressed: () async {
|
||||
await Get.put(RegisterCaptainController())
|
||||
.getDriverNotCompleteRegistration();
|
||||
Get.to(() => DriversCantRegister());
|
||||
},
|
||||
),
|
||||
|
||||
// AdminWidgetsDashBoard(
|
||||
// title: 'Llama',
|
||||
// onPressed: () =>
|
||||
|
||||
54
lib/views/admin/captain/drivers_cant_registe.dart
Normal file
54
lib/views/admin/captain/drivers_cant_registe.dart
Normal file
@@ -0,0 +1,54 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:sefer_admin1/views/admin/captain/register_captain.dart';
|
||||
import 'package:sefer_admin1/views/widgets/my_scafold.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../controller/admin/register_captain_controller.dart';
|
||||
|
||||
class DriversCantRegister extends StatelessWidget {
|
||||
const DriversCantRegister({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(RegisterCaptainController());
|
||||
return MyScafolld(
|
||||
title: 'drivers cant register'.tr,
|
||||
body: [
|
||||
GetBuilder<RegisterCaptainController>(builder: (mainController) {
|
||||
return ListView.builder(
|
||||
itemCount: mainController.driverNotCompleteRegistration.length,
|
||||
itemBuilder: (context, index) {
|
||||
final driver =
|
||||
mainController.driverNotCompleteRegistration[index];
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Get.to(() => RegisterCaptain(), arguments: {
|
||||
"phone_number": driver['phone_number'].toString(),
|
||||
'driverId': driver['driverId'].toString(),
|
||||
'email': driver['email'].toString(),
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
color: driver['note'] == null
|
||||
? AppColor.greenColor
|
||||
: AppColor.accentColor,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(driver['phone_number'].toString()),
|
||||
Text(driver['driverId'].toString()),
|
||||
Text(driver['email'].toString()),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}),
|
||||
],
|
||||
isleading: true);
|
||||
}
|
||||
}
|
||||
982
lib/views/admin/captain/register_captain.dart
Normal file
982
lib/views/admin/captain/register_captain.dart
Normal file
@@ -0,0 +1,982 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:sefer_admin1/controller/admin/register_captain_controller.dart';
|
||||
import '../../../../constant/colors.dart';
|
||||
import '../../../../constant/links.dart';
|
||||
import '../../../../constant/style.dart';
|
||||
import '../../widgets/elevated_btn.dart';
|
||||
import '../../widgets/my_scafold.dart';
|
||||
import '../../widgets/mycircular.dart';
|
||||
|
||||
class RegisterCaptain extends StatelessWidget {
|
||||
RegisterCaptain({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final controller = Get.put(RegisterCaptainController());
|
||||
// String text = '';
|
||||
controller.driveInit();
|
||||
return MyScafolld(
|
||||
title: 'Documents check'.tr,
|
||||
action: GetBuilder<RegisterCaptainController>(builder: (controller) {
|
||||
return IconButton(
|
||||
onPressed: () {
|
||||
controller.isLoading = false;
|
||||
controller.update();
|
||||
},
|
||||
icon: const Icon(Icons.refresh),
|
||||
);
|
||||
}),
|
||||
body: [
|
||||
GetBuilder<RegisterCaptainController>(builder: (controller) {
|
||||
return controller.isLoading
|
||||
? const MyCircularProgressIndicator()
|
||||
: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
(controller.responseIdCardDriverEgyptBack.isNotEmpty &&
|
||||
controller.responseIdCardDriverEgyptFront
|
||||
.isNotEmpty &&
|
||||
controller.responseIdEgyptFront.isNotEmpty &&
|
||||
controller.responseIdEgyptBack.isNotEmpty &&
|
||||
controller
|
||||
.responseIdEgyptDriverLicense.isNotEmpty
|
||||
// &&
|
||||
// controller
|
||||
// .responseCriminalRecordEgypt.isNotEmpty
|
||||
)
|
||||
? MyElevatedButton(
|
||||
title: 'Next'.tr,
|
||||
onPressed: () {
|
||||
controller.addDriverAndCarEgypt();
|
||||
})
|
||||
: const SizedBox(),
|
||||
SizedBox(
|
||||
height:
|
||||
(controller.responseIdCardDriverEgyptBack
|
||||
.isNotEmpty &&
|
||||
controller.responseIdCardDriverEgyptFront
|
||||
.isNotEmpty &&
|
||||
controller
|
||||
.responseIdEgyptFront.isNotEmpty &&
|
||||
controller
|
||||
.responseIdEgyptBack.isNotEmpty &&
|
||||
controller.responseIdEgyptDriverLicense
|
||||
.isNotEmpty
|
||||
// &&
|
||||
// controller.responseCriminalRecordEgypt
|
||||
// .isNotEmpty
|
||||
)
|
||||
? Get.height * .7
|
||||
: Get.height * .85,
|
||||
child: ListView(
|
||||
children: [
|
||||
egyptDriverLicense(),
|
||||
egyptCarLicenceFront(),
|
||||
egyptCarLicenceBack(),
|
||||
egyptDriverIDFront(),
|
||||
egyptDriverIDBack(),
|
||||
// egyptCriminalRecord(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
isleading: true);
|
||||
}
|
||||
|
||||
GetBuilder<RegisterCaptainController> egyptDriverLicense() {
|
||||
return GetBuilder<RegisterCaptainController>(
|
||||
builder: (ai) {
|
||||
if (ai.responseIdEgyptDriverLicense.isNotEmpty) {
|
||||
final expiryDate = ai.responseIdEgyptDriverLicense['expiry_date'];
|
||||
|
||||
// Check if the expiry date is before today
|
||||
final today = DateTime.now();
|
||||
|
||||
// Try parsing the expiry date. If it fails, set it to null.
|
||||
final expiryDateTime = DateTime.tryParse(expiryDate);
|
||||
final isExpired =
|
||||
expiryDateTime != null && expiryDateTime.isBefore(today);
|
||||
|
||||
return Card(
|
||||
elevation: 4.0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Driver\'s License'.tr, style: AppStyle.headTitle2),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await ai.allMethodForAI("""
|
||||
Write a JSON object from the following information extracted from the provided Arabic text:
|
||||
|
||||
{
|
||||
"license_type": "",
|
||||
"national_number": "",
|
||||
"name_arabic": "",
|
||||
"name_english": "",
|
||||
"firstName": "",
|
||||
"lastName": "",
|
||||
"address": "",
|
||||
"issue_date": "", // Format: YYYY-MM-DD using Latin numerals (0-9)
|
||||
"expiry_date": "", // Format: YYYY-MM-DD using Latin numerals (0-9)
|
||||
"employmentType": "",
|
||||
"license_categories": []
|
||||
}
|
||||
|
||||
Important notes:
|
||||
1. Ensure all dates are in the format YYYY-MM-DD using Latin (Western) numerals (0-9), not Arabic numerals.
|
||||
2. The 'license_categories' should be an array, even if there's only one category.
|
||||
3. Fill in all fields based on the information provided in the Arabic text.
|
||||
4. If any information is missing, leave the field as an empty string or empty array as appropriate.
|
||||
""", 'driver_license', ai.driverId); //egypt
|
||||
},
|
||||
icon: const Icon(Icons.refresh),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
const Divider(color: AppColor.accentColor),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'License Type'.tr}: ${ai.responseIdEgyptDriverLicense['license_type']}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'National Number'.tr}: ${ai.responseIdEgyptDriverLicense['national_number']}',
|
||||
style: AppStyle.title.copyWith(
|
||||
color: ai.responseIdEgyptDriverLicense[
|
||||
'national_number'] ==
|
||||
ai.responseIdEgyptBack['nationalID']
|
||||
? AppColor.greenColor
|
||||
: AppColor.redColor),
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Name (Arabic)'.tr}: ${ai.responseIdEgyptDriverLicense['name_arabic']}',
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Name (English)'.tr}: ${ai.responseIdEgyptDriverLicense['name_english']}',
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Address'.tr}: ${ai.responseIdEgyptDriverLicense['address']}',
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Issue Date'.tr}: ${ai.responseIdEgyptDriverLicense['issue_date']}',
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Expiry Date'.tr}: ${ai.responseIdEgyptDriverLicense['expiry_date']}',
|
||||
style: AppStyle.title.copyWith(
|
||||
color:
|
||||
!isExpired ? AppColor.greenColor : AppColor.redColor,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'License Categories'.tr}: ${ai.responseIdEgyptDriverLicense['license_categories']}',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Card(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
await ai.allMethodForAI("""
|
||||
Write a JSON object from the following information extracted from the provided Arabic text:
|
||||
|
||||
{
|
||||
"license_type": "",
|
||||
"national_number": "",
|
||||
"name_arabic": "",
|
||||
"name_english": "",
|
||||
"firstName": "",
|
||||
"lastName": "",
|
||||
"address": "",
|
||||
"issue_date": "", // Format: YYYY-MM-DD using Latin numerals (0-9)
|
||||
"expiry_date": "", // Format: YYYY-MM-DD using Latin numerals (0-9)
|
||||
"employmentType": "",
|
||||
"license_categories": []
|
||||
}
|
||||
|
||||
Important notes:
|
||||
1. Ensure all dates are in the format YYYY-MM-DD using Latin (Western) numerals (0-9), not Arabic numerals.
|
||||
2. The 'license_categories' should be an array, even if there's only one category.
|
||||
3. Fill in all fields based on the information provided in the Arabic text.
|
||||
4. If any information is missing, leave the field as an empty string or empty array as appropriate.
|
||||
""", 'driver_license', ai.driverId); //egypt
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Image.network(
|
||||
'${AppLink.server}/card_image/driver_license-${ai.driverId}.jpg',
|
||||
height: Get.height * .25,
|
||||
width: double.maxFinite,
|
||||
fit: BoxFit.fitHeight,
|
||||
),
|
||||
Text(
|
||||
'Capture an Image of Your Driver License'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
GetBuilder<RegisterCaptainController> egyptDriverIDBack() {
|
||||
return GetBuilder<RegisterCaptainController>(
|
||||
builder: (ai) {
|
||||
if (ai.responseIdEgyptBack.isNotEmpty) {
|
||||
final taxExpiryDate = ai.responseIdEgyptBack['expirationDate'];
|
||||
|
||||
// Check if the tax expiry date is before today
|
||||
final today = DateTime.now();
|
||||
|
||||
// Try parsing the tax expiry date. If it fails, set it to null.
|
||||
final taxExpiryDateTime = DateTime.tryParse(taxExpiryDate);
|
||||
final isExpired =
|
||||
taxExpiryDateTime != null && taxExpiryDateTime.isBefore(today);
|
||||
|
||||
return Card(
|
||||
elevation: 4.0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('ID Documents Back'.tr, style: AppStyle.headTitle2),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await ai.allMethodForAI("""
|
||||
Write a JSON from the following information extracted from the provided Arabic text:
|
||||
- nationalID(in Latin numerals)
|
||||
- issueDate (in format YYYY-MM-DD using Latin numerals)
|
||||
- occupation
|
||||
- gender
|
||||
- religion
|
||||
- maritalStatus
|
||||
- fullNameMarital (if maritalStatus is "أعزب", set this to "none")
|
||||
- expirationDate (in format YYYY-MM-DD using Latin numerals)
|
||||
|
||||
Please ensure all date fields use Latin (Western) numerals (0-9) instead of Arabic numerals. For example, use "2023-04-03" instead of "٢٠٢٣-٠٤-٠٣".
|
||||
""", 'id_back', ai.driverId); //egypt
|
||||
},
|
||||
icon: const Icon(Icons.refresh),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
const Divider(color: AppColor.accentColor),
|
||||
const SizedBox(height: 8.0),
|
||||
// Assuming these keys exist in ai.responseIdEgyptFront
|
||||
Text(
|
||||
'${'National ID'.tr}: ${ai.responseIdEgyptBack['nationalID']}',
|
||||
style: AppStyle.title.copyWith(
|
||||
color: ai.responseIdEgyptDriverLicense[
|
||||
'national_number'] ==
|
||||
ai.responseIdEgyptBack['nationalID']
|
||||
? AppColor.greenColor
|
||||
: AppColor.redColor),
|
||||
),
|
||||
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Occupation'.tr}: ${ai.responseIdEgyptBack['occupation']}', // Assuming 'occupation' exists
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'Issue Date'.tr}: ${ai.responseIdEgyptBack['issueDate']}', // Assuming 'issueDate' exists
|
||||
),
|
||||
Text(
|
||||
'${'Gender'.tr}: ${ai.responseIdEgyptBack['gender']}', // Assuming 'gender' exists
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Text(
|
||||
// '${'Religion'.tr}: ${ai.responseIdEgyptBack['religion']}', // Assuming 'religion' exists
|
||||
// ),
|
||||
// Text(
|
||||
// '${'Marital Status'.tr}: ${ai.responseIdEgyptBack['maritalStatus']}', // Assuming 'maritalStatus' exists
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// const SizedBox(height: 8.0),
|
||||
// Text(
|
||||
// '${'Full Name (Marital)'.tr}: ${ai.responseIdEgyptBack['fullNameMaritial']}', // Assuming 'fullNameMaritial' exists
|
||||
// ),
|
||||
// const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Expiration Date'.tr}: ${ai.responseIdEgyptBack['expirationDate']}', // Assuming 'expirationDate' exists
|
||||
style: AppStyle.title.copyWith(
|
||||
color: !isExpired
|
||||
? AppColor.greenColor
|
||||
: AppColor.redColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Card(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
await ai.allMethodForAI('''
|
||||
Write a JSON object from the following information extracted from the provided Arabic text:
|
||||
|
||||
{
|
||||
"nationalID": "",//(in Latin numerals)
|
||||
"issueDate": "", // Format: YYYY-MM-DD using Latin numerals (0-9)
|
||||
"occupation": "",
|
||||
"gender": "",
|
||||
"religion": "",
|
||||
"maritalStatus": "",
|
||||
"fullNameMaritial": "", // Set to "none" if maritalStatus is "أعزب"
|
||||
"expirationDate": "" // Format: YYYY-MM-DD using Latin numerals (0-9)
|
||||
}
|
||||
|
||||
Important notes:
|
||||
1. Ensure all dates (issueDate and expirationDate) are in the format YYYY-MM-DD using Latin (Western) numerals (0-9), not Arabic numerals.
|
||||
2. If maritalStatus is "أعزب" (single), set fullNameMaritial to "none".
|
||||
3. Fill in all fields based on the information provided in the Arabic text.
|
||||
4. If any information is missing, leave the field as an empty string.
|
||||
''', 'id_back', ai.driverId); //egypt
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Image.network(
|
||||
'${AppLink.server}/card_image/id_back-${ai.driverId}.jpg',
|
||||
height: Get.height * .25,
|
||||
width: double.maxFinite,
|
||||
fit: BoxFit.fitHeight,
|
||||
),
|
||||
Text(
|
||||
'Capture an Image of Your ID Document Back'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
GetBuilder<RegisterCaptainController> egyptDriverIDFront() {
|
||||
return GetBuilder<RegisterCaptainController>(
|
||||
builder: (ai) {
|
||||
if (ai.responseIdEgyptFront.isNotEmpty) {
|
||||
return Card(
|
||||
elevation: 4.0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('ID Documents Front'.tr, style: AppStyle.headTitle2),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await ai.allMethodForAI('''
|
||||
Write a JSON object from the following information extracted from the provided Arabic text:
|
||||
|
||||
{
|
||||
"first_name": "", // The word next to "بطاقة تحقيق الشخصية" (National Identification Card)
|
||||
"full_name": "", // The full name on the next line after the first name
|
||||
"address": "", // The complete address spanning the next two lines
|
||||
"national_number": "", // The National ID number before the last line (convert Arabic numerals to Latin)
|
||||
"card_id": "", // The card ID in English on the last line
|
||||
"dob": "" // Year of birth only, in Latin numerals (YYYY format)
|
||||
}
|
||||
|
||||
Important notes:
|
||||
1. For 'first_name', extract the word immediately following "بطاقة تحقيق الشخصية".
|
||||
2. 'full_name' should be the complete name found on the line after the first name.
|
||||
3. 'address' should combine information from two consecutive lines.
|
||||
4. Convert the 'national_number' from Arabic numerals to Latin numerals (0-9).
|
||||
5. 'card_id' should be extracted as-is from the last line (it's already in English).
|
||||
6. For 'dob', include only the year of birth in YYYY format using Latin numerals.
|
||||
7. If any information is missing, leave the field as an empty string.
|
||||
''', 'id_front', ai.driverId); //egypt
|
||||
},
|
||||
icon: const Icon(Icons.refresh),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
const Divider(color: AppColor.accentColor),
|
||||
const SizedBox(height: 8.0),
|
||||
// Removed Make, Model, etc. as they are not available
|
||||
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'First Name'.tr}: ${ai.responseIdEgyptFront['first_name']}',
|
||||
),
|
||||
Text(
|
||||
'${'CardID'.tr}: ${ai.responseIdEgyptFront['card_id']}',
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'Full Name'.tr}: ${ai.responseIdEgyptFront['full_name']}',
|
||||
),
|
||||
Text(
|
||||
'${'DOB'.tr}: ${ai.responseIdEgyptFront['dob']}',
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Address'.tr}: ${ai.responseIdEgyptFront['address']}',
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
// Text(
|
||||
// '${'National Number'.tr}: ${ai.responseIdEgyptFront['national_number']}',
|
||||
// ),
|
||||
// const SizedBox(height: 8.0),
|
||||
|
||||
// Removed Inspection Date as it's not available
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Card(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
await ai.allMethodForAI(""""
|
||||
Write a JSON object from the following information extracted from the provided Arabic text:
|
||||
|
||||
{
|
||||
"first_name": "", // The word next to "بطاقة تحقيق الشخصية" (National Identification Card)
|
||||
"full_name": "", // The full name on the next line after the first name
|
||||
"address": "", // The complete address spanning the next two lines
|
||||
"national_number": "", // The National ID number before the last line (convert Arabic numerals to Latin)
|
||||
"card_id": "", // The card ID in English on the last line
|
||||
"dob": "" // Year of birth only, in Latin numerals (YYYY format)
|
||||
}
|
||||
|
||||
Important notes:
|
||||
1. For 'first_name', extract the word immediately following "بطاقة تحقيق الشخصية".
|
||||
2. 'full_name' should be the complete name found on the line after the first name.
|
||||
3. 'address' should combine information from two consecutive lines.
|
||||
4. Convert the 'national_number' from Arabic numerals to Latin numerals (0-9).
|
||||
5. 'card_id' should be extracted as-is from the last line (it's already in English).
|
||||
6. For 'dob', include only the year of birth in YYYY format using Latin numerals.
|
||||
7. If any information is missing, leave the field as an empty string.
|
||||
""", 'id_front', ai.driverId); //egypt
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Image.network(
|
||||
'${AppLink.server}/card_image/id_front-${ai.driverId}.png',
|
||||
height: Get.height * .25,
|
||||
width: double.maxFinite,
|
||||
fit: BoxFit.fitHeight,
|
||||
),
|
||||
Text(
|
||||
'Capture an Image of Your ID Document front'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
GetBuilder<RegisterCaptainController> egyptCarLicenceFront() {
|
||||
return GetBuilder<RegisterCaptainController>(
|
||||
builder: (ai) {
|
||||
if (ai.responseIdCardDriverEgyptFront.isNotEmpty) {
|
||||
// No need to access ai.responseIdCardDriverEgyptBack anymore
|
||||
final licenseExpiryDate = DateTime.parse(
|
||||
ai.responseIdCardDriverEgyptFront['LicenseExpirationDate']);
|
||||
|
||||
// Check if license has expired
|
||||
final today = DateTime.now();
|
||||
final isLicenseExpired = licenseExpiryDate.isBefore(today);
|
||||
|
||||
return Card(
|
||||
elevation: 4.0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text('Vehicle Details Front'.tr,
|
||||
style: AppStyle.headTitle2),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
ai.allMethodForAI("""
|
||||
Extract the following details from the provided car license data and format them into a JSON object:
|
||||
|
||||
|
||||
License Expiration Date
|
||||
Car Plate
|
||||
Owner
|
||||
Address
|
||||
|
||||
Car License Data:
|
||||
|
||||
|
||||
JSON Format:
|
||||
{
|
||||
"LicenseExpirationDate": "YYYY-MM-DD",
|
||||
"car_plate": "[Car plate number]",//the car plate is line next to line contain 'ادارة مرور' for bot numbers and letters in arabic with partition like| but you remove |
|
||||
"owner": "[Owner's full name]",
|
||||
"address": "[Address if available, otherwise 'Not provided']"
|
||||
}
|
||||
|
||||
Important notes:
|
||||
1. For the LicenseExpirationDate, ensure the date is in YYYY-MM-DD format using Latin numerals (0-9).
|
||||
2. Replace all occurrences of '|' (pipe character) with a space in all fields.
|
||||
3. If any information is missing, leave the corresponding field as an empty string.
|
||||
4. Ensure all text is properly formatted and spaces are used correctly.
|
||||
|
||||
Please fill in the JSON object with the extracted information, following these guidelines.
|
||||
""", 'car_front', ai.driverId);
|
||||
},
|
||||
icon: const Icon(Icons.refresh),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
const Divider(color: AppColor.accentColor),
|
||||
const SizedBox(height: 8.0),
|
||||
// Removed Make, Model, etc. as they are not available
|
||||
|
||||
Text(
|
||||
'${'Plate Number'.tr}: ${ai.responseIdCardDriverEgyptFront['car_plate']}',
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Owner Name'.tr}: ${ai.responseIdCardDriverEgyptFront['owner']}',
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Address'.tr}: ${ai.responseIdCardDriverEgyptFront['address']}',
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'License Expiry Date'.tr}: ${licenseExpiryDate.toString().substring(0, 10)}',
|
||||
style: TextStyle(
|
||||
color: isLicenseExpired ? Colors.red : Colors.green,
|
||||
),
|
||||
),
|
||||
// Removed Fuel as it's not available
|
||||
],
|
||||
),
|
||||
// Removed Inspection Date as it's not available
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Card(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
ai.allMethodForAI("""
|
||||
Extract the following details from the provided car license data and format them into a JSON object:
|
||||
|
||||
|
||||
License Expiration Date
|
||||
Car Plate
|
||||
Owner
|
||||
Address
|
||||
|
||||
Car License Data:
|
||||
|
||||
|
||||
JSON Format:
|
||||
{
|
||||
"LicenseExpirationDate": "YYYY-MM-DD",
|
||||
"car_plate": "[Car plate number]",//the car plate is line next to line contain 'ادارة مرور' for bot numbers and letters in arabic with partition like| but you remove |
|
||||
"owner": "[Owner's full name]",
|
||||
"address": "[Address if available, otherwise 'Not provided']"
|
||||
}
|
||||
|
||||
Important notes:
|
||||
1. For the LicenseExpirationDate, ensure the date is in YYYY-MM-DD format using Latin numerals (0-9).
|
||||
2. Replace all occurrences of '|' (pipe character) with a space in all fields.
|
||||
3. If any information is missing, leave the corresponding field as an empty string.
|
||||
4. Ensure all text is properly formatted and spaces are used correctly.
|
||||
|
||||
Please fill in the JSON object with the extracted information, following these guidelines.
|
||||
""", 'car_front', ai.driverId);
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Image.network(
|
||||
'${AppLink.server}/card_image/car_front-${ai.driverId}.jpg',
|
||||
height: Get.height * .25,
|
||||
width: double.maxFinite,
|
||||
fit: BoxFit.fitHeight,
|
||||
),
|
||||
Text(
|
||||
'Capture an Image of Your car license front '.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
GetBuilder<RegisterCaptainController> egyptCarLicenceBack() {
|
||||
return GetBuilder<RegisterCaptainController>(
|
||||
builder: (ai) {
|
||||
if (ai.responseIdCardDriverEgyptBack.isNotEmpty) {
|
||||
// Get the tax expiry date from the response
|
||||
final taxExpiryDate = ai.responseIdCardDriverEgyptBack['tax_expiry'];
|
||||
// final displacement = ai.responseIdCardDriverEgyptBack['displacement'];
|
||||
// if (int.parse(displacement) < 1000) {}
|
||||
// Get the inspection date from the response
|
||||
final inspectionDate =
|
||||
ai.responseIdCardDriverEgyptBack['inspection_date'];
|
||||
final year = int.parse(inspectionDate.split('-')[0]);
|
||||
|
||||
// Set inspectionDateTime to December 31st of the given year
|
||||
final inspectionDateTime = DateTime(year, 12, 31);
|
||||
String carBackLicenseExpired =
|
||||
inspectionDateTime.toString().split(' ')[0];
|
||||
// Get the current date
|
||||
final today = DateTime.now();
|
||||
|
||||
// Try parsing the tax expiry date. If it fails, set it to null.
|
||||
final taxExpiryDateTime = DateTime.tryParse(taxExpiryDate ?? '');
|
||||
final isExpired =
|
||||
taxExpiryDateTime != null && taxExpiryDateTime.isBefore(today);
|
||||
// Check if the inspection date is before today
|
||||
bool isInspectionExpired = inspectionDateTime.isBefore(today);
|
||||
|
||||
return Card(
|
||||
elevation: 4.0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Vehicle Details Back'.tr,
|
||||
style: AppStyle.headTitle2),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
ai.allMethodForAI("""
|
||||
Analyze the extracted car license information and create a JSON object with the following keys:
|
||||
|
||||
{
|
||||
"make": "",
|
||||
"year": "",
|
||||
"chassis": "",
|
||||
"model": "",
|
||||
"engine": "",
|
||||
"displacement": "",
|
||||
"cylinders": "",
|
||||
"fuel": "",
|
||||
"color": "",
|
||||
"color_hex": "",
|
||||
"inspection_date": "",
|
||||
"assuranceNumber": "",
|
||||
"tax_expiry": ""
|
||||
}
|
||||
|
||||
Important notes:
|
||||
1. For dates (inspection_date and tax_expiry), use the format YYYY-MM-DD with Latin numerals (0-9).
|
||||
2. Convert the color name to its corresponding hex color code for the 'color_hex' field.
|
||||
3. Ensure all numeric values (year, displacement, cylinders) are in Latin numerals.
|
||||
4. If any information is missing, leave the corresponding field as an empty string.
|
||||
5. Do not include any explanatory text in the JSON fields, only the extracted values.
|
||||
displacement in the line contain (سم٣ )
|
||||
Please fill in the JSON object with the extracted information, following these guidelines.
|
||||
""", 'car_back', ai.driverId);
|
||||
},
|
||||
icon: const Icon(Icons.refresh),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
const Divider(color: AppColor.accentColor),
|
||||
const SizedBox(height: 8.0),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'Make'.tr}: ${ai.responseIdCardDriverEgyptBack['make']}'),
|
||||
Text(
|
||||
'${'Model'.tr}: ${ai.responseIdCardDriverEgyptBack['model']}'),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'Year'.tr}: ${ai.responseIdCardDriverEgyptBack['year']}'),
|
||||
Text(
|
||||
'${'Chassis'.tr}: ${ai.responseIdCardDriverEgyptBack['chassis']}'),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'Color'.tr}: ${ai.responseIdCardDriverEgyptBack['color']}'),
|
||||
Text(
|
||||
'${'Displacement'.tr}: ${ai.responseIdCardDriverEgyptBack['displacement']} cc'),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'Fuel'.tr}: ${ai.responseIdCardDriverEgyptBack['fuel']}'),
|
||||
const SizedBox(height: 8.0),
|
||||
if (taxExpiryDateTime != null)
|
||||
Text(
|
||||
'${'Tax Expiry Date'.tr}: $taxExpiryDate',
|
||||
style: TextStyle(
|
||||
color: isExpired ? Colors.red : Colors.green,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'Inspection Date'.tr}: $carBackLicenseExpired',
|
||||
style: TextStyle(
|
||||
color:
|
||||
isInspectionExpired ? Colors.red : Colors.green,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Card(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
ai.allMethodForAI("""
|
||||
Analyze the extracted car license information and create a JSON object with the following keys:
|
||||
|
||||
{
|
||||
"make": "",
|
||||
"year": "",
|
||||
"chassis": "",
|
||||
"model": "",
|
||||
"engine": "",
|
||||
"displacement": "",
|
||||
"cylinders": "",
|
||||
"fuel": "",
|
||||
"color": "",
|
||||
"color_hex": "",
|
||||
"inspection_date": "",
|
||||
"assuranceNumber": "",
|
||||
"tax_expiry": ""
|
||||
}
|
||||
|
||||
Important notes:
|
||||
1. For dates (inspection_date and tax_expiry), use the format YYYY-MM-DD with Latin numerals (0-9).
|
||||
2. Convert the color name to its corresponding hex color code for the 'color_hex' field.
|
||||
3. Ensure all numeric values (year, displacement, cylinders) are in Latin numerals.
|
||||
4. If any information is missing, leave the corresponding field as an empty string.
|
||||
5. Do not include any explanatory text in the JSON fields, only the extracted values.
|
||||
|
||||
Please fill in the JSON object with the extracted information, following these guidelines.
|
||||
""", 'car_back', ai.driverId);
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Image.network(
|
||||
'${AppLink.server}/card_image/car_back-${ai.driverId}.jpg',
|
||||
height: Get.height * .25,
|
||||
width: double.maxFinite,
|
||||
fit: BoxFit.fitHeight,
|
||||
),
|
||||
Text(
|
||||
'Capture an Image of Your car license back'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
GetBuilder<RegisterCaptainController> egyptCriminalRecord() {
|
||||
return GetBuilder<RegisterCaptainController>(
|
||||
builder: (ai) {
|
||||
if (ai.responseCriminalRecordEgypt.isNotEmpty) {
|
||||
return Card(
|
||||
elevation: 4.0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Criminal Record'.tr, style: AppStyle.headTitle2),
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await ai.allMethodForAI("""
|
||||
Write a JSON object from the following information extracted from the provided Arabic text:
|
||||
|
||||
{
|
||||
"InspectionResult": "",
|
||||
"NationalID": "",
|
||||
"FullName": "",
|
||||
"IssueDate": "" // Format: YYYY-MM-DD
|
||||
}
|
||||
|
||||
Important notes:
|
||||
1. For the IssueDate, ensure the date is in YYYY-MM-DD format using Latin numerals (0-9).
|
||||
2. Add appropriate spaces in all text fields to ensure readability.
|
||||
3. If any information is missing, leave the corresponding field as an empty string.
|
||||
4. Ensure all text is properly formatted and spaces are used correctly.
|
||||
5. Convert any Arabic numerals to Latin numerals (0-9) where applicable.
|
||||
|
||||
Please fill in the JSON object with the extracted information, following these guidelines.
|
||||
""", 'criminalRecord', ai.driverId);
|
||||
},
|
||||
icon: const Icon(Icons.refresh),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
const Divider(color: AppColor.accentColor),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'InspectionResult'.tr}: ${ai.responseCriminalRecordEgypt['InspectionResult']}'),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'FullName'.tr}: ${ai.responseCriminalRecordEgypt['FullName']}',
|
||||
style: AppStyle.title.copyWith(
|
||||
color: ai.responseCriminalRecordEgypt['FullName'] ==
|
||||
ai.responseIdEgyptDriverLicense['name_arabic']
|
||||
? AppColor.greenColor
|
||||
: AppColor.redColor),
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'NationalID'.tr}: ${ai.responseCriminalRecordEgypt['NationalID']}'),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'${'IssueDate'.tr}: ${ai.responseCriminalRecordEgypt['IssueDate']}'),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Card(
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
await ai.allMethodForAI("""
|
||||
Write a JSON object from the following information extracted from the provided Arabic text:
|
||||
|
||||
{
|
||||
"InspectionResult": "",
|
||||
"NationalID": "",
|
||||
"FullName": "",
|
||||
"IssueDate": "" // Format: YYYY-MM-DD
|
||||
}
|
||||
|
||||
Important notes:
|
||||
1. For the IssueDate, ensure the date is in YYYY-MM-DD format using Latin numerals (0-9).
|
||||
2. Add appropriate spaces in all text fields to ensure readability.
|
||||
3. If any information is missing, leave the corresponding field as an empty string.
|
||||
4. Ensure all text is properly formatted and spaces are used correctly.
|
||||
5. Convert any Arabic numerals to Latin numerals (0-9) where applicable.
|
||||
|
||||
Please fill in the JSON object with the extracted information, following these guidelines.
|
||||
""", 'criminalRecord', ai.driverId);
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Image.network(
|
||||
'${AppLink.server}/card_image/6.png',
|
||||
height: Get.height * .25,
|
||||
width: double.maxFinite,
|
||||
fit: BoxFit.fitHeight,
|
||||
),
|
||||
Text(
|
||||
'Capture an Image of Your Criminal Record'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:sefer_admin1/constant/style.dart';
|
||||
import 'package:sefer_admin1/controller/admin/static_controller.dart';
|
||||
import 'package:sefer_admin1/views/widgets/mycircular.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../widgets/my_scafold.dart';
|
||||
@@ -15,188 +16,392 @@ class StaticDash extends StatelessWidget {
|
||||
Get.put(StaticController());
|
||||
return MyScafolld(
|
||||
title: 'Static Dash'.tr,
|
||||
action: IconButton(
|
||||
onPressed: () async {
|
||||
await Get.put(StaticController()).getAll();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.replay_circle_filled_rounded,
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
),
|
||||
body: [
|
||||
GetBuilder<StaticController>(builder: (staticController) {
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
height: Get.height * .3,
|
||||
width: double.maxFinite,
|
||||
// decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(6),
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
height: MediaQuery.of(context).size.height * 0.4,
|
||||
child: LineChart(
|
||||
LineChartData(
|
||||
lineBarsData: [
|
||||
LineChartBarData(
|
||||
isStepLineChart: true,
|
||||
spots: staticController.chartDataPassengers,
|
||||
isCurved: true,
|
||||
color: Colors.deepPurpleAccent, // Custom color
|
||||
barWidth: 3, // Thinner line
|
||||
dotData: const FlDotData(
|
||||
show: true), // Show dots on each point
|
||||
belowBarData: BarAreaData(
|
||||
show: true,
|
||||
color: Colors.deepPurpleAccent.withOpacity(
|
||||
0.3), // Custom gradient color
|
||||
),
|
||||
isStrokeJoinRound: true,
|
||||
shadow: const BoxShadow(
|
||||
color: Colors.yellow,
|
||||
blurRadius: 4,
|
||||
offset: Offset(2, 2),
|
||||
),
|
||||
),
|
||||
],
|
||||
showingTooltipIndicators: const [],
|
||||
titlesData: FlTitlesData(
|
||||
show: true,
|
||||
topTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Days'.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
axisNameSize: 30,
|
||||
),
|
||||
bottomTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Total passengers on month ${staticController.totalMonthlyPassengers}'
|
||||
.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30,
|
||||
showTitles: true,
|
||||
),
|
||||
),
|
||||
leftTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Counts of Passengers on days'.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30,
|
||||
showTitles: true,
|
||||
return staticController.isLoading
|
||||
? const MyCircularProgressIndicator()
|
||||
: ListView(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: Get.height * .3,
|
||||
width: double.maxFinite,
|
||||
// decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(6),
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
height: MediaQuery.of(context).size.height * 0.4,
|
||||
child: LineChart(
|
||||
LineChartData(
|
||||
lineBarsData: [
|
||||
LineChartBarData(
|
||||
isStepLineChart: true,
|
||||
spots:
|
||||
staticController.chartDataPassengers,
|
||||
isCurved: true,
|
||||
color: Colors.blue, // Custom color
|
||||
barWidth: 3, // Thinner line
|
||||
dotData: const FlDotData(
|
||||
show:
|
||||
true), // Show dots on each point
|
||||
belowBarData: BarAreaData(
|
||||
show: true,
|
||||
color: Colors.deepPurpleAccent
|
||||
.withOpacity(
|
||||
0.3), // Custom gradient color
|
||||
),
|
||||
isStrokeJoinRound: true,
|
||||
shadow: const BoxShadow(
|
||||
color: Colors.yellow,
|
||||
blurRadius: 4,
|
||||
offset: Offset(2, 2),
|
||||
),
|
||||
),
|
||||
],
|
||||
showingTooltipIndicators: const [],
|
||||
titlesData: FlTitlesData(
|
||||
show: true,
|
||||
topTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Days'.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
axisNameSize: 30,
|
||||
),
|
||||
bottomTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Total passengers on month ${staticController.totalMonthlyPassengers}'
|
||||
.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30,
|
||||
showTitles: true,
|
||||
),
|
||||
),
|
||||
leftTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Counts of Passengers on days'.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30,
|
||||
showTitles: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
gridData: const FlGridData(show: true),
|
||||
borderData: FlBorderData(
|
||||
show: true,
|
||||
border: const Border(
|
||||
bottom:
|
||||
BorderSide(color: Colors.blueAccent),
|
||||
left:
|
||||
BorderSide(color: Colors.blueAccent),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
gridData: const FlGridData(show: true),
|
||||
borderData: FlBorderData(
|
||||
show: true,
|
||||
border: const Border(
|
||||
bottom: BorderSide(color: Colors.blueAccent),
|
||||
left: BorderSide(color: Colors.blueAccent),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
)),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
Container(
|
||||
height: Get.height * .3,
|
||||
width: double.maxFinite,
|
||||
// decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(6),
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
height: MediaQuery.of(context).size.height * 0.4,
|
||||
child: LineChart(
|
||||
LineChartData(
|
||||
lineBarsData: [
|
||||
LineChartBarData(
|
||||
isStepLineChart: true,
|
||||
spots: staticController.chartDataDrivers,
|
||||
isCurved: true,
|
||||
color: Colors.deepPurpleAccent, // Custom color
|
||||
barWidth: 3, // Thinner line
|
||||
dotData: const FlDotData(
|
||||
show: true), // Show dots on each point
|
||||
belowBarData: BarAreaData(
|
||||
show: true,
|
||||
color: Colors.deepPurpleAccent.withOpacity(
|
||||
0.3), // Custom gradient color
|
||||
),
|
||||
isStrokeJoinRound: true,
|
||||
shadow: const BoxShadow(
|
||||
color: Colors.yellow,
|
||||
blurRadius: 4,
|
||||
offset: Offset(2, 2),
|
||||
),
|
||||
),
|
||||
],
|
||||
showingTooltipIndicators: const [],
|
||||
titlesData: FlTitlesData(
|
||||
show: true,
|
||||
topTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Days'.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
axisNameSize: 30,
|
||||
),
|
||||
bottomTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Total Drivers on month ${staticController.totalMonthlyDrivers}'
|
||||
.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30,
|
||||
showTitles: true,
|
||||
),
|
||||
),
|
||||
leftTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Counts of Drivers on days'.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30,
|
||||
showTitles: true,
|
||||
SizedBox(
|
||||
height: Get.height * .3,
|
||||
width: double.maxFinite,
|
||||
// decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(6),
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
height: MediaQuery.of(context).size.height * 0.4,
|
||||
child: LineChart(
|
||||
LineChartData(
|
||||
lineBarsData: [
|
||||
LineChartBarData(
|
||||
isStepLineChart: true,
|
||||
spots: staticController.chartDataDrivers,
|
||||
isCurved: true,
|
||||
color: Colors.blue, // Custom color
|
||||
barWidth: 3, // Thinner line
|
||||
dotData: const FlDotData(
|
||||
show:
|
||||
true), // Show dots on each point
|
||||
belowBarData: BarAreaData(
|
||||
show: true,
|
||||
color: Colors.deepPurpleAccent
|
||||
.withOpacity(
|
||||
0.3), // Custom gradient color
|
||||
),
|
||||
isStrokeJoinRound: true,
|
||||
shadow: const BoxShadow(
|
||||
color: Colors.yellow,
|
||||
blurRadius: 4,
|
||||
offset: Offset(2, 2),
|
||||
),
|
||||
),
|
||||
],
|
||||
showingTooltipIndicators: const [],
|
||||
titlesData: FlTitlesData(
|
||||
show: true,
|
||||
topTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Days'.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
axisNameSize: 30,
|
||||
),
|
||||
bottomTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Total Drivers on month ${staticController.totalMonthlyDrivers}'
|
||||
.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30,
|
||||
showTitles: true,
|
||||
),
|
||||
),
|
||||
leftTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Counts of Drivers on days'.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30,
|
||||
showTitles: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
gridData: const FlGridData(show: true),
|
||||
borderData: FlBorderData(
|
||||
show: true,
|
||||
border: const Border(
|
||||
bottom:
|
||||
BorderSide(color: Colors.blueAccent),
|
||||
left:
|
||||
BorderSide(color: Colors.blueAccent),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
gridData: const FlGridData(show: true),
|
||||
borderData: FlBorderData(
|
||||
show: true,
|
||||
border: const Border(
|
||||
bottom: BorderSide(color: Colors.blueAccent),
|
||||
left: BorderSide(color: Colors.blueAccent),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
)),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
],
|
||||
);
|
||||
SizedBox(
|
||||
height: Get.height * .3,
|
||||
width: double.maxFinite,
|
||||
// decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(6),
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
height: MediaQuery.of(context).size.height * 0.4,
|
||||
child: LineChart(
|
||||
LineChartData(
|
||||
lineBarsData: [
|
||||
LineChartBarData(
|
||||
isStepLineChart: true,
|
||||
spots: staticController
|
||||
.chartDataDriversCalling,
|
||||
isCurved: true,
|
||||
color: Colors
|
||||
.deepPurpleAccent, // Custom color
|
||||
barWidth: 3, // Thinner line
|
||||
dotData: const FlDotData(
|
||||
show:
|
||||
true), // Show dots on each point
|
||||
belowBarData: BarAreaData(
|
||||
show: true,
|
||||
color: Colors.deepPurpleAccent
|
||||
.withOpacity(
|
||||
0.3), // Custom gradient color
|
||||
),
|
||||
isStrokeJoinRound: true,
|
||||
shadow: const BoxShadow(
|
||||
color: Colors.yellow,
|
||||
blurRadius: 4,
|
||||
offset: Offset(2, 2),
|
||||
),
|
||||
),
|
||||
],
|
||||
showingTooltipIndicators: const [],
|
||||
titlesData: FlTitlesData(
|
||||
show: true,
|
||||
topTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Days'.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
axisNameSize: 30,
|
||||
),
|
||||
bottomTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Total Drivers on month are Calliing ${staticController.staticList[0]['totalMonthlyCallingDrivers']}'
|
||||
.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30,
|
||||
showTitles: true,
|
||||
),
|
||||
),
|
||||
leftTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Counts of Drivers on days'.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30,
|
||||
showTitles: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
gridData: const FlGridData(show: true),
|
||||
borderData: FlBorderData(
|
||||
show: true,
|
||||
border: const Border(
|
||||
bottom:
|
||||
BorderSide(color: Colors.blueAccent),
|
||||
left:
|
||||
BorderSide(color: Colors.blueAccent),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
SizedBox(
|
||||
height: Get.height * .3,
|
||||
width: double.maxFinite,
|
||||
// decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(6),
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
height: MediaQuery.of(context).size.height * 0.4,
|
||||
child: LineChart(
|
||||
LineChartData(
|
||||
lineBarsData: [
|
||||
LineChartBarData(
|
||||
isStepLineChart: true,
|
||||
spots: staticController
|
||||
.chartDataDriversMatchingNotes,
|
||||
isCurved: true,
|
||||
color: Colors
|
||||
.deepPurpleAccent, // Custom color
|
||||
barWidth: 3, // Thinner line
|
||||
dotData: const FlDotData(
|
||||
show:
|
||||
true), // Show dots on each point
|
||||
belowBarData: BarAreaData(
|
||||
show: true,
|
||||
color: Colors.deepPurpleAccent
|
||||
.withOpacity(
|
||||
0.3), // Custom gradient color
|
||||
),
|
||||
isStrokeJoinRound: true,
|
||||
shadow: const BoxShadow(
|
||||
color: Colors.yellow,
|
||||
blurRadius: 4,
|
||||
offset: Offset(2, 2),
|
||||
),
|
||||
),
|
||||
],
|
||||
showingTooltipIndicators: const [],
|
||||
titlesData: FlTitlesData(
|
||||
show: true,
|
||||
topTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Days'.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
axisNameSize: 30,
|
||||
),
|
||||
bottomTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Total Drivers on month are register after calling ${staticController.staticList[0]['totalMonthlyMatchingNotes']}'
|
||||
.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30,
|
||||
showTitles: true,
|
||||
),
|
||||
),
|
||||
leftTitles: AxisTitles(
|
||||
axisNameWidget: Text(
|
||||
'Counts of Drivers on days'.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
axisNameSize: 30,
|
||||
sideTitles: const SideTitles(
|
||||
reservedSize: 30,
|
||||
showTitles: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
gridData: const FlGridData(show: true),
|
||||
borderData: FlBorderData(
|
||||
show: true,
|
||||
border: const Border(
|
||||
bottom:
|
||||
BorderSide(color: Colors.blueAccent),
|
||||
left:
|
||||
BorderSide(color: Colors.blueAccent),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
const SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
],
|
||||
);
|
||||
})
|
||||
],
|
||||
isleading: true);
|
||||
|
||||
Reference in New Issue
Block a user