This commit is contained in:
Hamza-Ayed
2025-06-06 23:28:02 +03:00
parent 02bb9fc7f7
commit 3a993cc1ba
49 changed files with 19760 additions and 3303 deletions

9
.env
View File

@@ -13,6 +13,15 @@ keyOfApp=nqryjp@1737wqnmqqsjyzjujljksvceiXrXlBl
emailService=seferservice@sefer.live emailService=seferservice@sefer.live
anthropicAIkeySeferNew=zg-qbc-qvo39-n4VdMQ5nuJeIYhMN4PDYr7qox3-t2i1Lh7aNTDfYF-Gf8whUJZCs47EeelKn8_UcmUMmiSLaf0UJg0DvUlQrDt-76CRrkQQXrXlBl anthropicAIkeySeferNew=zg-qbc-qvo39-n4VdMQ5nuJeIYhMN4PDYr7qox3-t2i1Lh7aNTDfYF-Gf8whUJZCs47EeelKn8_UcmUMmiSLaf0UJg0DvUlQrDt-76CRrkQQXrXlBl
anthropicAIkeySeferNewHamzaayedpython=zg-qbc-qvo39-vCB-WnzEwFNArO0YlTapvfhtmguKWsXJSKqg_NZSjHBYVXMZK1yUK88SobdckV0KuPaBh0c_WHtGsRO_439PBk-e2QqgkQQXrXlBl anthropicAIkeySeferNewHamzaayedpython=zg-qbc-qvo39-vCB-WnzEwFNArO0YlTapvfhtmguKWsXJSKqg_NZSjHBYVXMZK1yUK88SobdckV0KuPaBh0c_WHtGsRO_439PBk-e2QqgkQQXrXlBl
keyOfApp=nqryjjjhgjp@1bCQ1FnMGxYwsjyzjujljksvceiXrXlBl
initializationVector=ujljkdelkjlXrXlBlfghijkl
sss_pass=wqnmqqsjyvwv:nqrYJP@17378XrXlBl
sss_encryptionSalt=zg-vlie-2l1ZlpxiLJ6wQOvbb4TnC9XrxgUEyVQIu6TID4qP4FUUqoS5XrXlBl
addd=BlBlNl
allowed=Tripz:
passnpassenger=hbgbitbXrXrBr
newId=new
getapiKey=https://server.sefer.live/sefer.click/sefer/ride/apiKey/get.php
a=q a=q
b=x b=x

2
.gitignore vendored
View File

@@ -5,9 +5,11 @@
*.swp *.swp
.DS_Store .DS_Store
.atom/ .atom/
.build/
.buildlog/ .buildlog/
.history .history
.svn/ .svn/
.swiftpm/
migrate_working_dir/ migrate_working_dir/
# IntelliJ related # IntelliJ related

View File

@@ -43,8 +43,8 @@ android {
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdk = 23 minSdk = 23
targetSdk = flutter.targetSdkVersion targetSdk = flutter.targetSdkVersion
versionCode = 12 versionCode = 13
versionName = '1.12' versionName = '1.13'
} }
buildTypes { buildTypes {

View File

@@ -9,11 +9,14 @@
android:maxSdkVersion="28" /> android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<application <application
android:label="service" android:label="service"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/launcher_icon" android:icon="@mipmap/launcher_icon"
android:enableOnBackInvokedCallback="true"
android:requestLegacyExternalStorage="true"> android:requestLegacyExternalStorage="true">
<activity <activity

View File

@@ -5,53 +5,55 @@ PODS:
- AppAuth/Core (1.7.5) - AppAuth/Core (1.7.5)
- AppAuth/ExternalUserAgent (1.7.5): - AppAuth/ExternalUserAgent (1.7.5):
- AppAuth/Core - AppAuth/Core
- contacts_service (0.2.2):
- Flutter
- device_info_plus (0.0.1): - device_info_plus (0.0.1):
- Flutter - Flutter
- Firebase/Auth (11.0.0): - Firebase/Auth (11.8.0):
- Firebase/CoreOnly - Firebase/CoreOnly
- FirebaseAuth (~> 11.0.0) - FirebaseAuth (~> 11.8.0)
- Firebase/CoreOnly (11.0.0): - Firebase/CoreOnly (11.8.0):
- FirebaseCore (= 11.0.0) - FirebaseCore (~> 11.8.0)
- Firebase/Messaging (11.0.0): - Firebase/Messaging (11.8.0):
- Firebase/CoreOnly - Firebase/CoreOnly
- FirebaseMessaging (~> 11.0.0) - FirebaseMessaging (~> 11.8.0)
- firebase_auth (5.2.0): - firebase_auth (5.5.1):
- Firebase/Auth (= 11.0.0) - Firebase/Auth (= 11.8.0)
- firebase_core - firebase_core
- Flutter - Flutter
- firebase_core (3.4.0): - firebase_core (3.12.1):
- Firebase/CoreOnly (= 11.0.0) - Firebase/CoreOnly (= 11.8.0)
- Flutter - Flutter
- firebase_messaging (15.1.0): - firebase_messaging (15.2.4):
- Firebase/Messaging (= 11.0.0) - Firebase/Messaging (= 11.8.0)
- firebase_core - firebase_core
- Flutter - Flutter
- FirebaseAppCheckInterop (11.2.0) - FirebaseAppCheckInterop (11.9.0)
- FirebaseAuth (11.0.0): - FirebaseAuth (11.8.1):
- FirebaseAppCheckInterop (~> 11.0) - FirebaseAppCheckInterop (~> 11.0)
- FirebaseAuthInterop (~> 11.0) - FirebaseAuthInterop (~> 11.0)
- FirebaseCore (~> 11.0) - FirebaseCore (~> 11.8.0)
- FirebaseCoreExtension (~> 11.0) - FirebaseCoreExtension (~> 11.8.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.0) - GoogleUtilities/AppDelegateSwizzler (~> 8.0)
- GoogleUtilities/Environment (~> 8.0) - GoogleUtilities/Environment (~> 8.0)
- GTMSessionFetcher/Core (~> 3.4) - GTMSessionFetcher/Core (< 5.0, >= 3.4)
- RecaptchaInterop (~> 100.0) - RecaptchaInterop (~> 100.0)
- FirebaseAuthInterop (11.2.0) - FirebaseAuthInterop (11.9.0)
- FirebaseCore (11.0.0): - FirebaseCore (11.8.1):
- FirebaseCoreInternal (~> 11.0) - FirebaseCoreInternal (~> 11.8.0)
- GoogleUtilities/Environment (~> 8.0) - GoogleUtilities/Environment (~> 8.0)
- GoogleUtilities/Logger (~> 8.0) - GoogleUtilities/Logger (~> 8.0)
- FirebaseCoreExtension (11.2.0): - FirebaseCoreExtension (11.8.0):
- FirebaseCore (~> 11.0) - FirebaseCore (~> 11.8.0)
- FirebaseCoreInternal (11.2.0): - FirebaseCoreInternal (11.8.0):
- "GoogleUtilities/NSData+zlib (~> 8.0)" - "GoogleUtilities/NSData+zlib (~> 8.0)"
- FirebaseInstallations (11.2.0): - FirebaseInstallations (11.8.0):
- FirebaseCore (~> 11.0) - FirebaseCore (~> 11.8.0)
- GoogleUtilities/Environment (~> 8.0) - GoogleUtilities/Environment (~> 8.0)
- GoogleUtilities/UserDefaults (~> 8.0) - GoogleUtilities/UserDefaults (~> 8.0)
- PromisesObjC (~> 2.4) - PromisesObjC (~> 2.4)
- FirebaseMessaging (11.0.0): - FirebaseMessaging (11.8.0):
- FirebaseCore (~> 11.0) - FirebaseCore (~> 11.8.0)
- FirebaseInstallations (~> 11.0) - FirebaseInstallations (~> 11.0)
- GoogleDataTransport (~> 10.0) - GoogleDataTransport (~> 10.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.0) - GoogleUtilities/AppDelegateSwizzler (~> 8.0)
@@ -140,6 +142,8 @@ PODS:
- path_provider_foundation (0.0.1): - path_provider_foundation (0.0.1):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
- permission_handler_apple (9.3.0):
- Flutter
- PromisesObjC (2.4.0) - PromisesObjC (2.4.0)
- RecaptchaInterop (100.0.0) - RecaptchaInterop (100.0.0)
- SDWebImage (5.19.7): - SDWebImage (5.19.7):
@@ -150,16 +154,17 @@ PODS:
- SDWebImage/Core (~> 5.17) - SDWebImage/Core (~> 5.17)
- share (0.0.1): - share (0.0.1):
- Flutter - Flutter
- sqflite (0.0.3): - sqflite_darwin (0.0.4):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
- TOCropViewController (2.7.4) - TOCropViewController (2.7.4)
- url_launcher_ios (0.0.1): - url_launcher_ios (0.0.1):
- Flutter - Flutter
- vibration (1.7.5): - vibration (3.0.0):
- Flutter - Flutter
DEPENDENCIES: DEPENDENCIES:
- contacts_service (from `.symlinks/plugins/contacts_service/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`) - firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`) - firebase_core (from `.symlinks/plugins/firebase_core/ios`)
@@ -171,8 +176,9 @@ DEPENDENCIES:
- image_cropper (from `.symlinks/plugins/image_cropper/ios`) - image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- share (from `.symlinks/plugins/share/ios`) - share (from `.symlinks/plugins/share/ios`)
- sqflite (from `.symlinks/plugins/sqflite/darwin`) - sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- vibration (from `.symlinks/plugins/vibration/ios`) - vibration (from `.symlinks/plugins/vibration/ios`)
@@ -203,6 +209,8 @@ SPEC REPOS:
- TOCropViewController - TOCropViewController
EXTERNAL SOURCES: EXTERNAL SOURCES:
contacts_service:
:path: ".symlinks/plugins/contacts_service/ios"
device_info_plus: device_info_plus:
:path: ".symlinks/plugins/device_info_plus/ios" :path: ".symlinks/plugins/device_info_plus/ios"
firebase_auth: firebase_auth:
@@ -225,10 +233,12 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/image_picker_ios/ios" :path: ".symlinks/plugins/image_picker_ios/ios"
path_provider_foundation: path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin" :path: ".symlinks/plugins/path_provider_foundation/darwin"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
share: share:
:path: ".symlinks/plugins/share/ios" :path: ".symlinks/plugins/share/ios"
sqflite: sqflite_darwin:
:path: ".symlinks/plugins/sqflite/darwin" :path: ".symlinks/plugins/sqflite_darwin/darwin"
url_launcher_ios: url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios" :path: ".symlinks/plugins/url_launcher_ios/ios"
vibration: vibration:
@@ -236,44 +246,46 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa
device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d contacts_service: 849e1f84281804c8bfbec1b4c3eedcb23c5d3eca
Firebase: 9f574c08c2396885b5e7e100ed4293d956218af9 device_info_plus: bf2e3232933866d73fe290f2942f2156cdd10342
firebase_auth: 16ac5db3d064db837ecd845080d7e18e4be7c66d Firebase: d80354ed7f6df5f9aca55e9eb47cc4b634735eaf
firebase_core: ceec591a66629daaee82d3321551692c4a871493 firebase_auth: 3d848b9b866b201e5c8e0c06d8b2cec272fd8825
firebase_messaging: 15d8b557010f3bb7b98d0302e1c7c8fbcd244425 firebase_core: ac395f994af4e28f6a38b59e05a88ca57abeb874
FirebaseAppCheckInterop: ea21450529cf0ebd132788dd8916a0269abc684f firebase_messaging: 7e223f4ee7ca053bf4ce43748e84a6d774ec9728
FirebaseAuth: d5cf28be74d7e82257f6a3f717509eff70d3cf4a FirebaseAppCheckInterop: 9226f7217b43e99dfa0bc9f674ad8108cef89feb
FirebaseAuthInterop: 47c09558af5d1b31f16fb352387c72d4804f4a24 FirebaseAuth: ad59a1a7b161e75f74c39f70179d2482d40e2737
FirebaseCore: 3cf438f431f18c12cdf2aaf64434648b63f7e383 FirebaseAuthInterop: 2a26ee1bea6d47df8048683cfa071e7da657798f
FirebaseCoreExtension: cda74ddfb001224bd8fd1d6e74698b4ed07803de FirebaseCore: 99fe0c4b44a39f37d99e6404e02009d2db5d718d
FirebaseCoreInternal: 0c569513412da9f3b31bd0b340013bbee8f295c5 FirebaseCoreExtension: 3d3f2017a00d06e09ab4ebe065391b0bb642565e
FirebaseInstallations: 771177d89d6c451dc6e50085ec82e2fc77ed0a4a FirebaseCoreInternal: df24ce5af28864660ecbd13596fc8dd3a8c34629
FirebaseMessaging: d2d1d9c62c46dd2db49a952f7deb5b16ad2c9742 FirebaseInstallations: 6c963bd2a86aca0481eef4f48f5a4df783ae5917
FirebaseMessaging: 487b634ccdf6f7b7ff180fdcb2a9935490f764e8
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_image_compress_common: ec1d45c362c9d30a3f6a0426c297f47c52007e3e flutter_image_compress_common: ec1d45c362c9d30a3f6a0426c297f47c52007e3e
flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12 flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
google_sign_in_ios: 07375bfbf2620bc93a602c0e27160d6afc6ead38 google_sign_in_ios: 4111e87aa5e24a4404f00ea13479f35e571969cc
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7 GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleSignIn: d4281ab6cf21542b1cfaff85c191f230b399d2db GoogleSignIn: d4281ab6cf21542b1cfaff85c191f230b399d2db
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de
GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6
image_cropper: 37d40f62177c101ff4c164906d259ea2c3aa70cf image_cropper: e0bb0042e4404ff2ef134e5cf0492cbd892156cd
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1 image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009 libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009
Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275 nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21 RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21
SDWebImage: 8a6b7b160b4d710e2a22b6900e25301075c34cb3 SDWebImage: 8a6b7b160b4d710e2a22b6900e25301075c34cb3
SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380 SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380
share: 0b2c3e82132f5888bccca3351c504d0003b3b410 share: 0b2c3e82132f5888bccca3351c504d0003b3b410
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654 TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
vibration: 7d883d141656a1c1a6d8d238616b2042a51a1241 vibration: 3797858f8cbf53d841e189ef8bd533d96e4ca93c
PODFILE CHECKSUM: 1959d098c91d8a792531a723c4a9d7e9f6a01e38 PODFILE CHECKSUM: 1959d098c91d8a792531a723c4a9d7e9f6a01e38
COCOAPODS: 1.15.2 COCOAPODS: 1.16.2

View File

@@ -161,7 +161,6 @@
3B75F912CE561168513C16DB /* Pods-RunnerTests.release.xcconfig */, 3B75F912CE561168513C16DB /* Pods-RunnerTests.release.xcconfig */,
8ED99976D90689BACE52971F /* Pods-RunnerTests.profile.xcconfig */, 8ED99976D90689BACE52971F /* Pods-RunnerTests.profile.xcconfig */,
); );
name = Pods;
path = Pods; path = Pods;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
@@ -492,10 +491,12 @@
DEVELOPMENT_TEAM = 63CVT8G5P8; DEVELOPMENT_TEAM = 63CVT8G5P8;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Tripz service";
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1;
PRODUCT_BUNDLE_IDENTIFIER = com.example.service; PRODUCT_BUNDLE_IDENTIFIER = com.example.service;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -675,10 +676,12 @@
DEVELOPMENT_TEAM = 63CVT8G5P8; DEVELOPMENT_TEAM = 63CVT8G5P8;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Tripz service";
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1;
PRODUCT_BUNDLE_IDENTIFIER = com.example.service; PRODUCT_BUNDLE_IDENTIFIER = com.example.service;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -698,10 +701,12 @@
DEVELOPMENT_TEAM = 63CVT8G5P8; DEVELOPMENT_TEAM = 63CVT8G5P8;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "Tripz service";
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1;
PRODUCT_BUNDLE_IDENTIFIER = com.example.service; PRODUCT_BUNDLE_IDENTIFIER = com.example.service;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";

View File

@@ -15,6 +15,12 @@ class AK {
static final String anthropicAIkeySeferNewHamzaayedpython = static final String anthropicAIkeySeferNewHamzaayedpython =
X.r(X.r(X.r(Env.anthropicAIkeySeferNewHamzaayedpython, cn), cC), cs); X.r(X.r(X.r(Env.anthropicAIkeySeferNewHamzaayedpython, cn), cC), cs);
static final String emailService = (Env.emailService); static final String emailService = (Env.emailService);
static final String allowed = Env.allowed;
static final String passnpassenger = X
.r(X.r(X.r(Env.passnpassenger, cn), cC), cs)
.toString()
.split(Env.addd)[0];
static final String newId = Env.newId;
/////////// ///////////
static final String keyOfApp = X.r(X.r(X.r(Env.keyOfApp, cn), cC), cs); static final String keyOfApp = X.r(X.r(X.r(Env.keyOfApp, cn), cC), cs);

View File

@@ -2,7 +2,13 @@ class BoxName {
static const String driverID = "driverID"; static const String driverID = "driverID";
static const String countryCode = "countryCode"; static const String countryCode = "countryCode";
static const String googlaMapApp = "googlaMapApp"; static const String googlaMapApp = "googlaMapApp";
static const String keyOfApp = 'keyOfApp';
static const String initializationVector = 'initializationVector';
static const String firstTimeLoadKey = 'firstTimeLoadKey';
static const String jwt = "jwt";
static const String fingerPrint = "fingerPrint";
static const String payMobApikey = "payMobApikey";
static const String refreshToken = "refreshToken";
static const String tokenParent = "tokenParent"; static const String tokenParent = "tokenParent";
static const String lang = "lang"; static const String lang = "lang";
static const String gender = "gender"; static const String gender = "gender";
@@ -77,3 +83,11 @@ class BoxName {
static const String tripData = 'tripData'; static const String tripData = 'tripData';
static const String parentTripSelected = 'parentTripSelected'; static const String parentTripSelected = 'parentTripSelected';
} }
class Service {
static const String driverPass = 'MG6DEJZSczBT6Rx0jOlehQ==';
static const String payMobApikey = 'payMobApikey';
static const String initializationVector = 'initializationVector';
static const String keyOfApp = 'keyOfApp';
static const String FCM_PRIVATE_KEY = 'FCM_PRIVATE_KEY';
}

View File

@@ -8,6 +8,7 @@ class AppInformation {
static const String email = 'hamzaayed@mobile-app.store'; static const String email = 'hamzaayed@mobile-app.store';
static const String complaintPrompt = 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'; '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 addd = 'BlBlNl';
static const String privacyPolicy = ''' static const String privacyPolicy = '''

View File

@@ -10,9 +10,12 @@ class AppLink {
static final String seferCairoServer = Env.seferCairoServer; static final String seferCairoServer = Env.seferCairoServer;
static final String seferGizaServer = Env.seferGizaServer; static final String seferGizaServer = Env.seferGizaServer;
// static final String server = Env.serverPHP; // static final String server = Env.serverPHP;
static String getBestDriver = "$server/Admin/driver/getBestDriver.php";
static const String server = 'https://server.sefer.live/sefer.click/sefer';
static const String jwtService = '$server/jwtService.php';
static final String endPoint = box.read(BoxName.serverChosen); static final String endPoint = box.read(BoxName.serverChosen);
static final String server = Env.seferCairoServer; // static final String server = Env.seferCairoServer;
// static const String server = "https://sefer.click/sefer/sefer"; // static const String server = "https://sefer.click/sefer/sefer";
static String googleMapsLink = 'https://maps.googleapis.com/maps/api/'; static String googleMapsLink = 'https://maps.googleapis.com/maps/api/';
static String llama = 'https://api.llama-api.com/chat/completions'; static String llama = 'https://api.llama-api.com/chat/completions';
@@ -55,8 +58,14 @@ class AppLink {
static String addNotesDriver = "$serviceApp/addNotesDriver.php"; static String addNotesDriver = "$serviceApp/addNotesDriver.php";
static String getCarPlateNotEdit = "$serviceApp/getCarPlateNotEdit.php"; static String getCarPlateNotEdit = "$serviceApp/getCarPlateNotEdit.php";
static String getdriverWithoutCar = "$serviceApp/getdriverWithoutCar.php"; static String getdriverWithoutCar = "$serviceApp/getdriverWithoutCar.php";
static String getBestDriverGiza =
"https://gizasefer.online/sefer/Admin/driver/getBestDriver.php";
static String getBestDriverAlexandria =
"$seferAlexandriaServer/Admin/driver/getBestDriver.php";
static String addNotesPassenger = "$serviceApp/addNotesPassenger.php"; static String addNotesPassenger = "$serviceApp/addNotesPassenger.php";
static String editCarPlate = "$serviceApp/editCarPlate.php"; static String editCarPlate = "$serviceApp/editCarPlate.php";
static String addDriverWantWork = "$serviceApp/work/addDriverWantWork.php";
static String addCarWantWork = "$serviceApp/work/addCarWantWork.php";
static String getComplaintAllData = "$serviceApp/getComplaintAllData.php"; static String getComplaintAllData = "$serviceApp/getComplaintAllData.php";
static String getComplaintAllDataForDriver = static String getComplaintAllDataForDriver =
"$serviceApp/getComplaintAllDataForDriver.php"; "$serviceApp/getComplaintAllDataForDriver.php";

View File

@@ -1,30 +1,39 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import '../main.dart'; import '../main.dart';
import 'box_name.dart'; import 'box_name.dart';
import 'colors.dart'; import 'colors.dart';
class AppStyle { class AppStyle {
static TextStyle headTitle = const TextStyle( static TextStyle headTitle = TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 40, fontSize: 36,
color: AppColor.accentColor, color: AppColor.accentColor,
); fontFamily: box.read(BoxName.lang) == 'ar'
static TextStyle headTitle2 = const TextStyle( // ?GoogleFonts.markaziText().fontFamily
fontWeight: FontWeight.bold, ? GoogleFonts.markaziText().fontFamily
fontSize: 26, : GoogleFonts.inter().fontFamily);
color: AppColor.writeColor, static TextStyle headTitle2 = TextStyle(
); fontWeight: FontWeight.bold,
fontSize: 24,
color: AppColor.writeColor,
fontFamily: box.read(BoxName.lang) == 'ar'
? GoogleFonts.markaziText().fontFamily
: GoogleFonts.inter().fontFamily);
static TextStyle title = TextStyle( static TextStyle title = TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.normal,
fontSize: box.read(BoxName.lang) == 'ar' ? 14 : 16, fontSize: 16,
color: AppColor.writeColor, color: AppColor.writeColor,
); fontFamily: box.read(BoxName.lang) == 'ar'
static TextStyle subtitle = const TextStyle( ? GoogleFonts.markaziText().fontFamily
fontWeight: FontWeight.bold, : GoogleFonts.inter().fontFamily);
fontSize: 13, static TextStyle subtitle = TextStyle(
color: AppColor.writeColor, fontWeight: FontWeight.bold,
); fontSize: 12,
color: AppColor.writeColor,
fontFamily: box.read(BoxName.lang) == 'ar'
? GoogleFonts.markaziText().fontFamily
: GoogleFonts.inter().fontFamily);
static TextStyle number = const TextStyle( static TextStyle number = const TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 14,

View File

@@ -0,0 +1,71 @@
import 'dart:convert';
import 'package:get/get.dart';
import '../../constant/colors.dart';
import '../../constant/links.dart';
import '../print.dart';
import 'functions/crud.dart';
class Driverthebest extends GetxController {
bool isLoading = false;
List driver = [];
getBestDriver() async {
var res = await CRUD().get(link: AppLink.getBestDriver, payload: {});
if (res != 'failure') {
driver = jsonDecode(res)['message'];
// Log.print('driver: ${driver}');
update();
} else {
Get.snackbar('error', '', backgroundColor: AppColor.redColor);
}
}
@override
void onInit() {
getBestDriver();
super.onInit();
}
}
class DriverTheBestGizaController extends GetxController {
bool isLoading = false;
List driver = [];
getBestDriver() async {
var res = await CRUD().get(link: AppLink.getBestDriverGiza, payload: {});
if (res != 'failure') {
driver = jsonDecode(res)['message'];
update();
} else {
Get.snackbar('error', '', backgroundColor: AppColor.redColor);
}
}
@override
void onInit() {
getBestDriver();
super.onInit();
}
}
class DriverTheBestAlexandriaController extends GetxController {
bool isLoading = false;
List driver = [];
getBestDriver() async {
var res =
await CRUD().get(link: AppLink.getBestDriverAlexandria, payload: {});
if (res != 'failure') {
driver = jsonDecode(res)['message'];
update();
} else {
Get.snackbar('error', '', backgroundColor: AppColor.redColor);
}
}
@override
void onInit() {
getBestDriver();
super.onInit();
}
}

View File

@@ -1,14 +1,52 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:jwt_decoder/jwt_decoder.dart';
import 'package:secure_string_operations/secure_string_operations.dart';
import 'package:service/constant/char_map.dart';
import '../../constant/api_key.dart'; import '../../constant/api_key.dart';
import '../../constant/box_name.dart'; import '../../constant/box_name.dart';
import '../../constant/info.dart';
import '../../constant/links.dart'; import '../../constant/links.dart';
import '../../main.dart'; import '../../main.dart';
import '../../print.dart'; import '../../print.dart';
import 'encrypt_decrypt.dart';
import 'initilize.dart';
class CRUD { class CRUD {
var dev;
getJWT() async {
var dev = Platform.isAndroid ? 'android' : 'ios';
var payload = {
'password': AK.passnpassenger,
// 'email': box.read(BoxName.email),
'aud': '${AK.allowed}$dev',
};
// if (box.read(BoxName.firstTimeLoadKey).toString() != 'false') {
var response0 = await http.post(
Uri.parse(AppLink.jwtService),
body: payload,
);
if (response0.statusCode == 200) {
final decodedResponse1 = jsonDecode(response0.body);
final jwt = decodedResponse1['jwt'];
box.write(BoxName.jwt, X.c(X.c(X.c(jwt, cn), cC), cs));
await AppInitializer().getAIKey(Service.keyOfApp);
await AppInitializer().getAIKey(Service.initializationVector);
await Future.delayed(Duration.zero);
await EncryptionHelper.initialize();
await AppInitializer().getAIKey(Service.FCM_PRIVATE_KEY);
box.write(BoxName.firstTimeLoadKey, 'false');
// await AppInitializer().getKey();
} else {}
}
Future<dynamic> get({ Future<dynamic> get({
required String link, required String link,
Map<String, dynamic>? payload, Map<String, dynamic>? payload,
@@ -16,18 +54,24 @@ class CRUD {
var url = Uri.parse( var url = Uri.parse(
link, link,
); );
bool isTokenExpired = JwtDecoder.isExpired(X
.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs)
.toString()
.split(AppInformation.addd)[0]);
if (isTokenExpired) {
await getJWT();
}
var response = await http.post( var response = await http.post(
url, url,
body: payload, body: payload,
headers: { headers: {
"Content-Type": "application/x-www-form-urlencoded", "Content-Type": "application/x-www-form-urlencoded",
'Authorization': 'Authorization':
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials.toString()))}', 'Bearer ${X.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs).toString().split(AppInformation.addd)[0]}'
}, },
); );
Log.print('response: ${response.body}'); print(response.body);
Log.print('response: ${response.request}');
Log.print('payload: $payload');
// if (response.statusCode == 200) { // if (response.statusCode == 200) {
var jsonData = jsonDecode(response.body); var jsonData = jsonDecode(response.body);
if (jsonData['status'] == 'success') { if (jsonData['status'] == 'success') {
@@ -49,18 +93,14 @@ class CRUD {
String imagePathFull = String imagePathFull =
'${AppLink.server}/card_image/$imagePath-$driverID.jpg'; '${AppLink.server}/card_image/$imagePath-$driverID.jpg';
Log.print('imagePathFull: $imagePathFull');
var request = http.Request( var request = http.Request(
'POST', 'POST',
Uri.parse( Uri.parse(
'https://eastus.api.cognitive.microsoft.com/computervision/imageanalysis:analyze?features=caption,read&model-version=latest&language=en&api-version=2024-02-01')); '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}); request.body = json.encode({"url": imagePathFull});
Log.print('request.body: ${request.body}');
request.headers.addAll(headers); request.headers.addAll(headers);
Log.print('request.headers: ${request.headers}');
http.StreamedResponse response = await request.send(); http.StreamedResponse response = await request.send();
Log.print('response: ${response}');
if (response.statusCode == 200) { if (response.statusCode == 200) {
return await response.stream.bytesToString(); return await response.stream.bytesToString();
@@ -131,27 +171,29 @@ class CRUD {
var url = Uri.parse( var url = Uri.parse(
link, link,
); );
bool isTokenExpired = JwtDecoder.isExpired(X
.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs)
.toString()
.split(AppInformation.addd)[0]);
if (isTokenExpired) {
await getJWT();
}
var response = await http.post( var response = await http.post(
url, url,
body: payload, body: payload,
headers: { headers: {
"Content-Type": "application/x-www-form-urlencoded", "Content-Type": "application/x-www-form-urlencoded",
'Authorization': 'Authorization':
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}', 'Bearer ${X.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs).toString().split(AppInformation.addd)[0]}'
}, },
); );
Log.print('payload: ${payload}');
Log.print('response.request: ${response.request}');
Log.print('response.body: ${response.body}');
Log.print('response.reasonPhrase: ${response.reasonPhrase}');
// print(response.statusCode);
var jsonData = jsonDecode(response.body); var jsonData = jsonDecode(response.body);
if (response.statusCode == 200) { if (response.statusCode == 200) {
if (jsonData['status'] == 'success') { if (jsonData['status'] == 'success') {
return response.body; return response.body;
} else { } else {
String errorMessage = jsonData['message']; String errorMessage = jsonData['message'];
Log.print('errorMessage: ${errorMessage}');
// Get.snackbar('Error'.tr, errorMessage.tr, // Get.snackbar('Error'.tr, errorMessage.tr,
// backgroundColor: AppColor.redColor); // backgroundColor: AppColor.redColor);
return (jsonData['status']); return (jsonData['status']);

View File

@@ -0,0 +1,68 @@
import 'package:encrypt/encrypt.dart' as encrypt;
import 'package:flutter/foundation.dart';
import '../../constant/box_name.dart';
import '../../main.dart';
class EncryptionHelper {
static EncryptionHelper? _instance;
late final encrypt.Key key;
late final encrypt.IV iv;
EncryptionHelper._(this.key, this.iv);
static EncryptionHelper get instance {
if (_instance == null) {
throw Exception(
"EncryptionHelper is not initialized. Call `await EncryptionHelper.initialize()` in main.");
}
return _instance!;
}
/// Initializes and stores the instance globally
static Future<void> initialize() async {
if (_instance != null) {
debugPrint("EncryptionHelper is already initialized.");
return; // Prevent re-initialization
}
debugPrint("Initializing EncryptionHelper...");
// Read stored keys
String? keyOfApp = await storage.read(key: BoxName.keyOfApp);
// Log.print('keyOfApp: ${keyOfApp}');
String? initializationVector =
await storage.read(key: BoxName.initializationVector);
// Log.print('initializationVector: ${initializationVector}');
// Set the global instance
_instance = EncryptionHelper._(
encrypt.Key.fromUtf8(keyOfApp!),
encrypt.IV.fromUtf8(initializationVector!),
);
debugPrint("EncryptionHelper initialized successfully.");
}
/// Encrypts a string
String encryptData(String plainText) {
try {
final encrypter =
encrypt.Encrypter(encrypt.AES(key, mode: encrypt.AESMode.cbc));
final encrypted = encrypter.encrypt(plainText, iv: iv);
return encrypted.base64;
} catch (e) {
debugPrint('Encryption Error: $e');
return '';
}
}
/// Decrypts a string
String decryptData(String encryptedText) {
try {
final encrypter =
encrypt.Encrypter(encrypt.AES(key, mode: encrypt.AESMode.cbc));
final encrypted = encrypt.Encrypted.fromBase64(encryptedText);
return encrypter.decrypt(encrypted, iv: iv);
} catch (e) {
debugPrint('Decryption Error: $e');
return '';
}
}
}

View File

@@ -0,0 +1,44 @@
import 'dart:convert';
import 'package:jwt_decoder/jwt_decoder.dart';
import 'package:secure_string_operations/secure_string_operations.dart';
import 'package:service/controller/functions/crud.dart';
import '../../constant/box_name.dart';
import '../../constant/char_map.dart';
import '../../constant/info.dart';
import '../../constant/links.dart';
import '../../env/env.dart';
import '../../main.dart';
import '../../print.dart';
class AppInitializer {
List<Map<String, dynamic>> links = [];
Future<void> initializeApp() async {
if (box.read(BoxName.jwt) == null) {
await CRUD().getJWT();
} else {
bool isTokenExpired = JwtDecoder.isExpired(X
.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs)
.toString()
.split(AppInformation.addd)[0]);
if (isTokenExpired) {
await CRUD().getJWT();
}
}
}
getAIKey(String key1) async {
if (box.read(BoxName.firstTimeLoadKey) == null) {
var res =
await CRUD().get(link: Env.getapiKey, payload: {"keyName": key1});
if (res != 'failure') {
var d = jsonDecode(res)['message'];
Log.print('d: ${d}');
await storage.write(key: key1, value: d[key1].toString());
await Future.delayed(Duration.zero);
} else {}
}
}
}

View File

@@ -0,0 +1,76 @@
import 'package:url_launcher/url_launcher.dart';
import 'dart:io';
void showInBrowser(String url) async {
if (await canLaunchUrl(Uri.parse(url))) {
launchUrl(Uri.parse(url));
} else {}
}
Future<void> makePhoneCall(String phoneNumber) async {
final Uri launchUri = Uri(
scheme: 'tel',
path: phoneNumber,
);
await launchUrl(launchUri);
}
void launchCommunication(
String method, String contactInfo, String message) async {
String url;
if (Platform.isIOS) {
switch (method) {
case 'phone':
url = 'tel:$contactInfo';
break;
case 'sms':
url = 'sms:$contactInfo?body=${Uri.encodeComponent(message)}';
break;
case 'whatsapp':
url =
'https://api.whatsapp.com/send?phone=$contactInfo&text=${Uri.encodeComponent(message)}';
break;
case 'email':
url =
'mailto:$contactInfo?subject=Subject&body=${Uri.encodeComponent(message)}';
break;
default:
return;
}
} else if (Platform.isAndroid) {
switch (method) {
case 'phone':
url = 'tel:$contactInfo';
break;
case 'sms':
url = 'sms:$contactInfo?body=${Uri.encodeComponent(message)}';
break;
case 'whatsapp':
// Check if WhatsApp is installed
final bool whatsappInstalled =
await canLaunchUrl(Uri.parse('whatsapp://'));
if (whatsappInstalled) {
url =
'whatsapp://send?phone=$contactInfo&text=${Uri.encodeComponent(message)}';
} else {
// Provide an alternative action, such as opening the WhatsApp Web API
url =
'https://api.whatsapp.com/send?phone=$contactInfo&text=${Uri.encodeComponent(message)}';
}
break;
case 'email':
url =
'mailto:$contactInfo?subject=Subject&body=${Uri.encodeComponent(message)}';
break;
default:
return;
}
} else {
return;
}
if (await canLaunchUrl(Uri.parse(url))) {
await launchUrl(Uri.parse(url));
} else {}
}

View File

@@ -8,149 +8,95 @@ import '../themes/themes.dart';
class LocaleController extends GetxController { class LocaleController extends GetxController {
Locale? language; Locale? language;
String countryCode = ''; String countryCode = '';
void restartApp() {
runApp(MyApp());
}
ThemeData appTheme = themeEnglish; ThemeData appTheme = lightThemeEnglish;
changeLang(String langcode) { void changeLang(String langcode) {
Locale locale; Locale locale;
switch (langcode) { switch (langcode) {
case "ar": case "ar":
locale = const Locale("ar"); locale = const Locale("ar");
appTheme = themeArabic; appTheme = lightThemeArabic;
box.write(BoxName.lang, 'ar'); box.write(BoxName.lang, 'ar');
break; break;
case "en": case "en":
locale = const Locale("en"); locale = const Locale("en");
appTheme = themeEnglish; appTheme = lightThemeEnglish;
box.write(BoxName.lang, 'en'); box.write(BoxName.lang, 'en');
break; break;
case "tr": case "tr":
locale = const Locale("tr"); locale = const Locale("tr");
appTheme = themeEnglish; appTheme = lightThemeEnglish;
box.write(BoxName.lang, 'tr'); box.write(BoxName.lang, 'tr');
break; break;
case "fr": case "fr":
locale = const Locale("fr"); locale = const Locale("fr");
appTheme = themeEnglish; appTheme = lightThemeEnglish;
box.write(BoxName.lang, 'fr'); box.write(BoxName.lang, 'fr');
break; break;
case "it": case "it":
locale = const Locale("it"); locale = const Locale("it");
appTheme = themeEnglish; appTheme = lightThemeEnglish;
box.write(BoxName.lang, 'it'); box.write(BoxName.lang, 'it');
break; break;
case "de": case "de":
locale = const Locale("de"); locale = const Locale("de");
appTheme = themeEnglish; appTheme = lightThemeEnglish;
box.write(BoxName.lang, 'de'); box.write(BoxName.lang, 'de');
break; break;
case "el": case "el":
locale = const Locale("el"); locale = const Locale("el");
appTheme = themeEnglish; appTheme = lightThemeEnglish;
box.write(BoxName.lang, 'el'); box.write(BoxName.lang, 'el');
break; break;
case "es": case "es":
locale = const Locale("es"); locale = const Locale("es");
appTheme = themeEnglish; appTheme = lightThemeEnglish;
box.write(BoxName.lang, 'es'); box.write(BoxName.lang, 'es');
break; break;
case "fa": case "fa":
locale = const Locale("fa"); locale = const Locale("fa");
appTheme = themeEnglish; appTheme = lightThemeEnglish;
box.write(BoxName.lang, 'fa'); box.write(BoxName.lang, 'fa');
break; break;
case "zh": case "zh":
locale = const Locale("zh"); locale = const Locale("zh");
appTheme = themeEnglish; appTheme = lightThemeEnglish;
box.write(BoxName.lang, 'zh'); box.write(BoxName.lang, 'zh');
break; break;
case "ru": case "ru":
locale = const Locale("ru"); locale = const Locale("ru");
appTheme = themeEnglish; appTheme = lightThemeEnglish;
box.write(BoxName.lang, 'ru'); box.write(BoxName.lang, 'ru');
break; break;
case "hi": case "hi":
locale = const Locale("hi"); locale = const Locale("hi");
appTheme = themeEnglish; appTheme = lightThemeEnglish;
box.write(BoxName.lang, 'hi'); box.write(BoxName.lang, 'hi');
break; break;
default: default:
locale = Locale(Get.deviceLocale!.languageCode); locale = Locale(Get.deviceLocale!.languageCode);
box.write(BoxName.lang, Get.deviceLocale!.languageCode); box.write(BoxName.lang, Get.deviceLocale!.languageCode);
appTheme = themeEnglish; appTheme = lightThemeEnglish;
break; break;
} }
box.write(BoxName.lang, langcode); box.write(BoxName.lang, langcode);
// box.write(BoxName.lang, langcode);
Get.changeTheme(appTheme); Get.changeTheme(appTheme);
Get.updateLocale(locale); Get.updateLocale(locale);
restartApp();
update(); update();
} }
@override @override
void onInit() { void onInit() {
String storedLang = box.read(BoxName.lang) ?? ""; String? storedLang = box.read(BoxName.lang);
switch (storedLang) { if (storedLang == null) {
case "ar": // Use device language if no language is stored
language = const Locale("ar"); storedLang = Get.deviceLocale!.languageCode;
appTheme = themeArabic; box.write(BoxName.lang, storedLang);
break;
case "en":
language = const Locale("en");
appTheme = themeEnglish;
break;
case "tr":
language = const Locale("tr");
appTheme = themeEnglish;
break;
case "fr":
language = const Locale("fr");
appTheme = themeEnglish;
break;
case "it":
language = const Locale("it");
appTheme = themeEnglish;
break;
case "de":
language = const Locale("de");
appTheme = themeEnglish;
break;
case "el":
language = const Locale("el");
appTheme = themeEnglish;
break;
case "es":
language = const Locale("es");
appTheme = themeEnglish;
break;
case "fa":
language = const Locale("fa");
appTheme = themeArabic;
break;
case "zh":
language = const Locale("zh");
appTheme = themeEnglish;
break;
case "ru":
language = const Locale("ru");
appTheme = themeEnglish;
break;
case "hi":
language = const Locale("hi");
appTheme = themeEnglish;
break;
default:
language = Locale(Get.deviceLocale!.languageCode);
// language = Locale(Get.deviceLocale!.languageCode);
appTheme = themeEnglish;
break;
} }
changeLang(storedLang);
super.onInit(); super.onInit();
} }
} }

View File

@@ -12,8 +12,25 @@ class MyTranslation extends Translations {
"yellow": "أصفر", "yellow": "أصفر",
"purple": "أرجواني", "purple": "أرجواني",
"orange": "برتقالي", "orange": "برتقالي",
"pink": "وردي", "pink": "وردي", "best driver": "أفضل سائق",
"brown": "بني", "brown": "بني",
'Insert site of Owner': "أدخل موقع المالك",
'Insert site of Driver': "أدخل موقع السائق",
'Insert registration_date of Car': "أدخل تاريخ تسجيل السيارة",
'Insert phone of Owner': "أدخل هاتف المالك",
'Insert Name of Owner': "أدخل اسم المالك",
'Insert year of Car': "أدخل سنة السيارة",
'Insert registration_date of Driver': "",
'Insert car_type of Driver': "أدخل نوع السيارة للسائق",
'Insert car_model of Driver': "أدخل طراز السيارة للسائق",
'Insert car_number of Driver': "أدخل رقم سيارة السائق",
"Add Car Who Wants to Work": "أضف السيارة التي ترغب في العمل",
"Add Driver Who Wants to Work": "إضافة سائق يرغب في العمل",
"Insert Name of Driver": "أدخل اسم السائق",
'Insert national ID of Driver': "أدخل الرقم الوطني للسائق",
'Insert phone of Driver': "أدخل رقم هاتف السائق",
"Insert license type of Driver": "أدخل نوع رخصة السائق",
'Insert birth_date of Driver': "أدخل تاريخ ميلاد السائق",
"gray": "رمادي", "gray": "رمادي",
"cyan": "سماوي", "cyan": "سماوي",
"magenta": "بنفسجي", "magenta": "بنفسجي",

View File

@@ -19,14 +19,15 @@ class LoginController extends GetxController {
void login() async { void login() async {
String? storedEmail = await storage.read(key: 'email'); String? storedEmail = await storage.read(key: 'email');
String? storedPassword = await storage.read(key: 'password');
if (storedEmail != null) { if (storedEmail != null) {
Get.off(() => Main()); Get.off(() => Main());
} else { } else {
if (formKey.currentState!.validate()) { if (formKey.currentState!.validate()) {
var res = await CRUD().get(link: AppLink.login, payload: { var res = await CRUD().get(link: AppLink.login, payload: {
"email": email.text, "email": storedEmail ?? email.text,
"password": password.text, "password": storedPassword ?? password.text,
}); });
if (res != 'failure') { if (res != 'failure') {
@@ -36,6 +37,7 @@ class LoginController extends GetxController {
await storage.write(key: 'email', value: d['data']['email']); await storage.write(key: 'email', value: d['data']['email']);
await storage.write(key: 'name', value: d['data']['first_name']); await storage.write(key: 'name', value: d['data']['first_name']);
await storage.write(key: 'driverID', value: d['data']['id']); await storage.write(key: 'driverID', value: d['data']['id']);
await storage.write(key: 'password', value: password.text);
Get.off(() => Main()); Get.off(() => Main());
} }

View File

@@ -3,10 +3,12 @@ import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:service/constant/box_name.dart';
import 'package:service/constant/colors.dart'; import 'package:service/constant/colors.dart';
import 'package:service/constant/links.dart'; import 'package:service/constant/links.dart';
import 'package:service/controller/functions/crud.dart'; import 'package:service/controller/functions/crud.dart';
import 'package:service/controller/mainController/pages/driver_page.dart'; import 'package:service/controller/mainController/pages/driver_page.dart';
import 'package:service/main.dart';
import 'package:service/views/widgets/my_dialog.dart'; import 'package:service/views/widgets/my_dialog.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
@@ -26,6 +28,20 @@ class MainController extends GetxController {
TextEditingController expirationDateController = TextEditingController(); TextEditingController expirationDateController = TextEditingController();
TextEditingController yearController = TextEditingController(); TextEditingController yearController = TextEditingController();
TextEditingController ownerController = TextEditingController(); TextEditingController ownerController = TextEditingController();
TextEditingController carOwnerWorkController = TextEditingController();
TextEditingController driverNameController = TextEditingController();
TextEditingController nationalIdController = TextEditingController();
TextEditingController birthDateController = TextEditingController();
TextEditingController licenseTypeController = TextEditingController();
TextEditingController phoneController = TextEditingController();
TextEditingController phoneCarController = TextEditingController();
TextEditingController carNumberController = TextEditingController();
TextEditingController manufactureYearController = TextEditingController();
TextEditingController carModelController = TextEditingController();
TextEditingController carTypeController = TextEditingController();
TextEditingController siteCarController = TextEditingController();
TextEditingController siteDriverController = TextEditingController();
TextEditingController registrationDateController = TextEditingController();
Map passengerData = {}; Map passengerData = {};
Map driverData = {}; Map driverData = {};
List filteredDrivers = []; List filteredDrivers = [];
@@ -308,6 +324,7 @@ class MainController extends GetxController {
"model": model, "model": model,
"expiration_date": expirationDate.toString(), "expiration_date": expirationDate.toString(),
"owner": owner, "owner": owner,
"employee": storage.read(key: 'name').toString(),
}); });
Log.print('res: ${res}'); Log.print('res: ${res}');
if (res != 'failure') { if (res != 'failure') {

View File

@@ -3,14 +3,14 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:service/constant/style.dart'; import 'package:service/constant/style.dart';
import 'package:service/controller/mainController/pages/edit_car.dart'; import 'package:service/controller/functions/launch.dart';
import 'package:service/views/widgets/my_scafold.dart'; import 'package:service/views/widgets/my_scafold.dart';
import '../../../constant/colors.dart'; import '../../../constant/colors.dart';
import '../../../constant/links.dart'; import '../../../constant/links.dart';
import '../../../print.dart';
import '../../../views/widgets/my_textField.dart'; import '../../../views/widgets/my_textField.dart';
import '../../functions/crud.dart'; import '../../functions/encrypt_decrypt.dart';
import '../../functions/image.dart';
import '../main_controller.dart'; import '../main_controller.dart';
class AddCar extends StatelessWidget { class AddCar extends StatelessWidget {
@@ -40,7 +40,8 @@ class AddCar extends StatelessWidget {
}, },
child: Container( child: Container(
decoration: AppStyle.boxDecoration1, decoration: AppStyle.boxDecoration1,
child: Text(carData['name_arabic'])), child: Text(EncryptionHelper.instance
.decryptData(carData['name_arabic']))),
), ),
); );
}), }),
@@ -59,126 +60,149 @@ class AddCarForm extends StatelessWidget {
Get.put(MainController()); Get.put(MainController());
return GetBuilder<MainController>(builder: (mainController) { return GetBuilder<MainController>(builder: (mainController) {
return MyScaffold(title: 'Add Car', isleading: true, body: [ return MyScaffold(
ListView( title: 'Add Car',
children: [ action: Row(
Column( children: [
IconButton(
onPressed: () {
makePhoneCall(carData['phone']);
},
icon: const Icon(Icons.phone),
),
IconButton(
onPressed: () {
launchCommunication('whatsapp', carData['phone'], '');
},
icon: const Icon(
Icons.message,
color: AppColor.greenColor,
),
),
],
),
isleading: true,
body: [
ListView(
children: [ children: [
Image.network( Column(
'https://sefer.click/sefer/card_image/car_front-${carData['id']}.jpg', children: [
height: 200, GestureDetector(
width: double.maxFinite, onLongPress: () async {
fit: BoxFit.fill, await ImageController().choosImage(
), AppLink.uploadEgypt, carData['id'], 'car_front');
Image.network( },
'https://sefer.click/sefer/card_image/car_back-${carData['id']}.jpg', child: Image.network(
height: 200, 'https://sefer.click/sefer/card_image/car_front-${carData['id']}.jpg',
width: double.maxFinite, height: 200,
fit: BoxFit.fill, width: double.maxFinite,
), fit: BoxFit.fill,
], errorBuilder: (BuildContext context, Object exception,
), StackTrace? stackTrace) {
const SizedBox(height: 9), // If the image fails to load, use the _copy version
Form( return Image.network(
key: mainController.formKey, 'https://sefer.click/sefer/card_image/car_front-${carData['id']}_copy.jpg',
child: Column( height: 200,
children: [ width: double.maxFinite,
Row( fit: BoxFit.fill,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, );
children: [
SizedBox(
width: Get.width * .6,
child: MyTextForm(
controller: mainController.carplateController,
label: 'car plate'.tr,
hint: 'car plate'.tr,
type: TextInputType.name,
),
),
IconButton(
onPressed: () async {
if (mainController.formKey.currentState!.validate()) {
await mainController
.addRegistrationCarEgyptHandling(
driverId: carData['id'].toString(),
carPlate: mainController.carplateController.text,
color: mainController.colorController.text,
colorHex:
mainController.colorHex.value.toString(),
year: mainController.yearController.text,
make: mainController.makeController.text,
model: mainController.modelController.text,
expirationDate:
mainController.expirationDateController.text,
owner: mainController.ownerController.text,
);
}
}, },
icon: const Icon(
Icons.upload_outlined,
color: AppColor.blueColor,
),
), ),
], ),
), GestureDetector(
// Other fields onLongPress: () async {
await ImageController().choosImage(
Row( AppLink.uploadEgypt, carData['id'], 'car_back');
mainAxisAlignment: MainAxisAlignment.spaceBetween, },
child: Image.network(
'https://sefer.click/sefer/card_image/car_back-${carData['id']}.jpg',
height: 200,
width: double.maxFinite,
fit: BoxFit.fill,
errorBuilder: (BuildContext context, Object exception,
StackTrace? stackTrace) {
// If the image fails to load, use the _copy version
return Image.network(
'https://sefer.click/sefer/card_image/car_back-${carData['id']}_copy.jpg',
height: 200,
width: double.maxFinite,
fit: BoxFit.fill,
);
},
),
),
],
),
const SizedBox(height: 9),
Form(
key: mainController.formKey,
child: Column(
children: [ children: [
SizedBox( Row(
width: Get.width * .4, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
child: MyTextForm( children: [
controller: mainController.yearController, SizedBox(
label: 'Year'.tr, width: Get.width * .6,
hint: 'Year'.tr, child: MyTextForm(
type: TextInputType.number, controller: mainController.carplateController,
), label: 'car plate'.tr,
), hint: 'car plate'.tr,
SizedBox( type: TextInputType.name,
width: Get.width * .4, ),
child: DropdownButtonFormField<String>(
decoration: InputDecoration(
labelText: 'Color'.tr, // Localized label
), ),
value: mainController.colorHex.value.isEmpty IconButton(
? null onPressed: () async {
: mainController.colorHex if (mainController.formKey.currentState!
.value, // Use the hex value as the current value .validate()) {
items: [ await mainController
{'red'.tr: '#FF0000'}, .addRegistrationCarEgyptHandling(
{'green'.tr: '#008000'}, driverId: carData['id'].toString(),
{'blue'.tr: '#0000FF'}, carPlate:
{'black'.tr: '#000000'}, mainController.carplateController.text,
{'white'.tr: '#FFFFFF'}, color: mainController.colorController.text,
{'yellow'.tr: '#FFFF00'}, colorHex:
{'purple'.tr: '#800080'}, mainController.colorHex.value.toString(),
{'orange'.tr: '#FFA500'}, year: mainController.yearController.text,
{'pink'.tr: '#FFC0CB'}, make: mainController.makeController.text,
{'brown'.tr: '#A52A2A'}, model: mainController.modelController.text,
{'gray'.tr: '#808080'}, expirationDate: mainController
{'cyan'.tr: '#00FFFF'}, .expirationDateController.text,
{'magenta'.tr: '#FF00FF'}, owner: mainController.ownerController.text,
{'lime'.tr: '#00FF00'}, );
{'indigo'.tr: '#4B0082'}, }
{'violet'.tr: '#EE82EE'}, },
{'gold'.tr: '#FFD700'}, icon: const Icon(
{'silver'.tr: '#C0C0C0'}, Icons.upload_outlined,
{'teal'.tr: '#008080'}, color: AppColor.blueColor,
{'navy'.tr: '#000080'}, ),
].map((colorMap) { ),
String colorName = colorMap.keys.first; ],
String colorValue = colorMap.values.first; ),
return DropdownMenuItem<String>( // Other fields
value: colorValue,
child: Text(colorName), Row(
); mainAxisAlignment: MainAxisAlignment.spaceBetween,
}).toList(), children: [
onChanged: (value) { SizedBox(
if (value != null) { width: Get.width * .4,
// Find the selected color name based on the hex value child: MyTextForm(
String selectedColorName = ''; controller: mainController.yearController,
for (var colorMap in [ label: 'Year'.tr,
hint: 'Year'.tr,
type: TextInputType.number,
),
),
SizedBox(
width: Get.width * .4,
child: DropdownButtonFormField<String>(
decoration: InputDecoration(
labelText: 'Color'.tr, // Localized label
),
value: mainController.colorHex.value.isEmpty
? null
: mainController.colorHex
.value, // Use the hex value as the current value
items: [
{'red'.tr: '#FF0000'}, {'red'.tr: '#FF0000'},
{'green'.tr: '#008000'}, {'green'.tr: '#008000'},
{'blue'.tr: '#0000FF'}, {'blue'.tr: '#0000FF'},
@@ -199,120 +223,157 @@ class AddCarForm extends StatelessWidget {
{'silver'.tr: '#C0C0C0'}, {'silver'.tr: '#C0C0C0'},
{'teal'.tr: '#008080'}, {'teal'.tr: '#008080'},
{'navy'.tr: '#000080'}, {'navy'.tr: '#000080'},
]) { ].map((colorMap) {
if (colorMap.values.first == value) { String colorName = colorMap.keys.first;
selectedColorName = colorMap.keys.first; String colorValue = colorMap.values.first;
break; return DropdownMenuItem<String>(
value: colorValue,
child: Text(colorName),
);
}).toList(),
onChanged: (value) {
if (value != null) {
// Find the selected color name based on the hex value
String selectedColorName = '';
for (var colorMap in [
{'red'.tr: '#FF0000'},
{'green'.tr: '#008000'},
{'blue'.tr: '#0000FF'},
{'black'.tr: '#000000'},
{'white'.tr: '#FFFFFF'},
{'yellow'.tr: '#FFFF00'},
{'purple'.tr: '#800080'},
{'orange'.tr: '#FFA500'},
{'pink'.tr: '#FFC0CB'},
{'brown'.tr: '#A52A2A'},
{'gray'.tr: '#808080'},
{'cyan'.tr: '#00FFFF'},
{'magenta'.tr: '#FF00FF'},
{'lime'.tr: '#00FF00'},
{'indigo'.tr: '#4B0082'},
{'violet'.tr: '#EE82EE'},
{'gold'.tr: '#FFD700'},
{'silver'.tr: '#C0C0C0'},
{'teal'.tr: '#008080'},
{'navy'.tr: '#000080'},
]) {
if (colorMap.values.first == value) {
selectedColorName = colorMap.keys.first;
break;
}
}
mainController.colorController.text =
selectedColorName;
mainController.colorHex.value = value;
} }
} },
),
mainController.colorController.text =
selectedColorName;
mainController.colorHex.value = value;
}
},
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(
width: Get.width * .4,
child: MyTextForm(
controller: mainController.makeController,
label: 'Make'.tr,
hint: 'Make'.tr,
type: TextInputType.name,
),
),
SizedBox(
width: Get.width * .4,
child: MyTextForm(
controller: mainController.modelController,
label: 'Model'.tr,
hint: 'Model'.tr,
type: TextInputType.name,
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(
width: Get.width * .4,
child: TextField(
controller: mainController.expirationDateController,
decoration: InputDecoration(
labelText: 'Expiration Date'.tr,
hintText: 'Expiration Date'.tr,
), ),
readOnly: ],
true, // Make the field read-only to prevent manual input
onTap: () async {
DateTime pickedDate =
DateTime.now(); // Declare the variable here
await showCupertinoModalPopup<void>(
context: context,
builder: (context) => Container(
height: 250,
color: Colors.white,
child: Column(
children: [
SizedBox(
height: 150,
child: CupertinoDatePicker(
initialDateTime: pickedDate,
minimumDate: DateTime(
1955), // Set the starting date
maximumDate: DateTime(
2034), // Set the ending date
mode: CupertinoDatePickerMode.date,
onDateTimeChanged: (DateTime dateTime) {
pickedDate = dateTime;
},
),
),
CupertinoButton(
child: Text('Done'.tr),
onPressed: () {
String formattedDate =
DateFormat('yyyy-MM-dd')
.format(pickedDate);
mainController.expirationDateController
.text = formattedDate.toString();
Navigator.of(context).pop();
},
),
],
),
),
);
},
),
), ),
SizedBox(
width: Get.width * .4, Row(
child: MyTextForm( mainAxisAlignment: MainAxisAlignment.spaceBetween,
controller: mainController.ownerController, children: [
label: 'Owner'.tr, SizedBox(
hint: 'Owner'.tr, width: Get.width * .4,
type: TextInputType.name, child: MyTextForm(
), controller: mainController.makeController,
label: 'Make'.tr,
hint: 'Make'.tr,
type: TextInputType.name,
),
),
SizedBox(
width: Get.width * .4,
child: MyTextForm(
controller: mainController.modelController,
label: 'Model'.tr,
hint: 'Model'.tr,
type: TextInputType.name,
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(
width: Get.width * .4,
child: TextField(
controller:
mainController.expirationDateController,
decoration: InputDecoration(
labelText: 'Expiration Date'.tr,
hintText: 'Expiration Date'.tr,
),
readOnly:
true, // Make the field read-only to prevent manual input
onTap: () async {
DateTime pickedDate =
DateTime.now(); // Declare the variable here
await showCupertinoModalPopup<void>(
context: context,
builder: (context) => Container(
height: 250,
color: Colors.white,
child: Column(
children: [
SizedBox(
height: 150,
child: CupertinoDatePicker(
initialDateTime: pickedDate,
minimumDate: DateTime(
1955), // Set the starting date
maximumDate: DateTime(
2034), // Set the ending date
mode: CupertinoDatePickerMode.date,
onDateTimeChanged:
(DateTime dateTime) {
pickedDate = dateTime;
},
),
),
CupertinoButton(
child: Text('Done'.tr),
onPressed: () {
String formattedDate =
DateFormat('yyyy-MM-dd')
.format(pickedDate);
mainController
.expirationDateController
.text =
formattedDate.toString();
Navigator.of(context).pop();
},
),
],
),
),
);
},
),
),
SizedBox(
width: Get.width * .4,
child: MyTextForm(
controller: mainController.ownerController,
label: 'Owner'.tr,
hint: 'Owner'.tr,
type: TextInputType.name,
),
),
],
), ),
], ],
), ),
], )
), ],
) )
], ]);
)
]);
}); });
} }
} }

View File

@@ -0,0 +1,57 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:service/views/widgets/my_scafold.dart';
import '../../best_driver_controllers.dart';
import '../../functions/encrypt_decrypt.dart';
class DriverTheBestAlexandria extends StatelessWidget {
const DriverTheBestAlexandria({super.key});
@override
Widget build(BuildContext context) {
Get.put(DriverTheBestAlexandriaController(), permanent: true);
return MyScaffold(
title: 'Alexandria'.tr,
body: [
GetBuilder<DriverTheBestAlexandriaController>(builder: (driverthebest) {
return driverthebest.driver.isNotEmpty
? ListView.builder(
itemCount: driverthebest.driver.length,
itemBuilder: (context, index) {
final driver = driverthebest.driver[index];
return ListTile(
leading: CircleAvatar(
child: Text(
(int.parse(driver['driver_count'] * 5) / 3600)
.toStringAsFixed(0),
),
),
title: Text(EncryptionHelper.instance
.decryptData(driver['name_arabic']) ??
'Unknown Name'),
subtitle: Text(
'Phone: ${EncryptionHelper.instance.decryptData(driver['phone']) ?? 'N/A'}'),
trailing: IconButton(
onPressed: () async {
Get.defaultDialog(
title:
'are you sure to pay to this driver gift'.tr,
middleText: '',
onConfirm: () async {},
onCancel: () => Get.back());
},
icon: const Icon(Icons.wallet_giftcard_rounded),
),
);
},
)
: const Center(
child: Text('No drivers available.'),
);
})
],
isleading: true,
);
}
}

View File

@@ -0,0 +1,112 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:service/controller/functions/encrypt_decrypt.dart';
import 'package:service/views/widgets/my_scafold.dart';
import '../../../constant/colors.dart';
import '../../../constant/links.dart';
import '../../../views/widgets/elevated_btn.dart';
import '../../functions/crud.dart';
import 'alexandria_besr_driver.dart';
import 'giza_best_driver.dart';
class DriverTheBest extends StatelessWidget {
const DriverTheBest({super.key});
@override
Widget build(BuildContext context) {
Get.put(Driverthebest());
return MyScaffold(
title: 'Best Drivers'.tr,
body: [
Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
MyElevatedButton(
title: 'Giza',
onPressed: () {
Get.to(() => DriverTheBestGiza());
}),
MyElevatedButton(
title: 'Alexandria',
onPressed: () {
Get.to(() => DriverTheBestAlexandria());
}),
],
),
GetBuilder<Driverthebest>(builder: (driverthebest) {
return driverthebest.driver.isNotEmpty
? SizedBox(
height: Get.height * .7,
child: ListView.builder(
itemCount: driverthebest.driver.length,
itemBuilder: (context, index) {
final driver = driverthebest.driver[index];
return ListTile(
leading: CircleAvatar(
child: Text(
((int.parse(driver['driver_count']) * 5) / 3600)
.toStringAsFixed(0),
),
),
title: Text(EncryptionHelper.instance
.decryptData(driver['name_arabic']) ??
'Unknown Name'),
subtitle: Text(
'Phone: ${EncryptionHelper.instance.decryptData(driver['phone']) ?? 'N/A'}'),
trailing: IconButton(
onPressed: () async {
// Get.defaultDialog(
// title:
// 'are you sure to pay to this driver gift'.tr,
// middleText: '',
// onConfirm: () async {
// // final wallet = Get.put(WalletController());
// // await wallet.addPaymentToDriver('100',
// // driver['id'].toString(), driver['token']);
// // await wallet.addSeferWallet(
// // '100', driver['id'].toString());
// },
// onCancel: () => Get.back());
},
icon: const Icon(Icons.wallet_giftcard_rounded),
),
);
},
),
)
: const Center(
child: Text('No drivers available.'),
);
}),
],
)
],
isleading: true,
);
}
}
class Driverthebest extends GetxController {
bool isLoading = false;
List driver = [];
getBestDriver() async {
var res = await CRUD().get(link: AppLink.getBestDriver, payload: {});
if (res != 'failure') {
driver = jsonDecode(res)['message'];
update();
} else {
Get.snackbar('error', '', backgroundColor: AppColor.redColor);
}
}
@override
void onInit() {
getBestDriver();
super.onInit();
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -44,16 +44,16 @@ class DriverPage extends StatelessWidget {
return CupertinoListSection.insetGrouped( return CupertinoListSection.insetGrouped(
header: Text('Driver Information'.tr), header: Text('Driver Information'.tr),
children: [ children: [
_buildInfoRow('Name'.tr, data['name_arabic']), _buildInfoRow('Name'.tr, data['name_arabic'].toString()),
_buildInfoRow('Name (English)'.tr, data['name_english']), _buildInfoRow('Name (English)'.tr, data['name_english'].toString()),
_buildInfoRow('Phone'.tr, data['phone']), _buildInfoRow('Phone'.tr, data['phone'].toString()),
_buildInfoRow('Email'.tr, data['email']), _buildInfoRow('Email'.tr, data['email'].toString()),
_buildInfoRow('Gender'.tr, data['gender']), _buildInfoRow('Gender'.tr, data['gender'].toString()),
_buildInfoRow('Birthdate'.tr, data['birthdate']), _buildInfoRow('Birthdate'.tr, data['birthdate'].toString()),
_buildInfoRow('National Number'.tr, data['national_number']), _buildInfoRow('National Number'.tr, data['national_number'].toString()),
_buildInfoRow('Religion'.tr, data['religion']), _buildInfoRow('Religion'.tr, data['religion'].toString()),
_buildInfoRow('Occupation'.tr, data['occupation']), _buildInfoRow('Occupation'.tr, data['occupation'].toString()),
_buildInfoRow('Education'.tr, data['education']), _buildInfoRow('Education'.tr, data['education'].toString()),
], ],
); );
} }
@@ -80,16 +80,17 @@ class DriverPage extends StatelessWidget {
return CupertinoListSection.insetGrouped( return CupertinoListSection.insetGrouped(
header: Text('Vehicle Information'.tr), header: Text('Vehicle Information'.tr),
children: [ children: [
_buildInfoRow('VIN'.tr, data['vin']), _buildInfoRow('VIN'.tr, data['vin'].toString()),
_buildInfoRow('Plate Number'.tr, data['car_plate']), _buildInfoRow('Plate Number'.tr, data['car_plate'].toString()),
_buildInfoRow('Make'.tr, data['make']), _buildInfoRow('Make'.tr, data['make'].toString()),
_buildInfoRow('Model'.tr, data['model']), _buildInfoRow('Model'.tr, data['model'].toString()),
_buildInfoRow('Year'.tr, data['year']), _buildInfoRow('Year'.tr, data['year'].toString()),
_buildInfoRow('Color'.tr, data['color']), _buildInfoRow('Color'.tr, data['color'].toString()),
_buildInfoRow('Fuel Type'.tr, data['fuel']), _buildInfoRow('Fuel Type'.tr, data['fuel'].toString()),
_buildInfoRow('Displacement'.tr, data['displacement']), _buildInfoRow('Displacement'.tr, data['displacement'].toString()),
_buildInfoRow('Registration Date'.tr, data['registration_date']), _buildInfoRow(
_buildInfoRow('Expiration Date'.tr, data['expiration_date']), 'Registration Date'.tr, data['registration_date'].toString()),
_buildInfoRow('Expiration Date'.tr, data['expiration_date'].toString()),
], ],
); );
} }
@@ -98,11 +99,11 @@ class DriverPage extends StatelessWidget {
return CupertinoListSection.insetGrouped( return CupertinoListSection.insetGrouped(
header: Text('License Information'.tr), header: Text('License Information'.tr),
children: [ children: [
_buildInfoRow('License Type'.tr, data['license_type']), _buildInfoRow('License Type'.tr, data['license_type'].toString()),
_buildInfoRow('Card ID'.tr, data['card_id']), _buildInfoRow('Card ID'.tr, data['card_id'].toString()),
_buildInfoRow('Issue Date'.tr, data['issue_date']), _buildInfoRow('Issue Date'.tr, data['issue_date'].toString()),
_buildInfoRow('Expiry Date'.tr, data['expiry_date']), _buildInfoRow('Expiry Date'.tr, data['expiry_date'].toString()),
_buildInfoRow('Categories'.tr, data['license_categories']), _buildInfoRow('Categories'.tr, data['license_categories'].toString()),
], ],
); );
} }
@@ -111,8 +112,8 @@ class DriverPage extends StatelessWidget {
return CupertinoListSection.insetGrouped( return CupertinoListSection.insetGrouped(
header: Text('Bank Information'.tr), header: Text('Bank Information'.tr),
children: [ children: [
_buildInfoRow('Account Number'.tr, data['accountBank']), _buildInfoRow('Account Number'.tr, data['accountBank'].toString()),
_buildInfoRow('Bank Code'.tr, data['bankCode']), _buildInfoRow('Bank Code'.tr, data['bankCode'].toString()),
], ],
); );
} }

View File

@@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:service/constant/colors.dart'; import 'package:service/constant/colors.dart';
import 'package:service/controller/functions/encrypt_decrypt.dart';
import 'package:service/controller/mainController/main_controller.dart'; import 'package:service/controller/mainController/main_controller.dart';
import 'package:service/views/widgets/my_scafold.dart'; import 'package:service/views/widgets/my_scafold.dart';
@@ -56,14 +57,15 @@ class DriversCantRegister extends StatelessWidget {
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceAround, MainAxisAlignment.spaceAround,
children: [ children: [
Text(driver['phone_number']), Text(EncryptionHelper.instance
.decryptData(driver['phone_number'])),
IconButton( IconButton(
onPressed: () { onPressed: () {
String message = "مرحباً،\n\n" String message = "مرحباً،\n\n"
"نلاحظ أنك لم تكمل عملية التسجيل في خدمة سفر درايفر. نود تذكيرك بأن إكمال التسجيل يتيح لك فرصة الانضمام إلى فريق سفر والاستفادة من خدماتنا المتنوعة.\n\n" "نلاحظ أنك لم تكمل عملية التسجيل في خدمة Tripz درايفر. نود تذكيرك بأن إكمال التسجيل يتيح لك فرصة الانضمام إلى فريق Tripz والاستفادة من خدماتنا المتنوعة.\n\n"
"إذا كنت بحاجة إلى أي مساعدة أو لديك أي استفسارات، لا تتردد في الاتصال بنا. نحن هنا لمساعدتك.\n\n" "إذا كنت بحاجة إلى أي مساعدة أو لديك أي استفسارات، لا تتردد في الاتصال بنا. نحن هنا لمساعدتك.\n\n"
"للاتصال بنا، يرجى الاتصال على الرقم التالي: +20 101 880 5430\n\n" "للاتصال بنا، يرجى الاتصال على الرقم التالي: +20 101 880 5430\n\n"
"مع تحيات فريق سفر."; "مع تحيات فريق Tripz.";
mainController.launchCommunication( mainController.launchCommunication(
'whatsapp', 'whatsapp',

View File

@@ -6,7 +6,10 @@ import 'package:service/controller/mainController/main_controller.dart';
import 'package:service/views/widgets/my_scafold.dart'; import 'package:service/views/widgets/my_scafold.dart';
import '../../../constant/colors.dart'; import '../../../constant/colors.dart';
import '../../../constant/links.dart';
import '../../../views/widgets/my_textField.dart'; import '../../../views/widgets/my_textField.dart';
import '../../functions/image.dart';
import '../../functions/launch.dart';
class EditCar extends StatelessWidget { class EditCar extends StatelessWidget {
final Map carData; final Map carData;
@@ -16,143 +19,145 @@ class EditCar extends StatelessWidget {
Get.put(MainController()); Get.put(MainController());
return GetBuilder<MainController>(builder: (mainController) { return GetBuilder<MainController>(builder: (mainController) {
return MyScaffold(title: 'Edit', isleading: true, body: [ return MyScaffold(
ListView( title: 'Edit',
children: [ isleading: true,
Column( action: Row(
children: [
IconButton(
onPressed: () {
makePhoneCall(carData['phone']);
},
icon: const Icon(Icons.phone),
),
IconButton(
onPressed: () {
launchCommunication('whatsapp', carData['phone'], '');
},
icon: const Icon(
Icons.message,
color: AppColor.greenColor,
),
),
],
),
body: [
ListView(
children: [ children: [
Image.network( Column(
'https://sefer.click/sefer/card_image/car_front-${carData['driverID']}.jpg', children: [
height: 200, GestureDetector(
width: double.maxFinite, onLongPress: () async {
fit: BoxFit.fill, await ImageController().choosImage(AppLink.uploadEgypt,
errorBuilder: (BuildContext context, Object exception, carData['driverID'], 'car_front');
StackTrace? stackTrace) { },
// If the image fails to load, use the _copy version child: Image.network(
return Image.network( 'https://sefer.click/sefer/card_image/car_front-${carData['driverID']}.jpg',
'https://sefer.click/sefer/card_image/car_front-${carData['driverID']}_copy.jpg', height: 200,
height: 200, width: double.maxFinite,
width: double.maxFinite, fit: BoxFit.fill,
fit: BoxFit.fill, errorBuilder: (BuildContext context, Object exception,
); StackTrace? stackTrace) {
}, // If the image fails to load, use the _copy version
), return Image.network(
Image.network( 'https://sefer.click/sefer/card_image/car_front-${carData['driverID']}_copy.jpg',
'https://sefer.click/sefer/card_image/car_back-${carData['driverID']}.jpg', height: 200,
height: 200, width: double.maxFinite,
width: double.maxFinite, fit: BoxFit.fill,
fit: BoxFit.fill, );
errorBuilder: (BuildContext context, Object exception,
StackTrace? stackTrace) {
// If the image fails to load, use the _copy version
return Image.network(
'https://sefer.click/sefer/card_image/car_back-${carData['driverID']}_copy.jpg',
height: 200,
width: double.maxFinite,
fit: BoxFit.fill,
);
},
),
],
),
const SizedBox(height: 9),
Form(
key: mainController.formKey,
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
SizedBox(
width: Get.width * .6,
child: MyTextForm(
controller: mainController.carplateController,
label: 'car plate'.tr,
hint: 'car plate'.tr,
type: TextInputType.name,
),
),
IconButton(
onPressed: () async {
if (mainController.formKey.currentState!.validate()) {
await mainController.editCarPlateNotEdit(
carData['driverID'].toString(),
mainController.carplateController.text,
mainController.colorController.text,
mainController.colorHex.value.toString(),
mainController.yearController.text,
mainController.makeController.text,
mainController.modelController.text,
mainController.expirationDateController.text,
mainController.ownerController.text,
);
}
}, },
icon: const Icon(
Icons.upload_outlined,
color: AppColor.blueColor,
),
), ),
], ),
), GestureDetector(
// Other fields onLongPress: () async {
await ImageController().choosImage(
Row( AppLink.uploadEgypt, carData['id'], 'car_back');
mainAxisAlignment: MainAxisAlignment.spaceBetween, },
child: Image.network(
'https://sefer.click/sefer/card_image/car_back-${carData['driverID']}.jpg',
height: 200,
width: double.maxFinite,
fit: BoxFit.fill,
errorBuilder: (BuildContext context, Object exception,
StackTrace? stackTrace) {
// If the image fails to load, use the _copy version
return Image.network(
'https://sefer.click/sefer/card_image/car_back-${carData['driverID']}_copy.jpg',
height: 200,
width: double.maxFinite,
fit: BoxFit.fill,
);
},
),
),
],
),
const SizedBox(height: 9),
Form(
key: mainController.formKey,
child: Column(
children: [ children: [
SizedBox( Row(
width: Get.width * .4, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
child: MyTextForm( children: [
controller: mainController.yearController, SizedBox(
label: 'Year'.tr, width: Get.width * .6,
hint: 'Year'.tr, child: MyTextForm(
type: TextInputType.number, controller: mainController.carplateController,
), label: 'car plate'.tr,
), hint: 'car plate'.tr,
SizedBox( type: TextInputType.name,
width: Get.width * .4, ),
child: DropdownButtonFormField<String>(
decoration: InputDecoration(
labelText: 'Color'.tr, // Localized label
), ),
value: mainController.colorHex.value.isEmpty IconButton(
? null onPressed: () async {
: mainController.colorHex if (mainController.formKey.currentState!
.value, // Use the hex value as the current value .validate()) {
items: [ await mainController.editCarPlateNotEdit(
{'red'.tr: '#FF0000'}, carData['driverID'].toString(),
{'green'.tr: '#008000'}, mainController.carplateController.text,
{'blue'.tr: '#0000FF'}, mainController.colorController.text,
{'black'.tr: '#000000'}, mainController.colorHex.value.toString(),
{'white'.tr: '#FFFFFF'}, mainController.yearController.text,
{'yellow'.tr: '#FFFF00'}, mainController.makeController.text,
{'purple'.tr: '#800080'}, mainController.modelController.text,
{'orange'.tr: '#FFA500'}, mainController.expirationDateController.text,
{'pink'.tr: '#FFC0CB'}, mainController.ownerController.text,
{'brown'.tr: '#A52A2A'}, );
{'gray'.tr: '#808080'}, }
{'cyan'.tr: '#00FFFF'}, },
{'magenta'.tr: '#FF00FF'}, icon: const Icon(
{'lime'.tr: '#00FF00'}, Icons.upload_outlined,
{'indigo'.tr: '#4B0082'}, color: AppColor.blueColor,
{'violet'.tr: '#EE82EE'}, ),
{'gold'.tr: '#FFD700'}, ),
{'silver'.tr: '#C0C0C0'}, ],
{'teal'.tr: '#008080'}, ),
{'navy'.tr: '#000080'}, // Other fields
].map((colorMap) {
String colorName = colorMap.keys.first; Row(
String colorValue = colorMap.values.first; mainAxisAlignment: MainAxisAlignment.spaceBetween,
return DropdownMenuItem<String>( children: [
value: colorValue, SizedBox(
child: Text(colorName), width: Get.width * .4,
); child: MyTextForm(
}).toList(), controller: mainController.yearController,
onChanged: (value) { label: 'Year'.tr,
if (value != null) { hint: 'Year'.tr,
// Find the selected color name based on the hex value type: TextInputType.number,
String selectedColorName = ''; ),
for (var colorMap in [ ),
SizedBox(
width: Get.width * .4,
child: DropdownButtonFormField<String>(
decoration: InputDecoration(
labelText: 'Color'.tr, // Localized label
),
value: mainController.colorHex.value.isEmpty
? null
: mainController.colorHex
.value, // Use the hex value as the current value
items: [
{'red'.tr: '#FF0000'}, {'red'.tr: '#FF0000'},
{'green'.tr: '#008000'}, {'green'.tr: '#008000'},
{'blue'.tr: '#0000FF'}, {'blue'.tr: '#0000FF'},
@@ -173,120 +178,157 @@ class EditCar extends StatelessWidget {
{'silver'.tr: '#C0C0C0'}, {'silver'.tr: '#C0C0C0'},
{'teal'.tr: '#008080'}, {'teal'.tr: '#008080'},
{'navy'.tr: '#000080'}, {'navy'.tr: '#000080'},
]) { ].map((colorMap) {
if (colorMap.values.first == value) { String colorName = colorMap.keys.first;
selectedColorName = colorMap.keys.first; String colorValue = colorMap.values.first;
break; return DropdownMenuItem<String>(
value: colorValue,
child: Text(colorName),
);
}).toList(),
onChanged: (value) {
if (value != null) {
// Find the selected color name based on the hex value
String selectedColorName = '';
for (var colorMap in [
{'red'.tr: '#FF0000'},
{'green'.tr: '#008000'},
{'blue'.tr: '#0000FF'},
{'black'.tr: '#000000'},
{'white'.tr: '#FFFFFF'},
{'yellow'.tr: '#FFFF00'},
{'purple'.tr: '#800080'},
{'orange'.tr: '#FFA500'},
{'pink'.tr: '#FFC0CB'},
{'brown'.tr: '#A52A2A'},
{'gray'.tr: '#808080'},
{'cyan'.tr: '#00FFFF'},
{'magenta'.tr: '#FF00FF'},
{'lime'.tr: '#00FF00'},
{'indigo'.tr: '#4B0082'},
{'violet'.tr: '#EE82EE'},
{'gold'.tr: '#FFD700'},
{'silver'.tr: '#C0C0C0'},
{'teal'.tr: '#008080'},
{'navy'.tr: '#000080'},
]) {
if (colorMap.values.first == value) {
selectedColorName = colorMap.keys.first;
break;
}
}
mainController.colorController.text =
selectedColorName;
mainController.colorHex.value = value;
} }
} },
),
mainController.colorController.text =
selectedColorName;
mainController.colorHex.value = value;
}
},
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(
width: Get.width * .4,
child: MyTextForm(
controller: mainController.makeController,
label: 'Make'.tr,
hint: 'Make'.tr,
type: TextInputType.name,
),
),
SizedBox(
width: Get.width * .4,
child: MyTextForm(
controller: mainController.modelController,
label: 'Model'.tr,
hint: 'Model'.tr,
type: TextInputType.name,
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(
width: Get.width * .4,
child: TextField(
controller: mainController.expirationDateController,
decoration: InputDecoration(
labelText: 'Expiration Date'.tr,
hintText: 'Expiration Date'.tr,
), ),
readOnly: ],
true, // Make the field read-only to prevent manual input
onTap: () async {
DateTime pickedDate =
DateTime.now(); // Declare the variable here
await showCupertinoModalPopup<void>(
context: context,
builder: (context) => Container(
height: 250,
color: Colors.white,
child: Column(
children: [
SizedBox(
height: 150,
child: CupertinoDatePicker(
initialDateTime: pickedDate,
minimumDate: DateTime(
1955), // Set the starting date
maximumDate: DateTime(
2034), // Set the ending date
mode: CupertinoDatePickerMode.date,
onDateTimeChanged: (DateTime dateTime) {
pickedDate = dateTime;
},
),
),
CupertinoButton(
child: Text('Done'.tr),
onPressed: () {
String formattedDate =
DateFormat('yyyy-MM-dd')
.format(pickedDate);
mainController.expirationDateController
.text = formattedDate.toString();
Navigator.of(context).pop();
},
),
],
),
),
);
},
),
), ),
SizedBox(
width: Get.width * .4, Row(
child: MyTextForm( mainAxisAlignment: MainAxisAlignment.spaceBetween,
controller: mainController.ownerController, children: [
label: 'Owner'.tr, SizedBox(
hint: 'Owner'.tr, width: Get.width * .4,
type: TextInputType.name, child: MyTextForm(
), controller: mainController.makeController,
label: 'Make'.tr,
hint: 'Make'.tr,
type: TextInputType.name,
),
),
SizedBox(
width: Get.width * .4,
child: MyTextForm(
controller: mainController.modelController,
label: 'Model'.tr,
hint: 'Model'.tr,
type: TextInputType.name,
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(
width: Get.width * .4,
child: TextField(
controller:
mainController.expirationDateController,
decoration: InputDecoration(
labelText: 'Expiration Date'.tr,
hintText: 'Expiration Date'.tr,
),
readOnly:
true, // Make the field read-only to prevent manual input
onTap: () async {
DateTime pickedDate =
DateTime.now(); // Declare the variable here
await showCupertinoModalPopup<void>(
context: context,
builder: (context) => Container(
height: 250,
color: Colors.white,
child: Column(
children: [
SizedBox(
height: 150,
child: CupertinoDatePicker(
initialDateTime: pickedDate,
minimumDate: DateTime(
1955), // Set the starting date
maximumDate: DateTime(
2034), // Set the ending date
mode: CupertinoDatePickerMode.date,
onDateTimeChanged:
(DateTime dateTime) {
pickedDate = dateTime;
},
),
),
CupertinoButton(
child: Text('Done'.tr),
onPressed: () {
String formattedDate =
DateFormat('yyyy-MM-dd')
.format(pickedDate);
mainController
.expirationDateController
.text =
formattedDate.toString();
Navigator.of(context).pop();
},
),
],
),
),
);
},
),
),
SizedBox(
width: Get.width * .4,
child: MyTextForm(
controller: mainController.ownerController,
label: 'Owner'.tr,
hint: 'Owner'.tr,
type: TextInputType.name,
),
),
],
), ),
], ],
), ),
], )
), ],
) )
], ]);
)
]);
}); });
} }
} }

View File

@@ -1,13 +1,10 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:service/constant/colors.dart';
import 'package:service/constant/style.dart'; import 'package:service/constant/style.dart';
import 'package:service/controller/mainController/pages/edit_car.dart'; import 'package:service/controller/mainController/pages/edit_car.dart';
import 'package:service/views/widgets/elevated_btn.dart';
import 'package:service/views/widgets/my_scafold.dart'; import 'package:service/views/widgets/my_scafold.dart';
import 'package:service/views/widgets/my_textField.dart';
import '../../functions/encrypt_decrypt.dart';
import '../main_controller.dart'; import '../main_controller.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@@ -39,7 +36,8 @@ class EditCarPlate extends StatelessWidget {
}, },
child: Container( child: Container(
decoration: AppStyle.boxDecoration1, decoration: AppStyle.boxDecoration1,
child: Text(carData['owner'])), child: Text(EncryptionHelper.instance
.decryptData(carData['owner']))),
), ),
); );
}), }),

View File

@@ -0,0 +1,57 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:service/views/widgets/my_scafold.dart';
import '../../best_driver_controllers.dart';
import '../../functions/encrypt_decrypt.dart';
class DriverTheBestGiza extends StatelessWidget {
const DriverTheBestGiza({super.key});
@override
Widget build(BuildContext context) {
Get.put(DriverTheBestGizaController(), permanent: true);
return MyScaffold(
title: 'Giza'.tr,
body: [
GetBuilder<DriverTheBestGizaController>(builder: (driverthebest) {
return driverthebest.driver.isNotEmpty
? ListView.builder(
itemCount: driverthebest.driver.length,
itemBuilder: (context, index) {
final driver = driverthebest.driver[index];
return ListTile(
leading: CircleAvatar(
child: Text(
(int.parse(driver['driver_count'] * 5) / 3600)
.toStringAsFixed(0),
),
),
title: Text(EncryptionHelper.instance
.decryptData(driver['name_arabic']) ??
'Unknown Name'),
subtitle: Text(
'Phone: ${EncryptionHelper.instance.decryptData(driver['phone']) ?? 'N/A'}'),
trailing: IconButton(
onPressed: () async {
Get.defaultDialog(
title:
'are you sure to pay to this driver gift'.tr,
middleText: '',
onConfirm: () async {},
onCancel: () => Get.back());
},
icon: const Icon(Icons.wallet_giftcard_rounded),
),
);
},
)
: const Center(
child: Text('No drivers available.'),
);
})
],
isleading: true,
);
}
}

View File

@@ -4,6 +4,8 @@ import 'package:get/get.dart';
import 'package:service/controller/mainController/main_controller.dart'; import 'package:service/controller/mainController/main_controller.dart';
import 'package:service/views/widgets/my_scafold.dart'; import 'package:service/views/widgets/my_scafold.dart';
import '../../functions/encrypt_decrypt.dart';
class PassengersCantRegister extends StatelessWidget { class PassengersCantRegister extends StatelessWidget {
PassengersCantRegister({super.key}); PassengersCantRegister({super.key});
@@ -31,7 +33,8 @@ class PassengersCantRegister extends StatelessWidget {
child: CupertinoFormRow( child: CupertinoFormRow(
prefix: Text('Phone Number'.tr), prefix: Text('Phone Number'.tr),
child: CupertinoTextFormFieldRow( child: CupertinoTextFormFieldRow(
initialValue: passenger['phone_number'], initialValue: EncryptionHelper.instance
.decryptData((passenger['phone_number'])),
readOnly: true, readOnly: true,
placeholder: 'Phone Number'.tr, placeholder: 'Phone Number'.tr,
), ),

View File

@@ -1,4 +1,5 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:math';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
@@ -12,13 +13,17 @@ import '../../constant/links.dart';
import '../../constant/style.dart'; import '../../constant/style.dart';
import '../../main.dart'; import '../../main.dart';
import '../../print.dart'; import '../../print.dart';
import '../../views/widgets/mycircular.dart';
import '../functions/crud.dart'; import '../functions/crud.dart';
import '../functions/image.dart'; import '../functions/image.dart';
import '../functions/launch.dart';
enum DocumentType { enum DocumentType {
carLicenseFront, carLicenseFront,
carLicenseBack, carLicenseBack,
idCardFront, idCardFront,
nonIdCardFront,
nonIdCardBack,
idCardBack, idCardBack,
driverLicense, driverLicense,
unknown, unknown,
@@ -31,6 +36,7 @@ class RegisterCaptainController extends GetxController {
String? driverId; String? driverId;
String? email; String? email;
String? phone; String? phone;
bool isEgypt = true;
@override @override
void onInit() { void onInit() {
@@ -47,6 +53,12 @@ class RegisterCaptainController extends GetxController {
initArguments(); initArguments();
} }
changeNationality() {
isEgypt = !isEgypt;
update();
}
void initArguments() { void initArguments() {
if (arguments != null) { if (arguments != null) {
driverId = arguments!['driverId']; driverId = arguments!['driverId'];
@@ -67,6 +79,8 @@ class RegisterCaptainController extends GetxController {
Map<String, dynamic> responseIdEgyptFront = {}; Map<String, dynamic> responseIdEgyptFront = {};
Map<String, dynamic> responseCriminalRecordEgypt = {}; Map<String, dynamic> responseCriminalRecordEgypt = {};
Map<String, dynamic> responseIdEgyptBack = {}; Map<String, dynamic> responseIdEgyptBack = {};
Map<String, dynamic> responseNonIdCardFront = {};
Map<String, dynamic> responseNonIdCardBack = {};
Map<String, dynamic> responseIdEgyptDriverLicense = {}; Map<String, dynamic> responseIdEgyptDriverLicense = {};
String? responseIdCardDriverEgypt1; String? responseIdCardDriverEgypt1;
bool isloading = false; bool isloading = false;
@@ -180,21 +194,21 @@ class RegisterCaptainController extends GetxController {
String expectedDocument = getExpectedDocument(imagePath); String expectedDocument = getExpectedDocument(imagePath);
String detectedDocument = getDetectedDocument(detectedType); String detectedDocument = getDetectedDocument(detectedType);
bool isCorrectDocument = (detectedType == getExpectedType(imagePath)); // bool isCorrectDocument = (detectedType == getExpectedType(imagePath));
if (!isCorrectDocument) { // if (!isCorrectDocument) {
Get.defaultDialog( // Get.defaultDialog(
title: 'incorrect_document_title'.tr, // title: 'incorrect_document_title'.tr,
middleText: // middleText:
'${'expected'.tr}: $expectedDocument\n${'detected'.tr}: $detectedDocument', // '${'expected'.tr}: $expectedDocument\n${'detected'.tr}: $detectedDocument',
confirm: MyElevatedButton( // confirm: MyElevatedButton(
title: 'OK'.tr, // title: 'OK'.tr,
onPressed: () { // onPressed: () {
Get.back(); // Get.back();
})); // }));
} else { // } else {
// Process the correct document // Process the correct document
await anthropicAI(textValues, prompt, imagePath); await anthropicAI(textValues, prompt, imagePath);
} // }
isLoading = false; isLoading = false;
update(); update();
} }
@@ -417,6 +431,8 @@ class RegisterCaptainController extends GetxController {
String extractDOB(String nationalNumber) { String extractDOB(String nationalNumber) {
if (nationalNumber.length != 14) { if (nationalNumber.length != 14) {
Get.snackbar('National number must be 14 digits long.', 'message',
backgroundColor: AppColor.redColor);
throw ArgumentError('National number must be 14 digits long.'); throw ArgumentError('National number must be 14 digits long.');
} }
@@ -448,11 +464,120 @@ class RegisterCaptainController extends GetxController {
return dob; return dob;
} }
String generatePassword({int length = 8}) {
const String upperCaseLetters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
const String lowerCaseLetters = 'abcdefghijklmnopqrstuvwxyz';
const String digits = '0123456789';
const String specialCharacters = '!@#\$%^&*()-_=+[]{}|;:,.<>?';
const String allChars =
upperCaseLetters + lowerCaseLetters + digits + specialCharacters;
final Random random = Random();
// Generate a random password of the specified length
String password = List.generate(length, (index) {
int randomIndex = random.nextInt(allChars.length);
return allChars[randomIndex];
}).join();
return password;
}
Future<void> addDriverForeign() async {
isLoading = true;
update();
var added = await storage.read(key: 'name');
String newPassword = generatePassword();
print('Generated Password: $newPassword');
var payload = {
'first_name':
responseNonIdCardFront['full_name']?.toString().split(' ')[0] ??
'Not specified',
'last_name':
responseNonIdCardFront['full_name']?.toString().split(' ').last ??
'Not specified',
'email': box.read(BoxName.emailDriver)?.toString() ?? 'Not specified',
'phone': box.read(BoxName.phoneDriver)?.toString() ?? 'Not specified',
'id': box.read(BoxName.driverID)?.toString() ?? 'Not specified',
'password': newPassword.toString() ?? '123456',
'gender': responseNonIdCardFront['gender']?.toString() ?? 'Not specified',
'license_type': 'Foreign',
'national_number':
responseNonIdCardFront['passport_no']?.toString() ?? 'Not specified',
'name_arabic':
responseNonIdCardFront['full_name']?.toString() ?? 'Not specified',
'name_english': 'Not specified',
'issue_date':
responseNonIdCardBack['issueDate']?.toString() ?? 'Not specified',
'expiry_date':
responseNonIdCardBack['residencyExpirationDate']?.toString() ??
'Not specified',
'license_categories': responseIdEgyptDriverLicense['license_categories']
is List
? responseIdEgyptDriverLicense['license_categories'].join(', ')
: responseIdEgyptDriverLicense['license_categories']?.toString() ??
'Not specified',
'address':
responseNonIdCardFront['address']?.toString() ?? 'Not specified',
'card_id':
responseNonIdCardFront['card_id']?.toString() ?? 'Not specified',
'occupation':
responseNonIdCardBack['workStatus']?.toString() ?? 'Not specified',
'education': 'Not specified',
'licenseIssueDate':
responseNonIdCardBack['issueDate']?.toString() ?? 'Not specified',
'religion':
responseNonIdCardFront['country']?.toString() ?? 'Not specified',
'status': 'yet',
'birthdate':
responseNonIdCardFront['birthdate']?.toString() ?? 'Not specified',
'maritalStatus': added.toString(),
'site': responseNonIdCardFront['address']?.toString() ?? 'Not specified',
'employmentType':
responseNonIdCardBack['residencyType']?.toString() ?? 'Not specified',
};
try {
var res = await CRUD().post(link: AppLink.signUpCaptin, payload: payload);
var status1;
try {
status1 = jsonDecode(res);
} catch (e) {
throw FormatException("Invalid JSON response: $res");
}
isLoading = false;
update();
if (status1['status'] == 'success') {
isDriverSaved = true;
CRUD().post(
link: '${AppLink.seferGizaServer}/auth/captin/register.php',
payload: payload);
CRUD().post(
link: '${AppLink.seferAlexandriaServer}/auth/captin/register.php',
payload: payload);
mySnackbarSuccess('Foreign driver data saved successfully');
} else {
mySnackeBarError(
'${'Failed to save driver data'.tr}: ${status1['message']}');
}
} catch (e) {
isLoading = false;
update();
mySnackeBarError(
'An error occurred while saving driver data'.tr,
);
}
}
Future<void> addDriverEgypt() async { Future<void> addDriverEgypt() async {
isLoading = true; isLoading = true;
update(); update();
var added = await storage.read(key: 'name'); var added = await storage.read(key: 'name');
String newPassword = generatePassword();
print('Generated Password: $newPassword');
var payload = { var payload = {
'first_name': responseIdEgyptDriverLicense['firstName']?.toString() ?? 'first_name': responseIdEgyptDriverLicense['firstName']?.toString() ??
'Not specified', 'Not specified',
@@ -461,7 +586,7 @@ class RegisterCaptainController extends GetxController {
'email': email?.toString() ?? 'Not specified', 'email': email?.toString() ?? 'Not specified',
'phone': phone?.toString() ?? 'Not specified', 'phone': phone?.toString() ?? 'Not specified',
'id': driverId?.toString() ?? 'Not specified', 'id': driverId?.toString() ?? 'Not specified',
'password': '123456', 'password': newPassword.toString() ?? '123456',
'gender': responseIdEgyptBack['gender']?.toString() ?? 'Not specified', 'gender': responseIdEgyptBack['gender']?.toString() ?? 'Not specified',
'license_type': 'license_type':
responseIdEgyptDriverLicense['license_type']?.toString() ?? responseIdEgyptDriverLicense['license_type']?.toString() ??
@@ -520,6 +645,8 @@ class RegisterCaptainController extends GetxController {
Log.print('res: ${res1}'); Log.print('res: ${res1}');
Get.snackbar('Success', 'Driver data saved successfully', Get.snackbar('Success', 'Driver data saved successfully',
backgroundColor: AppColor.greenColor); backgroundColor: AppColor.greenColor);
launchCommunication('whatsapp', phone.toString(),
'you have seuccessfully registered in SEFER\n\n\n*Email* is *$email*\n\n*id* is *$driverId*\n\n*password* is *$newPassword*');
} else { } else {
Get.snackbar('Error', 'Failed to save driver data', Get.snackbar('Error', 'Failed to save driver data',
backgroundColor: Colors.red); backgroundColor: Colors.red);
@@ -529,6 +656,7 @@ class RegisterCaptainController extends GetxController {
Future<void> addDriverEgyptHanding() async { Future<void> addDriverEgyptHanding() async {
isLoading = true; isLoading = true;
update(); update();
String newPassword = generatePassword();
var added = await storage.read(key: 'name'); var added = await storage.read(key: 'name');
var payload = { var payload = {
'first_name': firstName.value.isNotEmpty 'first_name': firstName.value.isNotEmpty
@@ -540,7 +668,7 @@ class RegisterCaptainController extends GetxController {
'email': email?.toString() ?? 'Not specified', 'email': email?.toString() ?? 'Not specified',
'phone': phone?.toString() ?? 'Not specified', 'phone': phone?.toString() ?? 'Not specified',
'id': driverId?.toString() ?? 'Not specified', 'id': driverId?.toString() ?? 'Not specified',
'password': '123456', 'password': newPassword.toString() ?? '123456',
'gender': gender.value.isNotEmpty 'gender': gender.value.isNotEmpty
? gender.value ? gender.value
: responseIdEgyptBack['gender'], : responseIdEgyptBack['gender'],
@@ -590,6 +718,11 @@ class RegisterCaptainController extends GetxController {
: extractDOB( : extractDOB(
responseIdEgyptDriverLicense['national_number'].toString()), responseIdEgyptDriverLicense['national_number'].toString()),
'maritalStatus': added.toString(), 'maritalStatus': added.toString(),
'fullNameMaritial': firstName.value.isNotEmpty
? firstName.value
: responseIdEgyptDriverLicense['firstName'] +
'_' +
newPassword.toString(),
'site': site.value.isNotEmpty 'site': site.value.isNotEmpty
? site.value ? site.value
: responseIdEgyptDriverLicense['address'], : responseIdEgyptDriverLicense['address'],
@@ -614,6 +747,8 @@ class RegisterCaptainController extends GetxController {
payload: payload); payload: payload);
Get.snackbar('Success', 'Driver data saved successfully', Get.snackbar('Success', 'Driver data saved successfully',
backgroundColor: AppColor.greenColor); backgroundColor: AppColor.greenColor);
launchCommunication('whatsapp', phone.toString(),
'you have seuccessfully registered in SEFER\n\n\n*Email* is *$email*\n\n*id* is *$driverId*\n\n*password* is *$newPassword*');
} else { } else {
Get.snackbar('Error', 'Failed to save driver data', Get.snackbar('Error', 'Failed to save driver data',
backgroundColor: Colors.red); backgroundColor: Colors.red);

View File

@@ -1,21 +1,22 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../constant/colors.dart'; import '../../constant/colors.dart';
import '../../constant/style.dart'; import '../../constant/style.dart';
ThemeData themeEnglish = ThemeData( ThemeData lightThemeEnglish = ThemeData(
fontFamily: "PlayfairDisplay", brightness: Brightness.light,
fontFamily: "SFPro",
textTheme: TextTheme( textTheme: TextTheme(
displaySmall: AppStyle.title, displaySmall: AppStyle.title,
displayLarge: AppStyle.title, displayLarge: AppStyle.headTitle,
displayMedium: AppStyle.title, displayMedium: AppStyle.headTitle2,
bodyLarge: AppStyle.title, bodyLarge: AppStyle.title,
bodyMedium: AppStyle.title), bodyMedium: AppStyle.subtitle,
),
primarySwatch: Colors.blue, primarySwatch: Colors.blue,
dialogTheme: DialogTheme( dialogTheme: DialogTheme(
backgroundColor: AppColor.secondaryColor, backgroundColor: AppColor.secondaryColor,
contentTextStyle: AppStyle.title, contentTextStyle: AppStyle.title,
titleTextStyle: AppStyle.title, titleTextStyle: AppStyle.headTitle2,
), ),
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme(
elevation: 0, elevation: 0,
@@ -25,35 +26,122 @@ ThemeData themeEnglish = ThemeData(
color: AppColor.primaryColor, color: AppColor.primaryColor,
), ),
toolbarTextStyle: TextTheme( toolbarTextStyle: TextTheme(
titleSmall: AppStyle.subtitle, titleSmall: AppStyle.subtitle,
headlineSmall: AppStyle.title, headlineSmall: AppStyle.title,
titleLarge: AppStyle.headTitle2) titleLarge: AppStyle.headTitle2,
.bodyMedium, ).bodyMedium,
titleTextStyle: TextTheme( titleTextStyle: TextTheme(
titleSmall: AppStyle.subtitle, titleSmall: AppStyle.subtitle,
headlineSmall: AppStyle.title, headlineSmall: AppStyle.title,
titleLarge: AppStyle.headTitle2) titleLarge: AppStyle.headTitle2,
.titleLarge, ).titleLarge,
), ),
); );
ThemeData themeArabic = ThemeData( ThemeData darkThemeEnglish = ThemeData(
fontFamily: "Cairo", brightness: Brightness.dark,
textTheme: const TextTheme( fontFamily: "SFPro",
displayLarge: TextStyle( textTheme: TextTheme(
fontWeight: FontWeight.bold, displaySmall: AppStyle.title,
fontSize: 22, displayLarge: AppStyle.headTitle,
color: AppColor.primaryColor), displayMedium: AppStyle.headTitle2,
displayMedium: TextStyle( bodyLarge: AppStyle.title,
fontWeight: FontWeight.bold, bodyMedium: AppStyle.subtitle,
fontSize: 26, ),
color: AppColor.primaryColor),
bodyLarge: TextStyle(
height: 2,
color: AppColor.accentColor,
fontWeight: FontWeight.bold,
fontSize: 14),
bodyMedium:
TextStyle(height: 2, color: AppColor.accentColor, fontSize: 14)),
primarySwatch: Colors.blue, primarySwatch: Colors.blue,
dialogTheme: DialogTheme(
backgroundColor: AppColor.secondaryColor,
contentTextStyle: AppStyle.title,
titleTextStyle: AppStyle.headTitle2,
),
appBarTheme: AppBarTheme(
elevation: 0,
color: AppColor.secondaryColor,
centerTitle: true,
iconTheme: const IconThemeData(
color: AppColor.primaryColor,
),
toolbarTextStyle: TextTheme(
titleSmall: AppStyle.subtitle,
headlineSmall: AppStyle.title,
titleLarge: AppStyle.headTitle2,
).bodyMedium,
titleTextStyle: TextTheme(
titleSmall: AppStyle.subtitle,
headlineSmall: AppStyle.title,
titleLarge: AppStyle.headTitle2,
).titleLarge,
),
);
ThemeData lightThemeArabic = ThemeData(
brightness: Brightness.light,
fontFamily: 'SFArabic',
textTheme: TextTheme(
displaySmall: AppStyle.title,
displayLarge: AppStyle.headTitle,
displayMedium: AppStyle.headTitle2,
bodyLarge: AppStyle.title,
bodyMedium: AppStyle.subtitle,
),
primarySwatch: Colors.blue,
dialogTheme: DialogTheme(
backgroundColor: AppColor.secondaryColor,
contentTextStyle: AppStyle.title,
titleTextStyle: AppStyle.headTitle2,
),
appBarTheme: AppBarTheme(
elevation: 0,
color: AppColor.secondaryColor,
centerTitle: true,
iconTheme: const IconThemeData(
color: AppColor.primaryColor,
),
toolbarTextStyle: TextTheme(
titleSmall: AppStyle.subtitle,
headlineSmall: AppStyle.title,
titleLarge: AppStyle.headTitle2,
).bodyMedium,
titleTextStyle: TextTheme(
titleSmall: AppStyle.subtitle,
headlineSmall: AppStyle.title,
titleLarge: AppStyle.headTitle2,
).titleLarge,
),
);
ThemeData darkThemeArabic = ThemeData(
brightness: Brightness.dark,
fontFamily: 'SFArabic',
textTheme: TextTheme(
displaySmall: AppStyle.title,
displayLarge: AppStyle.headTitle,
displayMedium: AppStyle.headTitle2,
bodyLarge: AppStyle.title,
bodyMedium: AppStyle.subtitle,
),
primarySwatch: Colors.blue,
dialogTheme: DialogTheme(
backgroundColor: AppColor.secondaryColor,
contentTextStyle: AppStyle.title,
titleTextStyle: AppStyle.headTitle2,
),
appBarTheme: AppBarTheme(
elevation: 0,
color: AppColor.secondaryColor,
centerTitle: true,
iconTheme: const IconThemeData(
color: AppColor.primaryColor,
),
toolbarTextStyle: TextTheme(
titleSmall: AppStyle.subtitle,
headlineSmall: AppStyle.title,
titleLarge: AppStyle.headTitle2,
).bodyMedium,
titleTextStyle: TextTheme(
titleSmall: AppStyle.subtitle,
headlineSmall: AppStyle.title,
titleLarge: AppStyle.headTitle2,
).titleLarge,
),
); );

15
lib/env/env.dart vendored
View File

@@ -4,6 +4,21 @@ part 'env.g.dart';
@Envied() @Envied()
abstract class Env { abstract class Env {
@EnviedField(varName: 'addd', obfuscate: true)
static final String addd = _Env.addd;
@EnviedField(varName: 'getapiKey', obfuscate: true)
static final String getapiKey = _Env.getapiKey;
@EnviedField(varName: 'passnpassenger', obfuscate: true)
static final String passnpassenger = _Env.passnpassenger;
@EnviedField(varName: 'newId', obfuscate: true)
static final String newId = _Env.newId;
@EnviedField(varName: 'allowed', obfuscate: true)
static final String allowed = _Env.allowed;
@EnviedField(varName: 'basicAuthCredentials', obfuscate: true) @EnviedField(varName: 'basicAuthCredentials', obfuscate: true)
static final String basicAuthCredentials = _Env.basicAuthCredentials; static final String basicAuthCredentials = _Env.basicAuthCredentials;

2663
lib/env/env.g.dart vendored

File diff suppressed because it is too large Load Diff

View File

@@ -8,11 +8,12 @@ import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart'; import 'package:get_storage/get_storage.dart';
import 'controller/firebase.dart'; import 'controller/firebase.dart';
import 'controller/functions/encrypt_decrypt.dart';
import 'controller/functions/initilize.dart';
import 'controller/local/local_controller.dart'; import 'controller/local/local_controller.dart';
import 'controller/local/translations.dart'; import 'controller/local/translations.dart';
import 'firebase_options.dart'; import 'firebase_options.dart';
import 'login_page.dart'; import 'login_page.dart';
import 'views/home/main.dart';
final box = GetStorage(); final box = GetStorage();
const storage = FlutterSecureStorage(); const storage = FlutterSecureStorage();
@@ -38,6 +39,12 @@ void main() async {
// DeviceOrientation.portraitDown, // DeviceOrientation.portraitDown,
// ]); // ]);
// } // }
final AppInitializer initializer = AppInitializer();
await initializer.initializeApp();
await Future.delayed(Duration.zero);
await EncryptionHelper.initialize();
runApp(MyApp()); runApp(MyApp());
} }

View File

@@ -32,7 +32,7 @@ SELECT
FROM FROM
`driver` d `driver` d
WHERE WHERE
d.`maritalStatus` IN('Maryam', 'Salma', 'Mena') AND DATE(d.created_at) = CURDATE() d.`maritalStatus` IN('Maryam', 'rawda', 'Mena') AND DATE(d.created_at) = CURDATE()
GROUP BY GROUP BY
d.`maritalStatus` d.`maritalStatus`
ORDER BY ORDER BY
@@ -64,3 +64,145 @@ WHERE
----- driver ----- driver
SELECT phone,email,name_arabic,national_number FROM `driver` WHERE national_number ='29209290106392' SELECT phone,email,name_arabic,national_number FROM `driver` WHERE national_number ='29209290106392'
ORDER BY `driver`.`created_at` DESC ORDER BY `driver`.`created_at` DESC
------- driver work
SELECT
COUNT(`car_locations`.driver_id),
driver.id,
driver.phone,
driver.name_arabic
FROM
`car_locations`
LEFT JOIN driver ON driver.id = car_locations.driver_id
WHERE
`car_locations`. created_at > TIMESTAMP(
DATE_SUB(NOW(), INTERVAL 10 MINUTE))
GROUP BY
driver_id
ORDER BY
COUNT(driver_id)
DESC
;
------ get count of year cars
SELECT
CASE
WHEN `year` > 2017 THEN 'After 2017'
WHEN `year` BETWEEN 2000 AND 2016 THEN '2000-2016'
ELSE 'Before 2000'
END AS `year_group`,
COUNT(*) AS `count`
FROM `carPlateEdit`
GROUP BY `year_group`
ORDER BY `year_group` ASC;
-- delete location 1 day
DELETE
FROM
`car_locations`
WHERE
DATE(`created_at`) < CURDATE();
SELECT
COUNT(`car_locations`.driver_id),
driver.id,
driver.phone,
driver.name_arabic
FROM
`car_locations`
LEFT JOIN driver ON driver.id = car_locations.driver_id
WHERE
`car_locations`.created_at > TIMESTAMP(
DATE_SUB(NOW(), INTERVAL 10 MINUTE))
GROUP BY
driver_id
ORDER BY
COUNT(driver_id)
DESC
;
-- driver register by hours for employee
SELECT
d.`maritalStatus` AS NAME,
HOUR(d.created_at) AS hour,
COUNT(*) AS `count`
FROM
`driver` d
WHERE
d.`maritalStatus` IN ('Maryam', 'rawda', 'Mena')
AND DATE(d.created_at) = CURDATE()
GROUP BY
d.`maritalStatus`, HOUR(d.created_at)
ORDER BY
hour, `count` DESC;
---- monthly
SELECT
MONTH(d.created_at) AS month,
COUNT(d.id) AS `count`
FROM
`driver` d
WHERE
YEAR(d.created_at) = YEAR(CURDATE())
GROUP BY
MONTH(d.created_at)
ORDER BY
month,
`count`
DESC
;
-----AI request
SELECT
f.id,
f.passengerId,
f.feedBack,
f.datecreated,
r.id AS ride_id,
r.start_location,
r.end_location,
r.date,
r.price,
r.status,
r.paymentMethod,
r.distance,
r.carType,
r.rideTimeFinish,
r.rideTimeStart,
r.DriverIsGoingToPassenger,
COUNT(rp.id) AS countRateFromPassengerToDrivers,
COUNT(rd.id) AS countRateFromDriverToPassengers,
MAX(rp.rating) AS rateFromPassengerToDriver,
MAX(rd.rating) AS rateFromDriversToPassengers,
MAX(rp.comment) AS commentFromPassengerToDriver,
MAX(rd.comment) AS commentFromDriverToPassenger
FROM
`feedBack` f
LEFT JOIN ride r ON
r.passenger_id = f.passengerId
LEFT JOIN ratingPassenger rp ON
rp.passenger_id = r.passenger_id
LEFT JOIN ratingDriver rd ON
rd.driver_id = r.driver_id
WHERE
r.passenger_id = '113172279072358305645'
GROUP BY
f.id, f.passengerId, f.feedBack, f.datecreated,
r.id, r.start_location, r.end_location, r.date, r.price,
r.status, r.paymentMethod, r.distance, r.carType,
r.rideTimeFinish, r.rideTimeStart, r.DriverIsGoingToPassenger
ORDER BY
r.date DESC
LIMIT 1;

99
lib/models/vshost.md Normal file
View File

@@ -0,0 +1,99 @@
server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
{{ssl_certificate_key}}
{{ssl_certificate}}
server_name www.sefer.click;
return 301 https://sefer.click$request_uri;
}
server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
{{ssl_certificate_key}}
{{ssl_certificate}}
server_name sefer.click www1.sefer.click;
{{root}}
{{nginx_access_log}}
{{nginx_error_log}}
# Set the maximum request body size
client_max_body_size 10m;
if ($scheme != "https") {
rewrite ^ https://$host$uri permanent;
}
location ~ /.well-known {
auth_basic off;
allow all;
}
# Security headers
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline';" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Permissions-Policy "geolocation=(), microphone=()" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
{{settings}}
location / {
{{varnish_proxy_pass}}
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_hide_header X-Varnish;
proxy_redirect off;
proxy_max_temp_file_size 0;
proxy_connect_timeout 720;
proxy_send_timeout 720;
proxy_read_timeout 720;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
}
location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf|map|mjs)$ {
add_header Access-Control-Allow-Origin "\*";
expires max;
access_log off;
}
location ~ /\.(ht|svn|git) {
deny all;
}
if (-f $request_filename) {
break;
}
}
server {
listen 8080;
listen [::]:8080;
server_name sefer.click www1.sefer.click;
{{root}}
try_files $uri $uri/ /index.php?$args;
index index.php index.html;
location ~ \.php$ {
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
try_files $uri =404;
fastcgi_read_timeout 3600;
fastcgi_send_timeout 3600;
proxy_read_timeout 3600;
proxy_send_timeout 3600;
fastcgi_param HTTPS "on";
fastcgi_param SERVER_PORT 443;
fastcgi_pass 127.0.0.1:{{php_fpm_port}};
fastcgi_param PHP_VALUE "{{php_settings}}";
}
if (-f $request_filename) {
break;
}
}
//above for cairo server

222
lib/translations_ar.json Normal file
View File

@@ -0,0 +1,222 @@
{
"Insert Name of Driver": "",
"raw gray": "",
"Expiration Date": "",
"Insert site of Driver": "",
"Insert Name of Owner": "",
"Insert car_type of Driver": "",
"car_license_front": "",
"Alexandria": "",
"navy": "",
"Displacement": "",
"Insert birth_date of Driver": "",
"Criminal Record": "",
"Model": "",
"License Type": "",
"Birthdate": "",
"Notes": "",
"s License": "",
"Complaints": "",
"Full Name": "",
"Next": "",
"Full Name (Marital)": "",
"Non Egypt": "",
"Giza": "",
";\n static const String stripePublishableKey = ": "",
"magenta": "",
"An error occurred while saving driver data": "",
"Email": "",
"My documents have expired": "",
"Vehicle Information": "",
"Education": "",
"Capture an Image of Your ID Document Back": "",
"Personal Information": "",
"Vehicle Details Front": "",
"Tax Expiry Date": "",
"Insert site of Owner": "",
"ID Documents Back": "",
"settings": "",
"car_license_back": "",
"OK": "",
"Price": "",
"Country": "",
"orange": "",
"pink": "",
"DOB": "",
"Insert license type of Driver": "",
"Card ID": "",
"inspection\",\n \"Capture an Image of Your car license back\":\n \"Capturez une image de votre permis de voiture\",\n \"Capture an Image of Your Drivers License\":\n \"Capturez une image de votre permis de conduire\",\n \"Sign in with Google for easier email and name entry\":\n \"Connectez-vous avec Google pour faciliter la saisie de votre adresse e-mail et de votre nom\",\n \"You will choose allow all the time to be ready receive orders\":\n \"Vous choisirez de permettre à tout moment d": "",
"are you sure to pay to this driver gift": "",
"gold": "",
">Arabic (Egypt)</span>\n </div>\n </div>\n <span title=": "",
"Name (Arabic)": "",
"Driver Information": "",
"Success": "",
"insert passenger phone": "",
"yellow": "",
"Phone": "",
"National ID": "",
"thanks": "",
"Make": "",
"Not found any image": "",
"Save Notes": "",
"cyan": "",
"Insert registration_date of Car": "",
"Bank Information": "",
"best driver": "",
"indigo": "",
"peach": "",
"Ride ID": "",
"Edit car details": "",
"IssueDate": "",
"Fuel Type": "",
"Birth Date": "",
"Marital Status": "",
"Color": "",
"Name": "",
"Created At": "",
"Registration Date": "",
"View complaint": "",
"Enter notes after call": "",
"silver": "",
"Phone Number": "",
"Cropper": "",
"End Time": "",
"Enter notes here...": "",
"ID Documents Front": "",
"unknown_document": "",
": ": "",
"CardID": "",
"Insert national ID of Driver": "",
"Insert car_model of Driver": "",
"mocha": "",
"Capture an Image of Your Driver License": "",
"maroon": "",
"InspectionResult": "",
"Expired Drivers License": "",
"Failed to save driver data": "",
"Upload": "",
"Wallet Information": "",
"Drivers Cant Register": "",
"For Egypt": "",
"Driver Statistics": "",
"Hand Inserting": "",
"navy blue": "",
"Add car": "",
"Bank Code": "",
"Please enter a valid email.": "",
"Religion": "",
"Welcome call": "",
"Non-Egyptian ID Front": "",
"FullName": "",
"Call Driver": "",
"Occupation": "",
"Plate Number": "",
"Inspection Date": "",
"turquoise": "",
"Date": "",
"red ochre": "",
"gray": "",
"Edit car plate": "",
"tawny": "",
"License Categories": "",
"car plate": "",
"Image Upload Failed": "",
"incorrect_document_title": "",
"Expiry Date": "",
"Gender": "",
"Owner Name": "",
"License Information": "",
"Sefer Service": "",
"Add": "",
"expected": "",
"Name (English)": "",
"Distance": "",
"Capture an Image of Your car license back": "",
"Account Number": "",
"I don't have a suitable vehicle": "",
"black": "",
"First Name": "",
"Total Rides": "",
"NationalID": "",
"Avg Passenger Rating": "",
"Notes:": "",
"teal": "",
"National Number": "",
"green": "",
"Chassis": "",
"Insert year of Car": "",
"Average Rating": "",
"Driver details by phone": "",
"Insert all fields": "",
"champagne": "",
"Add Driver Who Wants to Work": "",
"Add Car Who Wants to Work": "",
"I'm not ready yet": "",
"Car Type": "",
"Capture an Image of Your ID Document front": "",
"Capture an Image of Your Criminal Record": "",
"License Expiry Date": "",
"blue": "",
"Done": "",
"Passengers Cant Register": "",
"Fuel": "",
"Total Payments": "",
"red": "",
"Cancel": "",
"Additional comments": "",
"Vehicle Details Back": "",
"detected": "",
"violet": "",
"Capture Image of Non-Egyptian ID Front": "",
"lime": "",
"I need more help understanding the app": "",
"id_card_front": "",
"Payment Method": "",
"Ok": "",
"Wallet Balance": "",
"Last Payment Amount": "",
"Owner": "",
"Order": "",
"Year": "",
"Capture an Image of Your car license front": "",
"Scam Reports": "",
"Welcome Drivers": "",
"Search by phone number": "",
"verdi": "",
"Please enter a valid phone number.": "",
"Save Changes": "",
"Employment": "",
"Issue Date": "",
"passenger details by phone": "",
"Insert car_number of Driver": "",
"hand inserting": "",
"driver_license": "",
"Error": "",
"Car Details": "",
"uploaded sucssefuly": "",
"Start Time": "",
"I'll register when the app is fully launched": "",
"Passport No": "",
"Please enter": "",
"Address": "",
"Documents check": "",
"Categories": "",
"Status": "",
"insert Driver phone": "",
"brown": "",
"Best Drivers": "",
"Apply Ride": "",
"Latest Ride": "",
"purple": "",
"No Car found yet": "",
"Insert phone of Driver": "",
"Passengers Rated": "",
"Last Payment Method": "",
"Insert phone of Owner": "",
"VIN": "",
"bronze": "",
"dark blue": "",
"white": "",
"id_card_back": ""
}

222
lib/translations_en.json Normal file
View File

@@ -0,0 +1,222 @@
{
"Insert Name of Driver": "",
"raw gray": "",
"Expiration Date": "",
"Insert site of Driver": "",
"Insert Name of Owner": "",
"Insert car_type of Driver": "",
"car_license_front": "",
"Alexandria": "",
"navy": "",
"Displacement": "",
"Insert birth_date of Driver": "",
"Criminal Record": "",
"Model": "",
"License Type": "",
"Birthdate": "",
"Notes": "",
"s License": "",
"Complaints": "",
"Full Name": "",
"Next": "",
"Full Name (Marital)": "",
"Non Egypt": "",
"Giza": "",
";\n static const String stripePublishableKey = ": "",
"magenta": "",
"An error occurred while saving driver data": "",
"Email": "",
"My documents have expired": "",
"Vehicle Information": "",
"Education": "",
"Capture an Image of Your ID Document Back": "",
"Personal Information": "",
"Vehicle Details Front": "",
"Tax Expiry Date": "",
"Insert site of Owner": "",
"ID Documents Back": "",
"settings": "",
"car_license_back": "",
"OK": "",
"Price": "",
"Country": "",
"orange": "",
"pink": "",
"DOB": "",
"Insert license type of Driver": "",
"Card ID": "",
"inspection\",\n \"Capture an Image of Your car license back\":\n \"Capturez une image de votre permis de voiture\",\n \"Capture an Image of Your Drivers License\":\n \"Capturez une image de votre permis de conduire\",\n \"Sign in with Google for easier email and name entry\":\n \"Connectez-vous avec Google pour faciliter la saisie de votre adresse e-mail et de votre nom\",\n \"You will choose allow all the time to be ready receive orders\":\n \"Vous choisirez de permettre à tout moment d": "",
"are you sure to pay to this driver gift": "",
"gold": "",
">Arabic (Egypt)</span>\n </div>\n </div>\n <span title=": "",
"Name (Arabic)": "",
"Driver Information": "",
"Success": "",
"insert passenger phone": "",
"yellow": "",
"Phone": "",
"National ID": "",
"thanks": "",
"Make": "",
"Not found any image": "",
"Save Notes": "",
"cyan": "",
"Insert registration_date of Car": "",
"Bank Information": "",
"best driver": "",
"indigo": "",
"peach": "",
"Ride ID": "",
"Edit car details": "",
"IssueDate": "",
"Fuel Type": "",
"Birth Date": "",
"Marital Status": "",
"Color": "",
"Name": "",
"Created At": "",
"Registration Date": "",
"View complaint": "",
"Enter notes after call": "",
"silver": "",
"Phone Number": "",
"Cropper": "",
"End Time": "",
"Enter notes here...": "",
"ID Documents Front": "",
"unknown_document": "",
": ": "",
"CardID": "",
"Insert national ID of Driver": "",
"Insert car_model of Driver": "",
"mocha": "",
"Capture an Image of Your Driver License": "",
"maroon": "",
"InspectionResult": "",
"Expired Drivers License": "",
"Failed to save driver data": "",
"Upload": "",
"Wallet Information": "",
"Drivers Cant Register": "",
"For Egypt": "",
"Driver Statistics": "",
"Hand Inserting": "",
"navy blue": "",
"Add car": "",
"Bank Code": "",
"Please enter a valid email.": "",
"Religion": "",
"Welcome call": "",
"Non-Egyptian ID Front": "",
"FullName": "",
"Call Driver": "",
"Occupation": "",
"Plate Number": "",
"Inspection Date": "",
"turquoise": "",
"Date": "",
"red ochre": "",
"gray": "",
"Edit car plate": "",
"tawny": "",
"License Categories": "",
"car plate": "",
"Image Upload Failed": "",
"incorrect_document_title": "",
"Expiry Date": "",
"Gender": "",
"Owner Name": "",
"License Information": "",
"Sefer Service": "",
"Add": "",
"expected": "",
"Name (English)": "",
"Distance": "",
"Capture an Image of Your car license back": "",
"Account Number": "",
"I don't have a suitable vehicle": "",
"black": "",
"First Name": "",
"Total Rides": "",
"NationalID": "",
"Avg Passenger Rating": "",
"Notes:": "",
"teal": "",
"National Number": "",
"green": "",
"Chassis": "",
"Insert year of Car": "",
"Average Rating": "",
"Driver details by phone": "",
"Insert all fields": "",
"champagne": "",
"Add Driver Who Wants to Work": "",
"Add Car Who Wants to Work": "",
"I'm not ready yet": "",
"Car Type": "",
"Capture an Image of Your ID Document front": "",
"Capture an Image of Your Criminal Record": "",
"License Expiry Date": "",
"blue": "",
"Done": "",
"Passengers Cant Register": "",
"Fuel": "",
"Total Payments": "",
"red": "",
"Cancel": "",
"Additional comments": "",
"Vehicle Details Back": "",
"detected": "",
"violet": "",
"Capture Image of Non-Egyptian ID Front": "",
"lime": "",
"I need more help understanding the app": "",
"id_card_front": "",
"Payment Method": "",
"Ok": "",
"Wallet Balance": "",
"Last Payment Amount": "",
"Owner": "",
"Order": "",
"Year": "",
"Capture an Image of Your car license front": "",
"Scam Reports": "",
"Welcome Drivers": "",
"Search by phone number": "",
"verdi": "",
"Please enter a valid phone number.": "",
"Save Changes": "",
"Employment": "",
"Issue Date": "",
"passenger details by phone": "",
"Insert car_number of Driver": "",
"hand inserting": "",
"driver_license": "",
"Error": "",
"Car Details": "",
"uploaded sucssefuly": "",
"Start Time": "",
"I'll register when the app is fully launched": "",
"Passport No": "",
"Please enter": "",
"Address": "",
"Documents check": "",
"Categories": "",
"Status": "",
"insert Driver phone": "",
"brown": "",
"Best Drivers": "",
"Apply Ride": "",
"Latest Ride": "",
"purple": "",
"No Car found yet": "",
"Insert phone of Driver": "",
"Passengers Rated": "",
"Last Payment Method": "",
"Insert phone of Owner": "",
"VIN": "",
"bronze": "",
"dark blue": "",
"white": "",
"id_card_back": ""
}

View File

@@ -1,14 +1,20 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:service/constant/colors.dart';
import 'package:service/constant/links.dart';
import 'package:service/controller/functions/crud.dart';
import 'package:service/controller/mainController/main_controller.dart'; import 'package:service/controller/mainController/main_controller.dart';
import 'package:service/controller/mainController/pages/best_driver_page.dart';
import 'package:service/controller/mainController/pages/complaint.dart'; import 'package:service/controller/mainController/pages/complaint.dart';
import 'package:service/controller/mainController/pages/edit_car_plate.dart'; import 'package:service/controller/mainController/pages/edit_car_plate.dart';
import 'package:service/controller/mainController/pages/passengers_cant_regster.dart'; import 'package:service/controller/mainController/pages/passengers_cant_regster.dart';
import 'package:service/views/widgets/elevated_btn.dart';
import 'package:service/views/widgets/my_dialog.dart'; import 'package:service/views/widgets/my_dialog.dart';
import 'package:service/views/widgets/my_textField.dart'; import 'package:service/views/widgets/my_textField.dart';
import '../../constant/style.dart'; import '../../constant/style.dart';
import '../../controller/mainController/pages/add_car.dart'; import '../../controller/mainController/pages/add_car.dart';
import '../../controller/mainController/pages/contact_page.dart';
import '../../controller/mainController/pages/drivers_cant_register.dart'; import '../../controller/mainController/pages/drivers_cant_register.dart';
import '../../controller/mainController/pages/welcome_call.dart'; import '../../controller/mainController/pages/welcome_call.dart';
import '../widgets/my_scafold.dart'; import '../widgets/my_scafold.dart';
@@ -217,6 +223,252 @@ class Main extends StatelessWidget {
), ),
), ),
), ),
const SizedBox(
height: 20,
),
InkWell(
onTap: () async {
await mainController.getNewDriverRegister();
// if (mainController.carPlateNotEdit.isNotEmpty) {
Get.to(() => DriverTheBest());
// }
},
child: Container(
decoration: AppStyle.boxDecoration,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
"best driver".tr,
style: AppStyle.title,
textAlign: TextAlign.center,
),
),
),
),
const SizedBox(
height: 20,
),
InkWell(
onTap: () async {
Get.defaultDialog(
barrierDismissible: false,
title: "Add Driver Who Wants to Work".tr,
content: SizedBox(
width: Get.width * .7,
height: 300,
child: Form(
key: mainController.formKey,
child: ListView(
children: [
MyTextForm(
controller: mainController.driverNameController,
label: 'Insert Name of Driver'.tr,
hint: 'Insert Name of Driver'.tr,
type: TextInputType.name),
MyTextForm(
controller: mainController.nationalIdController,
label: 'Insert national ID of Driver'.tr,
hint: 'Insert national ID of Driver'.tr,
type: TextInputType.number),
MyTextForm(
controller: mainController.phoneController,
label: 'Insert phone of Driver'.tr,
hint: 'Insert phone of Driver'.tr,
type: TextInputType.phone),
MyTextForm(
controller: mainController.licenseTypeController,
label: 'Insert license type of Driver'.tr,
hint: 'Insert license type of Driver'.tr,
type: TextInputType.name),
MyTextForm(
controller: mainController.siteDriverController,
label: 'Insert site of Driver'.tr,
hint: 'Insert site of Driver'.tr,
type: TextInputType.name),
MyTextForm(
controller: mainController.birthDateController,
label: 'Insert birth_date of Driver'.tr,
hint: 'Insert license type of Driver'.tr,
type: TextInputType.number),
],
)),
),
confirm: MyElevatedButton(
title: 'Add'.tr,
onPressed: () async {
if (mainController.formKey.currentState!.validate()) {
var res = await CRUD()
.post(link: AppLink.addDriverWantWork, payload: {
"driver_name": mainController.driverNameController.text,
"national_id": mainController.nationalIdController.text,
"birth_date": mainController.birthDateController.text,
"site": mainController.siteDriverController.text,
"license_type":
mainController.licenseTypeController.text,
"phone": mainController.phoneController.text,
});
if (res != 'failure') {
Get.back();
mainController.driverNameController.clear();
mainController.nationalIdController.clear();
mainController.birthDateController.clear();
mainController.licenseTypeController.clear();
mainController.siteDriverController.clear();
mainController.phoneController.clear();
Get.snackbar('done', '',
backgroundColor: AppColor.greenColor);
}
}
},
kolor: AppColor.greenColor,
),
cancel: MyElevatedButton(
title: 'Cancel'.tr,
kolor: AppColor.redColor,
onPressed: () {
Get.back();
}),
);
},
child: Container(
decoration: AppStyle.boxDecoration,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
"Add Driver Who Wants to Work".tr,
style: AppStyle.title,
textAlign: TextAlign.center,
),
),
),
),
const SizedBox(
height: 20,
),
InkWell(
onTap: () async {
Get.defaultDialog(
barrierDismissible: false,
title: "Add Car Who Wants to Work".tr,
content: SizedBox(
width: Get.width * .7,
height: 300,
child: Form(
key: mainController.formKey,
child: ListView(
children: [
MyTextForm(
controller: mainController.carOwnerWorkController,
label: 'Insert Name of Owner'.tr,
hint: 'Insert Name of Owner'.tr,
type: TextInputType.name),
MyTextForm(
controller: mainController.carNumberController,
label: 'Insert car_number of Driver'.tr,
hint: 'Insert car_number of Driver'.tr,
type: TextInputType.name),
MyTextForm(
controller: mainController.phoneCarController,
label: 'Insert phone of Owner'.tr,
hint: 'Insert phone of Owner'.tr,
type: TextInputType.phone),
MyTextForm(
controller:
mainController.manufactureYearController,
label: 'Insert year of Car'.tr,
hint: 'Insert year of Car'.tr,
type: TextInputType.number),
MyTextForm(
controller: mainController.carModelController,
label: 'Insert car_model of Driver'.tr,
hint: 'Insert car_model of Driver'.tr,
type: TextInputType.name),
MyTextForm(
controller: mainController.siteCarController,
label: 'Insert site of Owner'.tr,
hint: 'Insert site of Owner'.tr,
type: TextInputType.name),
MyTextForm(
controller: mainController.carTypeController,
label: 'Insert car_type of Driver'.tr,
hint: 'Insert car_type of Driver'.tr,
type: TextInputType.name),
MyTextForm(
controller:
mainController.registrationDateController,
label: 'Insert registration_date of Car'.tr,
hint: 'Insert registration_date of Car'.tr,
type: TextInputType.datetime),
],
)),
),
confirm: MyElevatedButton(
title: 'Add'.tr,
onPressed: () async {
if (mainController.formKey.currentState!.validate()) {
var res = await CRUD()
.post(link: AppLink.addCarWantWork, payload: {
"owner_name":
mainController.carOwnerWorkController.text,
"car_number": mainController.carNumberController.text,
"manufacture_year":
mainController.manufactureYearController.text,
"car_model": mainController.carModelController.text,
"car_type": mainController.carTypeController.text,
"site": mainController.siteCarController.text,
"registration_date":
mainController.registrationDateController.text,
"phone": mainController.phoneCarController.text,
});
if (res != 'failure') {
Get.back();
mainController.ownerController.clear();
mainController.carNumberController.clear();
mainController.manufactureYearController.clear();
mainController.carModelController.clear();
mainController.siteCarController.clear();
mainController.carTypeController.clear();
mainController.registrationDateController.clear();
mainController.phoneController.clear();
Get.snackbar('done', '',
backgroundColor: AppColor.greenColor);
}
}
},
kolor: AppColor.greenColor,
),
cancel: MyElevatedButton(
title: 'Cancel'.tr,
kolor: AppColor.redColor,
onPressed: () {
Get.back();
}),
);
},
child: Container(
decoration: AppStyle.boxDecoration,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
"Add Car Who Wants to Work".tr,
style: AppStyle.title,
textAlign: TextAlign.center,
),
),
),
),
const SizedBox(
height: 20,
),
// GestureDetector(
// onTap: () {
// Get.to(() => const ContactPage());
// },
// child: Container(
// decoration: AppStyle.boxDecoration,
// child: const Center(child: Text('contact')),
// ),
// )
], ],
) )
]); ]);

View File

@@ -1,4 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import '../../constant/colors.dart';
class MyCircularProgressIndicator extends StatelessWidget { class MyCircularProgressIndicator extends StatelessWidget {
final Color backgroundColor; final Color backgroundColor;
@@ -35,3 +40,121 @@ class MyCircularProgressIndicator extends StatelessWidget {
); );
} }
} }
class SnackbarConfig {
static const duration = Duration(seconds: 3);
static const animationDuration = Duration(milliseconds: 300);
static const margin = EdgeInsets.symmetric(horizontal: 16, vertical: 10);
static const borderRadius = 12.0;
static const elevation = 6.0;
static final BoxShadow shadow = BoxShadow(
color: Colors.black.withOpacity(0.1),
blurRadius: 10,
offset: const Offset(0, 2),
);
}
SnackbarController mySnackeBarError(String message) {
// Trigger error haptic feedback
HapticFeedback.mediumImpact();
return Get.snackbar(
'Error'.tr,
message,
backgroundColor: AppColor.redColor.withOpacity(0.95),
colorText: AppColor.secondaryColor,
icon: const Icon(
Icons.error_outline_rounded,
color: AppColor.secondaryColor,
size: 28,
),
shouldIconPulse: true,
snackPosition: SnackPosition.TOP,
margin: SnackbarConfig.margin,
borderRadius: SnackbarConfig.borderRadius,
duration: SnackbarConfig.duration,
animationDuration: SnackbarConfig.animationDuration,
forwardAnimationCurve: Curves.easeOutCirc,
reverseAnimationCurve: Curves.easeInCirc,
boxShadows: [SnackbarConfig.shadow],
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
titleText: Text(
'Error'.tr,
style: const TextStyle(
fontWeight: FontWeight.w700,
color: Colors.white,
fontSize: 16,
letterSpacing: 0.2,
),
),
messageText: Text(
message,
style: TextStyle(
color: Colors.white.withOpacity(0.95),
fontSize: 14,
height: 1.3,
),
),
onTap: (_) {
HapticFeedback.lightImpact();
Get.closeCurrentSnackbar();
},
isDismissible: true,
dismissDirection: DismissDirection.horizontal,
overlayBlur: 0.8,
overlayColor: Colors.black12,
);
}
SnackbarController mySnackbarSuccess(String message) {
// Trigger success haptic feedback
HapticFeedback.lightImpact();
return Get.snackbar(
'Success'.tr,
message,
backgroundColor: AppColor.greenColor.withOpacity(0.95),
colorText: AppColor.secondaryColor,
icon: const Icon(
Icons.check_circle_outline_rounded,
color: AppColor.secondaryColor,
size: 28,
),
shouldIconPulse: true,
snackPosition: SnackPosition.TOP,
margin: SnackbarConfig.margin,
borderRadius: SnackbarConfig.borderRadius,
duration: SnackbarConfig.duration,
animationDuration: SnackbarConfig.animationDuration,
forwardAnimationCurve: Curves.easeOutCirc,
reverseAnimationCurve: Curves.easeInCirc,
boxShadows: [SnackbarConfig.shadow],
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
titleText: Text(
'Success'.tr,
style: const TextStyle(
fontWeight: FontWeight.w700,
color: Colors.white,
fontSize: 16,
letterSpacing: 0.2,
),
),
messageText: Text(
message,
style: TextStyle(
color: Colors.white.withOpacity(0.95),
fontSize: 14,
height: 1.3,
),
),
onTap: (_) {
HapticFeedback.lightImpact();
Get.closeCurrentSnackbar();
},
isDismissible: true,
dismissDirection: DismissDirection.horizontal,
overlayBlur: 0.8,
overlayColor: Colors.black12,
);
}

View File

@@ -14,7 +14,7 @@ import flutter_image_compress_macos
import flutter_secure_storage_macos import flutter_secure_storage_macos
import google_sign_in_ios import google_sign_in_ios
import path_provider_foundation import path_provider_foundation
import sqflite import sqflite_darwin
import url_launcher_macos import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {

File diff suppressed because it is too large Load Diff

View File

@@ -40,23 +40,28 @@ dependencies:
firebase_core: ^3.1.1 firebase_core: ^3.1.1
path: ^1.9.0 path: ^1.9.0
sqflite: ^2.3.3+1 sqflite: ^2.3.3+1
intl: ^0.19.0 intl: ^0.20.2
http: ^1.2.1 http: ^1.2.1
get: ^4.6.6 get: ^4.6.6
get_storage: ^2.1.1 get_storage: ^2.1.1
url_launcher: ^6.3.0 url_launcher: ^6.3.0
flutter_launcher_icons: ^0.13.1 flutter_launcher_icons: ^0.14.3
envied: ^0.5.4+1 envied: ^1.1.1
share: ^2.0.4 share: ^2.0.4
google_sign_in: ^6.2.1 google_sign_in: ^6.2.1
firebase_auth: ^5.1.1 firebase_auth: ^5.1.1
vibration: ^1.9.0 vibration: ^3.1.3
flutter_secure_storage: ^9.2.2 flutter_secure_storage: ^9.2.2
crypto: ^3.0.3 crypto: ^3.0.3
flutter_image_compress: ^2.3.0 flutter_image_compress: ^2.3.0
image: ^4.1.3 #to be remove image: ^4.1.3 #to be remove
image_cropper: ^7.1.0 image_cropper: ^9.0.0
image_picker: ^1.0.4 image_picker: ^1.0.4
contacts_service: ^0.6.3
permission_handler: ^11.3.1
google_fonts: ^6.2.1
jwt_decoder: ^2.0.1
encrypt: ^5.0.3
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
@@ -67,9 +72,9 @@ dev_dependencies:
# activated in the `analysis_options.yaml` file located at the root of your # activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint # package. See that file for information about deactivating specific lint
# rules and activating additional ones. # rules and activating additional ones.
flutter_lints: ^4.0.0 flutter_lints: ^5.0.0
build_runner: ^2.4.11 build_runner: ^2.4.11
envied_generator: ^0.5.4+1 envied_generator: ^1.1.1
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec

222
translations_ar.json Normal file
View File

@@ -0,0 +1,222 @@
{
"License Information": "",
"Apply Ride": "",
"red": "",
"Start Time": "",
"best driver": "",
"expected": "",
"OK": "",
"Passengers Cant Register": "",
"Insert all fields": "",
"id_card_back": "",
"National Number": "",
"violet": "",
"Name (Arabic)": "",
"Driver Statistics": "",
"detected": "",
"Status": "",
"Scam Reports": "",
"Insert car_number of Driver": "",
"mocha": "",
"Insert phone of Driver": "",
"blue": "",
"are you sure to pay to this driver gift": "",
"Please enter": "",
";\n static const String stripePublishableKey = ": "",
"Capture Image of Non-Egyptian ID Front": "",
"Insert phone of Owner": "",
"Last Payment Method": "",
"Country": "",
"I'm not ready yet": "",
"First Name": "",
"Driver Information": "",
"Order": "",
"Add Driver Who Wants to Work": "",
"Vehicle Details Front": "",
"Total Payments": "",
"uploaded sucssefuly": "",
"Drivers Cant Register": "",
"I need more help understanding the app": "",
"Edit car details": "",
"Owner": "",
"Date": "",
"orange": "",
"navy": "",
"An error occurred while saving driver data": "",
"Education": "",
"dark blue": "",
"Non Egypt": "",
"champagne": "",
"Ride ID": "",
"Year": "",
"Wallet Balance": "",
"Categories": "",
"Alexandria": "",
"Passengers Rated": "",
"DOB": "",
"silver": "",
"brown": "",
"Car Details": "",
"Welcome call": "",
"Latest Ride": "",
"Make": "",
"Email": "",
"Religion": "",
"Birth Date": "",
"Error": "",
"yellow": "",
"turquoise": "",
"NationalID": "",
"View complaint": "",
"Insert site of Owner": "",
"Add car": "",
"Insert Name of Owner": "",
"License Expiry Date": "",
"Gender": "",
"Capture an Image of Your car license back": "",
"Total Rides": "",
"thanks": "",
"Image Upload Failed": "",
"teal": "",
"s License": "",
"Capture an Image of Your ID Document front": "",
"Marital Status": "",
"Fuel": "",
"License Categories": "",
"Car Type": "",
"Please enter a valid email.": "",
"hand inserting": "",
"National ID": "",
"Save Changes": "",
"Insert site of Driver": "",
"car_license_front": "",
"Vehicle Details Back": "",
"License Type": "",
"Last Payment Amount": "",
"navy blue": "",
"insert passenger phone": "",
"id_card_front": "",
"Personal Information": "",
"Registration Date": "",
"Add": "",
"green": "",
"Expiration Date": "",
"Avg Passenger Rating": "",
"Search by phone number": "",
"Card ID": "",
"insert Driver phone": "",
"Not found any image": "",
"gold": "",
"verdi": "",
"CardID": "",
"Name": "",
"Driver details by phone": "",
"Sefer Service": "",
"I don't have a suitable vehicle": "",
"Additional comments": "",
"Save Notes": "",
"Tax Expiry Date": "",
"Failed to save driver data": "",
"For Egypt": "",
"No Car found yet": "",
"Capture an Image of Your ID Document Back": "",
"Account Number": "",
"Hand Inserting": "",
"Complaints": "",
"Passport No": "",
"Employment": "",
"Cancel": "",
"Add Car Who Wants to Work": "",
"Criminal Record": "",
"Done": "",
"Notes": "",
"Documents check": "",
"cyan": "",
"Displacement": "",
"settings": "",
"ID Documents Front": "",
"Insert national ID of Driver": "",
"Phone": "",
"Edit car plate": "",
"Full Name (Marital)": "",
"Insert Name of Driver": "",
"Call Driver": "",
"FullName": "",
"VIN": "",
"Payment Method": "",
"Birthdate": "",
"incorrect_document_title": "",
"End Time": "",
"Insert year of Car": "",
"Insert car_model of Driver": "",
"Color": "",
"Upload": "",
"Expiry Date": "",
"Next": "",
"Bank Information": "",
"Insert birth_date of Driver": "",
"passenger details by phone": "",
"car plate": "",
"Insert license type of Driver": "",
"Please enter a valid phone number.": "",
"Welcome Drivers": "",
"Vehicle Information": "",
"Created At": "",
"Capture an Image of Your car license front": "",
"Cropper": "",
"Price": "",
"tawny": "",
"Insert car_type of Driver": "",
"peach": "",
"Ok": "",
"unknown_document": "",
": ": "",
"indigo": "",
"Giza": "",
"maroon": "",
"Insert registration_date of Car": "",
"Fuel Type": "",
"Plate Number": "",
"lime": "",
"Full Name": "",
"InspectionResult": "",
"Enter notes here...": "",
"gray": "",
"pink": "",
"Inspection Date": "",
"Enter notes after call": "",
"Name (English)": "",
"black": "",
"Model": "",
"purple": "",
"Notes:": "",
"Occupation": "",
">Arabic (Egypt)</span>\n </div>\n </div>\n <span title=": "",
"I'll register when the app is fully launched": "",
"raw gray": "",
"ID Documents Back": "",
"Address": "",
"Capture an Image of Your Driver License": "",
"white": "",
"Expired Drivers License": "",
"Distance": "",
"Chassis": "",
"Issue Date": "",
"Wallet Information": "",
"magenta": "",
"Success": "",
"bronze": "",
"My documents have expired": "",
"Non-Egyptian ID Front": "",
"Best Drivers": "",
"Capture an Image of Your Criminal Record": "",
"Owner Name": "",
"Phone Number": "",
"IssueDate": "",
"Bank Code": "",
"inspection\",\n \"Capture an Image of Your car license back\":\n \"Capturez une image de votre permis de voiture\",\n \"Capture an Image of Your Drivers License\":\n \"Capturez une image de votre permis de conduire\",\n \"Sign in with Google for easier email and name entry\":\n \"Connectez-vous avec Google pour faciliter la saisie de votre adresse e-mail et de votre nom\",\n \"You will choose allow all the time to be ready receive orders\":\n \"Vous choisirez de permettre à tout moment d": "",
"Average Rating": "",
"driver_license": "",
"red ochre": "",
"car_license_back": ""
}

222
translations_en.json Normal file
View File

@@ -0,0 +1,222 @@
{
"License Information": "",
"Apply Ride": "",
"red": "",
"Start Time": "",
"best driver": "",
"expected": "",
"OK": "",
"Passengers Cant Register": "",
"Insert all fields": "",
"id_card_back": "",
"National Number": "",
"violet": "",
"Name (Arabic)": "",
"Driver Statistics": "",
"detected": "",
"Status": "",
"Scam Reports": "",
"Insert car_number of Driver": "",
"mocha": "",
"Insert phone of Driver": "",
"blue": "",
"are you sure to pay to this driver gift": "",
"Please enter": "",
";\n static const String stripePublishableKey = ": "",
"Capture Image of Non-Egyptian ID Front": "",
"Insert phone of Owner": "",
"Last Payment Method": "",
"Country": "",
"I'm not ready yet": "",
"First Name": "",
"Driver Information": "",
"Order": "",
"Add Driver Who Wants to Work": "",
"Vehicle Details Front": "",
"Total Payments": "",
"uploaded sucssefuly": "",
"Drivers Cant Register": "",
"I need more help understanding the app": "",
"Edit car details": "",
"Owner": "",
"Date": "",
"orange": "",
"navy": "",
"An error occurred while saving driver data": "",
"Education": "",
"dark blue": "",
"Non Egypt": "",
"champagne": "",
"Ride ID": "",
"Year": "",
"Wallet Balance": "",
"Categories": "",
"Alexandria": "",
"Passengers Rated": "",
"DOB": "",
"silver": "",
"brown": "",
"Car Details": "",
"Welcome call": "",
"Latest Ride": "",
"Make": "",
"Email": "",
"Religion": "",
"Birth Date": "",
"Error": "",
"yellow": "",
"turquoise": "",
"NationalID": "",
"View complaint": "",
"Insert site of Owner": "",
"Add car": "",
"Insert Name of Owner": "",
"License Expiry Date": "",
"Gender": "",
"Capture an Image of Your car license back": "",
"Total Rides": "",
"thanks": "",
"Image Upload Failed": "",
"teal": "",
"s License": "",
"Capture an Image of Your ID Document front": "",
"Marital Status": "",
"Fuel": "",
"License Categories": "",
"Car Type": "",
"Please enter a valid email.": "",
"hand inserting": "",
"National ID": "",
"Save Changes": "",
"Insert site of Driver": "",
"car_license_front": "",
"Vehicle Details Back": "",
"License Type": "",
"Last Payment Amount": "",
"navy blue": "",
"insert passenger phone": "",
"id_card_front": "",
"Personal Information": "",
"Registration Date": "",
"Add": "",
"green": "",
"Expiration Date": "",
"Avg Passenger Rating": "",
"Search by phone number": "",
"Card ID": "",
"insert Driver phone": "",
"Not found any image": "",
"gold": "",
"verdi": "",
"CardID": "",
"Name": "",
"Driver details by phone": "",
"Sefer Service": "",
"I don't have a suitable vehicle": "",
"Additional comments": "",
"Save Notes": "",
"Tax Expiry Date": "",
"Failed to save driver data": "",
"For Egypt": "",
"No Car found yet": "",
"Capture an Image of Your ID Document Back": "",
"Account Number": "",
"Hand Inserting": "",
"Complaints": "",
"Passport No": "",
"Employment": "",
"Cancel": "",
"Add Car Who Wants to Work": "",
"Criminal Record": "",
"Done": "",
"Notes": "",
"Documents check": "",
"cyan": "",
"Displacement": "",
"settings": "",
"ID Documents Front": "",
"Insert national ID of Driver": "",
"Phone": "",
"Edit car plate": "",
"Full Name (Marital)": "",
"Insert Name of Driver": "",
"Call Driver": "",
"FullName": "",
"VIN": "",
"Payment Method": "",
"Birthdate": "",
"incorrect_document_title": "",
"End Time": "",
"Insert year of Car": "",
"Insert car_model of Driver": "",
"Color": "",
"Upload": "",
"Expiry Date": "",
"Next": "",
"Bank Information": "",
"Insert birth_date of Driver": "",
"passenger details by phone": "",
"car plate": "",
"Insert license type of Driver": "",
"Please enter a valid phone number.": "",
"Welcome Drivers": "",
"Vehicle Information": "",
"Created At": "",
"Capture an Image of Your car license front": "",
"Cropper": "",
"Price": "",
"tawny": "",
"Insert car_type of Driver": "",
"peach": "",
"Ok": "",
"unknown_document": "",
": ": "",
"indigo": "",
"Giza": "",
"maroon": "",
"Insert registration_date of Car": "",
"Fuel Type": "",
"Plate Number": "",
"lime": "",
"Full Name": "",
"InspectionResult": "",
"Enter notes here...": "",
"gray": "",
"pink": "",
"Inspection Date": "",
"Enter notes after call": "",
"Name (English)": "",
"black": "",
"Model": "",
"purple": "",
"Notes:": "",
"Occupation": "",
">Arabic (Egypt)</span>\n </div>\n </div>\n <span title=": "",
"I'll register when the app is fully launched": "",
"raw gray": "",
"ID Documents Back": "",
"Address": "",
"Capture an Image of Your Driver License": "",
"white": "",
"Expired Drivers License": "",
"Distance": "",
"Chassis": "",
"Issue Date": "",
"Wallet Information": "",
"magenta": "",
"Success": "",
"bronze": "",
"My documents have expired": "",
"Non-Egyptian ID Front": "",
"Best Drivers": "",
"Capture an Image of Your Criminal Record": "",
"Owner Name": "",
"Phone Number": "",
"IssueDate": "",
"Bank Code": "",
"inspection\",\n \"Capture an Image of Your car license back\":\n \"Capturez une image de votre permis de voiture\",\n \"Capture an Image of Your Drivers License\":\n \"Capturez une image de votre permis de conduire\",\n \"Sign in with Google for easier email and name entry\":\n \"Connectez-vous avec Google pour faciliter la saisie de votre adresse e-mail et de votre nom\",\n \"You will choose allow all the time to be ready receive orders\":\n \"Vous choisirez de permettre à tout moment d": "",
"Average Rating": "",
"driver_license": "",
"red ochre": "",
"car_license_back": ""
}

View File

@@ -10,6 +10,7 @@
#include <firebase_auth/firebase_auth_plugin_c_api.h> #include <firebase_auth/firebase_auth_plugin_c_api.h>
#include <firebase_core/firebase_core_plugin_c_api.h> #include <firebase_core/firebase_core_plugin_c_api.h>
#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h> #include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h>
#include <url_launcher_windows/url_launcher_windows.h> #include <url_launcher_windows/url_launcher_windows.h>
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
@@ -21,6 +22,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
FlutterSecureStorageWindowsPluginRegisterWithRegistrar( FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
PermissionHandlerWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
UrlLauncherWindowsRegisterWithRegistrar( UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows")); registry->GetRegistrarForPlugin("UrlLauncherWindows"));
} }

View File

@@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
firebase_auth firebase_auth
firebase_core firebase_core
flutter_secure_storage_windows flutter_secure_storage_windows
permission_handler_windows
url_launcher_windows url_launcher_windows
) )