diff --git a/ios/Podfile.lock b/ios/Podfile.lock index b48d476..4e2fda5 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -87,9 +87,12 @@ PODS: - GTMSessionFetcher/Core (3.4.1) - GTMSessionFetcher/Full (3.4.1): - GTMSessionFetcher/Core - - local_auth_darwin (0.0.1): + - image_cropper (0.0.4): - Flutter - - location (0.0.1): + - TOCropViewController (~> 2.6.1) + - image_picker_ios (0.0.1): + - Flutter + - local_auth_darwin (0.0.1): - Flutter - nanopb (2.30910.0): - nanopb/decode (= 2.30910.0) @@ -103,10 +106,9 @@ PODS: - sqflite (0.0.3): - Flutter - FlutterMacOS + - TOCropViewController (2.6.1) - url_launcher_ios (0.0.1): - Flutter - - webview_flutter_wkwebview (0.0.1): - - Flutter DEPENDENCIES: - firebase_core (from `.symlinks/plugins/firebase_core/ios`) @@ -114,12 +116,12 @@ DEPENDENCIES: - Flutter (from `Flutter`) - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) - google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`) + - image_cropper (from `.symlinks/plugins/image_cropper/ios`) + - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`) - - location (from `.symlinks/plugins/location/ios`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - sqflite (from `.symlinks/plugins/sqflite/darwin`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`) SPEC REPOS: trunk: @@ -136,6 +138,7 @@ SPEC REPOS: - GTMSessionFetcher - nanopb - PromisesObjC + - TOCropViewController EXTERNAL SOURCES: firebase_core: @@ -148,18 +151,18 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/flutter_secure_storage/ios" google_sign_in_ios: :path: ".symlinks/plugins/google_sign_in_ios/darwin" + image_cropper: + :path: ".symlinks/plugins/image_cropper/ios" + image_picker_ios: + :path: ".symlinks/plugins/image_picker_ios/ios" local_auth_darwin: :path: ".symlinks/plugins/local_auth_darwin/darwin" - location: - :path: ".symlinks/plugins/location/ios" path_provider_foundation: :path: ".symlinks/plugins/path_provider_foundation/darwin" sqflite: :path: ".symlinks/plugins/sqflite/darwin" url_launcher_ios: :path: ".symlinks/plugins/url_launcher_ios/ios" - webview_flutter_wkwebview: - :path: ".symlinks/plugins/webview_flutter_wkwebview/ios" SPEC CHECKSUMS: AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa @@ -178,14 +181,15 @@ SPEC CHECKSUMS: GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15 GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de GTMSessionFetcher: 8000756fc1c19d2e5697b90311f7832d2e33f6cd + image_cropper: a3291c624a953049bc6a02e1f8c8ceb162a24b25 + image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1 local_auth_darwin: 4d56c90c2683319835a61274b57620df9c4520ab - location: d5cf8598915965547c3f36761ae9cc4f4e87d22e nanopb: 438bc412db1928dac798aa6fd75726007be04262 path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec + TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863 url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe - webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36 PODFILE CHECKSUM: 1959d098c91d8a792531a723c4a9d7e9f6a01e38 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index e9f7149..eb750e0 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -498,6 +498,7 @@ DEVELOPMENT_TEAM = 63CVT8G5P8; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -682,6 +683,7 @@ DEVELOPMENT_TEAM = 63CVT8G5P8; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -706,6 +708,7 @@ DEVELOPMENT_TEAM = 63CVT8G5P8; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/lib/constant/api_key.dart b/lib/constant/api_key.dart index f8ae211..6433459 100644 --- a/lib/constant/api_key.dart +++ b/lib/constant/api_key.dart @@ -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); } diff --git a/lib/constant/info.dart b/lib/constant/info.dart index 5254d29..5a41e7b 100644 --- a/lib/constant/info.dart +++ b/lib/constant/info.dart @@ -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 = ''' diff --git a/lib/constant/links.dart b/lib/constant/links.dart index 95c0a3e..59667b7 100644 --- a/lib/constant/links.dart +++ b/lib/constant/links.dart @@ -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"; } diff --git a/lib/constant/style.dart b/lib/constant/style.dart index ddbf7d8..71eab1c 100644 --- a/lib/constant/style.dart +++ b/lib/constant/style.dart @@ -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)), diff --git a/lib/controller/admin/register_captain_controller.dart b/lib/controller/admin/register_captain_controller.dart new file mode 100644 index 0000000..9aa95cc --- /dev/null +++ b/lib/controller/admin/register_captain_controller.dart @@ -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? 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 responseMap = {}; + Map responseCarLicenseMapJordan = {}; + Map responseBackCarLicenseMap = {}; + Map responseIdCardMap = {}; + Map responseIdCardDriverEgyptBack = {}; + Map responseForComplaint = {}; + Map responseIdCardDriverEgyptFront = {}; + Map responseIdEgyptFront = {}; + Map responseCriminalRecordEgypt = {}; + Map responseIdEgyptBack = {}; + Map 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 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 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().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().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().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().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 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 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 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 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 {} + } +} diff --git a/lib/controller/admin/static_controller.dart b/lib/controller/admin/static_controller.dart index 83c0870..f998dff 100644 --- a/lib/controller/admin/static_controller.dart +++ b/lib/controller/admin/static_controller.dart @@ -10,8 +10,11 @@ import '../functions/crud.dart'; class StaticController extends GetxController { Map jsonData1 = {}; Map 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; isLoading = false; final List jsonData = jsonResponse['message']; - totalMonthlyDrivers = jsonData[0]['totalMonthly'].toString(); + staticList = jsonData; + totalMonthlyDrivers = jsonData[0]['totalDrivers'].toString(); driversData = jsonData.map((item) { return MonthlyDriverInstall.fromJson(item); }).toList(); final List spots = driversData .map((data) => FlSpot( data.day.toDouble(), - data.totalDrivers.toDouble(), + data.dailyTotalDrivers.toDouble(), )) .toList(); chartDataDrivers = spots; + final List spotsCalling = driversData + .map((data) => FlSpot( + data.day.toDouble(), + data.dailyTotalCallingDrivers.toDouble(), + )) + .toList(); + chartDataDriversCalling = spotsCalling; + final List 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 } diff --git a/lib/controller/firebase/firbase_messge.dart b/lib/controller/firebase/firbase_messge.dart index 2bcf8af..1b7c441 100644 --- a/lib/controller/firebase/firbase_messge.dart +++ b/lib/controller/firebase/firbase_messge.dart @@ -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 tokens = []; List tokensPassengers = []; List dataTokens = []; + List dataTokensPassenger = []; late String driverID; late String driverToken; NotificationSettings? notificationSettings; - + bool isLoading = false; Future 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 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 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 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 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), diff --git a/lib/controller/functions/crud.dart b/lib/controller/functions/crud.dart index 7ba4186..2580ae0 100644 --- a/lib/controller/functions/crud.dart +++ b/lib/controller/functions/crud.dart @@ -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 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 textValues = getAllTextValues(json); @@ -166,23 +164,24 @@ class CRUD { Future 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(); diff --git a/lib/controller/notification_controller.dart b/lib/controller/notification_controller.dart index 998a9b8..1df9580 100644 --- a/lib/controller/notification_controller.dart +++ b/lib/controller/notification_controller.dart @@ -16,11 +16,12 @@ class NotificationController extends GetxController { List tokensPassengers = []; getTokensDrivers() async { - await FirebaseMessagesController().getAllTokenDrivers(); + await FirebaseMessagesController().loadAllPagesAndSendNotifications(); } getTokensPassengers() async { - await FirebaseMessagesController().getAllTokenPassengers(); + await FirebaseMessagesController() + .loadAllPagesAndSendNotificationsPassengers(); } Future 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]); } } }), diff --git a/lib/models/model/passengers_model.dart b/lib/models/model/passengers_model.dart index 32a903a..3f97d00 100644 --- a/lib/models/model/passengers_model.dart +++ b/lib/models/model/passengers_model.dart @@ -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 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()), + ); } diff --git a/lib/views/admin/admin_home_page.dart b/lib/views/admin/admin_home_page.dart index 232eed4..2d5cd95 100644 --- a/lib/views/admin/admin_home_page.dart +++ b/lib/views/admin/admin_home_page.dart @@ -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: () => diff --git a/lib/views/admin/captain/drivers_cant_registe.dart b/lib/views/admin/captain/drivers_cant_registe.dart new file mode 100644 index 0000000..580dec6 --- /dev/null +++ b/lib/views/admin/captain/drivers_cant_registe.dart @@ -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(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); + } +} diff --git a/lib/views/admin/captain/register_captain.dart b/lib/views/admin/captain/register_captain.dart new file mode 100644 index 0000000..3a0a3d6 --- /dev/null +++ b/lib/views/admin/captain/register_captain.dart @@ -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(builder: (controller) { + return IconButton( + onPressed: () { + controller.isLoading = false; + controller.update(); + }, + icon: const Icon(Icons.refresh), + ); + }), + body: [ + GetBuilder(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 egyptDriverLicense() { + return GetBuilder( + 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 egyptDriverIDBack() { + return GetBuilder( + 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 egyptDriverIDFront() { + return GetBuilder( + 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 egyptCarLicenceFront() { + return GetBuilder( + 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 egyptCarLicenceBack() { + return GetBuilder( + 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 egyptCriminalRecord() { + return GetBuilder( + 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, + ), + ], + ), + ), + ); + }, + ); + } +} diff --git a/lib/views/admin/static/static.dart b/lib/views/admin/static/static.dart index d53a782..2bb0b70 100644 --- a/lib/views/admin/static/static.dart +++ b/lib/views/admin/static/static.dart @@ -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(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); diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 38dd0bc..3ccd551 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,10 +6,14 @@ #include "generated_plugin_registrant.h" +#include #include #include void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); + file_selector_plugin_register_with_registrar(file_selector_linux_registrar); g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 65240e9..9ce94c4 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + file_selector_linux flutter_secure_storage_linux url_launcher_linux ) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 24f9c66..b949163 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,6 +5,7 @@ import FlutterMacOS import Foundation +import file_selector_macos import firebase_core import firebase_messaging import flutter_secure_storage_macos @@ -14,6 +15,7 @@ import sqflite import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) diff --git a/macos/Podfile b/macos/Podfile index c795730..b52666a 100644 --- a/macos/Podfile +++ b/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.14' +platform :osx, '10.15' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/macos/Podfile.lock b/macos/Podfile.lock new file mode 100644 index 0000000..5e7dfdf --- /dev/null +++ b/macos/Podfile.lock @@ -0,0 +1,181 @@ +PODS: + - AppAuth (1.7.5): + - AppAuth/Core (= 1.7.5) + - AppAuth/ExternalUserAgent (= 1.7.5) + - AppAuth/Core (1.7.5) + - AppAuth/ExternalUserAgent (1.7.5): + - AppAuth/Core + - file_selector_macos (0.0.1): + - FlutterMacOS + - Firebase/CoreOnly (10.25.0): + - FirebaseCore (= 10.25.0) + - Firebase/Messaging (10.25.0): + - Firebase/CoreOnly + - FirebaseMessaging (~> 10.25.0) + - firebase_core (2.32.0): + - Firebase/CoreOnly (~> 10.25.0) + - FlutterMacOS + - firebase_messaging (14.9.4): + - Firebase/CoreOnly (~> 10.25.0) + - Firebase/Messaging (~> 10.25.0) + - firebase_core + - FlutterMacOS + - FirebaseCore (10.25.0): + - FirebaseCoreInternal (~> 10.0) + - GoogleUtilities/Environment (~> 7.12) + - GoogleUtilities/Logger (~> 7.12) + - FirebaseCoreInternal (10.29.0): + - "GoogleUtilities/NSData+zlib (~> 7.8)" + - FirebaseInstallations (10.29.0): + - FirebaseCore (~> 10.0) + - GoogleUtilities/Environment (~> 7.8) + - GoogleUtilities/UserDefaults (~> 7.8) + - PromisesObjC (~> 2.1) + - FirebaseMessaging (10.25.0): + - FirebaseCore (~> 10.0) + - FirebaseInstallations (~> 10.0) + - GoogleDataTransport (~> 9.3) + - GoogleUtilities/AppDelegateSwizzler (~> 7.8) + - GoogleUtilities/Environment (~> 7.8) + - GoogleUtilities/Reachability (~> 7.8) + - GoogleUtilities/UserDefaults (~> 7.8) + - nanopb (< 2.30911.0, >= 2.30908.0) + - flutter_secure_storage_macos (6.1.1): + - FlutterMacOS + - FlutterMacOS (1.0.0) + - google_sign_in_ios (0.0.1): + - AppAuth (>= 1.7.4) + - Flutter + - FlutterMacOS + - GoogleSignIn (~> 7.1) + - GTMSessionFetcher (>= 3.4.0) + - GoogleDataTransport (9.4.1): + - GoogleUtilities/Environment (~> 7.7) + - nanopb (< 2.30911.0, >= 2.30908.0) + - PromisesObjC (< 3.0, >= 1.2) + - GoogleSignIn (7.1.0): + - AppAuth (< 2.0, >= 1.7.3) + - GTMAppAuth (< 5.0, >= 4.1.1) + - GTMSessionFetcher/Core (~> 3.3) + - GoogleUtilities/AppDelegateSwizzler (7.13.3): + - GoogleUtilities/Environment + - GoogleUtilities/Logger + - GoogleUtilities/Network + - GoogleUtilities/Privacy + - GoogleUtilities/Environment (7.13.3): + - GoogleUtilities/Privacy + - PromisesObjC (< 3.0, >= 1.2) + - GoogleUtilities/Logger (7.13.3): + - GoogleUtilities/Environment + - GoogleUtilities/Privacy + - GoogleUtilities/Network (7.13.3): + - GoogleUtilities/Logger + - "GoogleUtilities/NSData+zlib" + - GoogleUtilities/Privacy + - GoogleUtilities/Reachability + - "GoogleUtilities/NSData+zlib (7.13.3)": + - GoogleUtilities/Privacy + - GoogleUtilities/Privacy (7.13.3) + - GoogleUtilities/Reachability (7.13.3): + - GoogleUtilities/Logger + - GoogleUtilities/Privacy + - GoogleUtilities/UserDefaults (7.13.3): + - GoogleUtilities/Logger + - GoogleUtilities/Privacy + - GTMAppAuth (4.1.1): + - AppAuth/Core (~> 1.7) + - GTMSessionFetcher/Core (< 4.0, >= 3.3) + - GTMSessionFetcher (3.5.0): + - GTMSessionFetcher/Full (= 3.5.0) + - GTMSessionFetcher/Core (3.5.0) + - GTMSessionFetcher/Full (3.5.0): + - GTMSessionFetcher/Core + - nanopb (2.30910.0): + - nanopb/decode (= 2.30910.0) + - nanopb/encode (= 2.30910.0) + - nanopb/decode (2.30910.0) + - nanopb/encode (2.30910.0) + - path_provider_foundation (0.0.1): + - Flutter + - FlutterMacOS + - PromisesObjC (2.4.0) + - sqflite (0.0.3): + - Flutter + - FlutterMacOS + - url_launcher_macos (0.0.1): + - FlutterMacOS + +DEPENDENCIES: + - file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`) + - firebase_core (from `Flutter/ephemeral/.symlinks/plugins/firebase_core/macos`) + - firebase_messaging (from `Flutter/ephemeral/.symlinks/plugins/firebase_messaging/macos`) + - flutter_secure_storage_macos (from `Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos`) + - FlutterMacOS (from `Flutter/ephemeral`) + - google_sign_in_ios (from `Flutter/ephemeral/.symlinks/plugins/google_sign_in_ios/darwin`) + - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) + - sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/darwin`) + - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) + +SPEC REPOS: + trunk: + - AppAuth + - Firebase + - FirebaseCore + - FirebaseCoreInternal + - FirebaseInstallations + - FirebaseMessaging + - GoogleDataTransport + - GoogleSignIn + - GoogleUtilities + - GTMAppAuth + - GTMSessionFetcher + - nanopb + - PromisesObjC + +EXTERNAL SOURCES: + file_selector_macos: + :path: Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos + firebase_core: + :path: Flutter/ephemeral/.symlinks/plugins/firebase_core/macos + firebase_messaging: + :path: Flutter/ephemeral/.symlinks/plugins/firebase_messaging/macos + flutter_secure_storage_macos: + :path: Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_macos/macos + FlutterMacOS: + :path: Flutter/ephemeral + google_sign_in_ios: + :path: Flutter/ephemeral/.symlinks/plugins/google_sign_in_ios/darwin + path_provider_foundation: + :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin + sqflite: + :path: Flutter/ephemeral/.symlinks/plugins/sqflite/darwin + url_launcher_macos: + :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos + +SPEC CHECKSUMS: + AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa + file_selector_macos: 54fdab7caa3ac3fc43c9fac4d7d8d231277f8cf2 + Firebase: 0312a2352584f782ea56f66d91606891d4607f06 + firebase_core: b5b8b60dad71f93132bbaa21e8d1379367d824f0 + firebase_messaging: d821ad7103878837085612e389fe66203c5c6c0c + FirebaseCore: 7ec4d0484817f12c3373955bc87762d96842d483 + FirebaseCoreInternal: df84dd300b561c27d5571684f389bf60b0a5c934 + FirebaseInstallations: 913cf60d0400ebd5d6b63a28b290372ab44590dd + FirebaseMessaging: 88950ba9485052891ebe26f6c43a52bb62248952 + flutter_secure_storage_macos: 59459653abe1adb92abbc8ea747d79f8d19866c9 + FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 + google_sign_in_ios: 07375bfbf2620bc93a602c0e27160d6afc6ead38 + GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a + GoogleSignIn: d4281ab6cf21542b1cfaff85c191f230b399d2db + GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15 + GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de + GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 + nanopb: 438bc412db1928dac798aa6fd75726007be04262 + path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 + PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 + sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec + url_launcher_macos: 5f437abeda8c85500ceb03f5c1938a8c5a705399 + +PODFILE CHECKSUM: 9ebaf0ce3d369aaa26a9ea0e159195ed94724cf3 + +COCOAPODS: 1.15.2 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 5e4052c..359bec2 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -27,6 +27,8 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 90312D61965A98F2D2C93217 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BACEABA3EA8C9BBC387EFFC0 /* Pods_RunnerTests.framework */; }; + 97B7374F8174B912533435D5 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2CBDD19BD1BCCC6B5366B9AE /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -60,11 +62,13 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 2CBDD19BD1BCCC6B5366B9AE /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 2E16ED4F8D844885C8F0EFA5 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* sefer_admin1.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "sefer_admin1.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* sefer_admin1.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = sefer_admin1.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -76,8 +80,14 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 59C124E9AAD44F8C72C935E7 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + 74A3E0EB0FADFCE71F3CF6EE /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 8D1932E55E324BB3D6DB8CBB /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + A3EECAABF9E3B48C7776044F /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + BACEABA3EA8C9BBC387EFFC0 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D557376BED31E7B24F4535F7 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -85,6 +95,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 90312D61965A98F2D2C93217 /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -92,6 +103,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 97B7374F8174B912533435D5 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -125,6 +137,7 @@ 331C80D6294CF71000263BE5 /* RunnerTests */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, + E1C6A3E88D1922232E4DF25C /* Pods */, ); sourceTree = ""; }; @@ -175,10 +188,26 @@ D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( + 2CBDD19BD1BCCC6B5366B9AE /* Pods_Runner.framework */, + BACEABA3EA8C9BBC387EFFC0 /* Pods_RunnerTests.framework */, ); name = Frameworks; sourceTree = ""; }; + E1C6A3E88D1922232E4DF25C /* Pods */ = { + isa = PBXGroup; + children = ( + 2E16ED4F8D844885C8F0EFA5 /* Pods-Runner.debug.xcconfig */, + 8D1932E55E324BB3D6DB8CBB /* Pods-Runner.release.xcconfig */, + A3EECAABF9E3B48C7776044F /* Pods-Runner.profile.xcconfig */, + D557376BED31E7B24F4535F7 /* Pods-RunnerTests.debug.xcconfig */, + 74A3E0EB0FADFCE71F3CF6EE /* Pods-RunnerTests.release.xcconfig */, + 59C124E9AAD44F8C72C935E7 /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -186,6 +215,7 @@ isa = PBXNativeTarget; buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( + 63DDF0EB08E73AF448E3AF54 /* [CP] Check Pods Manifest.lock */, 331C80D1294CF70F00263BE5 /* Sources */, 331C80D2294CF70F00263BE5 /* Frameworks */, 331C80D3294CF70F00263BE5 /* Resources */, @@ -204,11 +234,14 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + 42CC75A53F9E10CB310D46FC /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, + D94DAC4827C694D0698C6E9A /* [CP] Embed Pods Frameworks */, + A7F1346B13DDA24D12ABDA2C /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -329,6 +362,84 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; + 42CC75A53F9E10CB310D46FC /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 63DDF0EB08E73AF448E3AF54 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + A7F1346B13DDA24D12ABDA2C /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + D94DAC4827C694D0698C6E9A /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -380,6 +491,7 @@ /* Begin XCBuildConfiguration section */ 331C80DB294CF71000263BE5 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = D557376BED31E7B24F4535F7 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CURRENT_PROJECT_VERSION = 1; @@ -394,6 +506,7 @@ }; 331C80DC294CF71000263BE5 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 74A3E0EB0FADFCE71F3CF6EE /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CURRENT_PROJECT_VERSION = 1; @@ -408,6 +521,7 @@ }; 331C80DD294CF71000263BE5 /* Profile */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 59C124E9AAD44F8C72C935E7 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CURRENT_PROJECT_VERSION = 1; diff --git a/macos/Runner.xcworkspace/contents.xcworkspacedata b/macos/Runner.xcworkspace/contents.xcworkspacedata index 1d526a1..21a3cc1 100644 --- a/macos/Runner.xcworkspace/contents.xcworkspacedata +++ b/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/macos/Runner/DebugProfile.entitlements b/macos/Runner/DebugProfile.entitlements index dddb8a3..0bfcd59 100644 --- a/macos/Runner/DebugProfile.entitlements +++ b/macos/Runner/DebugProfile.entitlements @@ -1,12 +1,14 @@ - - com.apple.security.app-sandbox - - com.apple.security.cs.allow-jit - - com.apple.security.network.server - - - + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + com.apple.security.network.client + + + \ No newline at end of file diff --git a/macos/Runner/Info.plist b/macos/Runner/Info.plist index 4789daa..7fadfb0 100644 --- a/macos/Runner/Info.plist +++ b/macos/Runner/Info.plist @@ -1,32 +1,56 @@ - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIconFile - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSMinimumSystemVersion - $(MACOSX_DEPLOYMENT_TARGET) - NSHumanReadableCopyright - $(PRODUCT_COPYRIGHT) - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Sefer Admin1 + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + sefer_admin1 + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + \ No newline at end of file diff --git a/macos/Runner/Release.entitlements b/macos/Runner/Release.entitlements index 852fa1a..eeeb42c 100644 --- a/macos/Runner/Release.entitlements +++ b/macos/Runner/Release.entitlements @@ -1,8 +1,12 @@ - - com.apple.security.app-sandbox - - - + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index 484405e..8268888 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -177,6 +177,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.1" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "55d7b444feb71301ef6b8838dbc1ae02e63dd48c8773f3810ff53bb1e2945b32" + url: "https://pub.dev" + source: hosted + version: "0.3.4+1" crypto: dependency: transitive description: @@ -249,6 +257,38 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.0" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "045d372bf19b02aeb69cacf8b4009555fb5f6f0b7ad8016e5f46dd1387ddd492" + url: "https://pub.dev" + source: hosted + version: "0.9.2+1" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: f42eacb83b318e183b1ae24eead1373ab1334084404c8c16e0354f9a3e55d385 + url: "https://pub.dev" + source: hosted + version: "0.9.4" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b + url: "https://pub.dev" + source: hosted + version: "2.6.2" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: d3547240c20cabf205c7c7f01a50ecdbc413755814d6677f3cb366f04abcead0 + url: "https://pub.dev" + source: hosted + version: "0.9.3+1" firebase_core: dependency: "direct main" description: @@ -528,6 +568,94 @@ packages: url: "https://pub.dev" source: hosted version: "4.2.0" + image_cropper: + dependency: "direct main" + description: + name: image_cropper + sha256: "542c3453109d16bcc388e43ae2276044d2cd6a6d20c68bdcff2c94ab9363ea15" + url: "https://pub.dev" + source: hosted + version: "4.0.1" + image_cropper_for_web: + dependency: transitive + description: + name: image_cropper_for_web + sha256: "89c936aa772a35b69ca67b78049ae9fa163a4fb8da2f6dee3893db8883fb49d2" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + image_cropper_platform_interface: + dependency: transitive + description: + name: image_cropper_platform_interface + sha256: b232175c132b2f7ede3e1f101652bcd635cb4079a77c6dded8e6d32e6578d685 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + image_picker: + dependency: "direct main" + description: + name: image_picker + sha256: "021834d9c0c3de46bf0fe40341fa07168407f694d9b2bb18d532dc1261867f7a" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: ff39a10ab4f48f4ac70776d0494a97bf073cd2570892cd46bc8a5cac162c25db + url: "https://pub.dev" + source: hosted + version: "0.8.12+4" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "5d6eb13048cd47b60dbf1a5495424dea226c5faf3950e20bf8120a58efb5b5f3" + url: "https://pub.dev" + source: hosted + version: "3.0.4" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: "6703696ad49f5c3c8356d576d7ace84d1faf459afb07accbb0fae780753ff447" + url: "https://pub.dev" + source: hosted + version: "0.8.12" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "4ed1d9bb36f7cd60aa6e6cd479779cc56a4cb4e4de8f49d487b1aaad831300fa" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: "3f5ad1e8112a9a6111c46d0b57a7be2286a9a07fc6e1976fdf5be2bd31d4ff62" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + sha256: "9ec26d410ff46f483c5519c29c02ef0e02e13a543f882b152d4bfd2f06802f80" + url: "https://pub.dev" + source: hosted + version: "2.10.0" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" intl: dependency: "direct main" description: @@ -792,6 +920,13 @@ packages: url: "https://pub.dev" source: hosted version: "4.1.0" + secure_string_operations: + dependency: "direct main" + description: + path: secure_string_operations + relative: true + source: path + version: "1.0.0" shelf: dependency: transitive description: @@ -1054,5 +1189,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.3.2 <4.0.0" - flutter: ">=3.19.0" + dart: ">=3.4.0 <4.0.0" + flutter: ">=3.22.0" diff --git a/pubspec.yaml b/pubspec.yaml index 45fc3d5..3f5ce24 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -30,6 +30,8 @@ environment: dependencies: # agora_rtc_engine: ^6.3.0 # device_info_plus: ^10.1.0 + secure_string_operations: + path: ./secure_string_operations dio: ^5.4.3+1 envied: ^0.5.4+1 firebase_core: ^2.30.1 @@ -41,7 +43,7 @@ dependencies: # flutter_local_notifications: ^17.1.1 # flutter_paypal: ^0.2.0 flutter_secure_storage: ^9.0.0 -# flutter_stripe: ^10.1.1 + # flutter_stripe: ^10.1.1 get: ^4.6.6 get_storage: ^2.1.1 google_fonts: ^4.0.4 @@ -49,8 +51,8 @@ dependencies: google_sign_in: ^6.2.1 http: ^0.13.6 # image: ^4.1.7 - # image_cropper: ^4.0.1 - # image_picker: ^1.1.1 + image_cropper: ^4.0.1 + image_picker: ^1.1.1 intl: ^0.19.0 local_auth: ^2.2.0 # location: ^6.0.1 diff --git a/secure_string_operations/lib/secure_string_operations.dart b/secure_string_operations/lib/secure_string_operations.dart new file mode 100644 index 0000000..d428ac3 --- /dev/null +++ b/secure_string_operations/lib/secure_string_operations.dart @@ -0,0 +1,47 @@ +// File: lib/secure_string_operations.dart + +library secure_string_operations; + +class X { + static String c(String a, Map b) { + StringBuffer c = StringBuffer(); + c.write(a); + + String d = "Bl"; + c.write(b[d] ?? d); + + StringBuffer e = StringBuffer(); + String f = c.toString(); + + for (int g = 0; g < f.length; g++) { + String h = f[g]; + e.write(b[h] ?? h); + } + + return e.toString(); + } + + static String r(String a, Map b) { + StringBuffer c = StringBuffer(); + String d = "Bl"; + int e = d.length; + + for (int f = 0; f < a.length; f++) { + String g = a[f]; + String h = b.keys.firstWhere( + (i) => b[i] == g, + orElse: () => g, + ); + + c.write(h); + } + + String j = c.toString(); + + if (j.endsWith(d)) { + j = j.substring(0, j.length - e); + } + + return j; + } +} diff --git a/secure_string_operations/pubspec.lock b/secure_string_operations/pubspec.lock new file mode 100644 index 0000000..fce7ef1 --- /dev/null +++ b/secure_string_operations/pubspec.lock @@ -0,0 +1,5 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: {} +sdks: + dart: ">=2.12.0 <4.0.0" diff --git a/secure_string_operations/pubspec.yaml b/secure_string_operations/pubspec.yaml new file mode 100644 index 0000000..b910400 --- /dev/null +++ b/secure_string_operations/pubspec.yaml @@ -0,0 +1,6 @@ +name: secure_string_operations +description: A package for secure string operations +version: 1.0.0 + +environment: + sdk: ">=2.12.0 <3.0.0" diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 028ccd2..c1ddf6d 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,12 +6,15 @@ #include "generated_plugin_registrant.h" +#include #include #include #include #include void RegisterPlugins(flutter::PluginRegistry* registry) { + FileSelectorWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FileSelectorWindows")); FirebaseCorePluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); FlutterSecureStorageWindowsPluginRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 5df1253..93dbf81 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + file_selector_windows firebase_core flutter_secure_storage_windows local_auth_windows