Initial commit for Tripz Admin

This commit is contained in:
Hamza-Ayed
2026-01-21 17:31:10 +03:00
parent 5919554eaa
commit 1da2357124
31 changed files with 1812 additions and 980 deletions

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

@@ -25,8 +25,8 @@ if (flutterVersionName == null) {
android { android {
namespace = "com.example.sefer_admin1" namespace = "com.example.sefer_admin1"
compileSdk = flutter.compileSdkVersion compileSdk = 35
ndkVersion = "26.1.10909125" ndkVersion = '27.0.12077973'
compileOptions { compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_1_8
@@ -42,6 +42,7 @@ android {
targetSdk = flutter.targetSdkVersion targetSdk = flutter.targetSdkVersion
versionCode = flutterVersionCode.toInteger() versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName versionName = flutterVersionName
multiDexEnabled = true
} }
buildTypes { buildTypes {

View File

@@ -8,7 +8,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:8.0.2' // Use a compatible AGP version classpath 'com.android.tools.build:gradle:8.8.0' // Use a compatible AGP version
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }
} }

View File

@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip

View File

@@ -19,7 +19,7 @@ pluginManagement {
plugins { plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version '8.0.2' apply false id "com.android.application" version '8.8.0' apply false
// START: FlutterFire Configuration // START: FlutterFire Configuration
id "com.google.gms.google-services" version "4.3.15" apply false id "com.google.gms.google-services" version "4.3.15" apply false
// END: FlutterFire Configuration // END: FlutterFire Configuration

View File

@@ -1,15 +1,17 @@
# Uncomment this line to define a global platform for your project # Define the minimum iOS deployment target
platform :ios, '14.0' platform :ios, '14.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. # Disable CocoaPods analytics to improve Flutter build latency
ENV['COCOAPODS_DISABLE_STATS'] = 'true' ENV['COCOAPODS_DISABLE_STATS'] = 'true'
# Define Flutter project configurations
project 'Runner', { project 'Runner', {
'Debug' => :debug, 'Debug' => :debug,
'Profile' => :release, 'Profile' => :release,
'Release' => :release, 'Release' => :release,
} }
# Helper function to locate the Flutter installation path
def flutter_root def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path) unless File.exist?(generated_xcode_build_settings_path)
@@ -25,20 +27,42 @@ end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
# Set up Flutter iOS Pods
flutter_ios_podfile_setup flutter_ios_podfile_setup
target 'Runner' do target 'Runner' do
use_frameworks! # Enable modular headers and static linkage for better compatibility
use_modular_headers! use_frameworks! :linkage => :static
# Install all Flutter-related pods
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
# Test target configuration
target 'RunnerTests' do target 'RunnerTests' do
inherit! :search_paths inherit! :search_paths
end end
end end
# Post-install configurations for CocoaPods
post_install do |installer| post_install do |installer|
installer.pods_project.targets.each do |target| installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target) flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
# Ensure compatibility with non-modular includes
config.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
# Set the iOS deployment target
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
# Enable dynamic library distribution for compatibility
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
# Restrict builds to active architecture for simulators
config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
# Define the module for compatibility
config.build_settings['DEFINES_MODULE'] = 'YES'
end
end end
end end

View File

@@ -1,69 +1,69 @@
PODS: PODS:
- AppAuth (1.7.5): - AppAuth (1.7.6):
- AppAuth/Core (= 1.7.5) - AppAuth/Core (= 1.7.6)
- AppAuth/ExternalUserAgent (= 1.7.5) - AppAuth/ExternalUserAgent (= 1.7.6)
- AppAuth/Core (1.7.5) - AppAuth/Core (1.7.6)
- AppAuth/ExternalUserAgent (1.7.5): - AppAuth/ExternalUserAgent (1.7.6):
- AppAuth/Core - AppAuth/Core
- Firebase/CoreOnly (10.25.0): - Firebase/CoreOnly (11.4.0):
- FirebaseCore (= 10.25.0) - FirebaseCore (= 11.4.0)
- Firebase/Crashlytics (10.25.0): - Firebase/Crashlytics (11.4.0):
- Firebase/CoreOnly - Firebase/CoreOnly
- FirebaseCrashlytics (~> 10.25.0) - FirebaseCrashlytics (~> 11.4.0)
- Firebase/Messaging (10.25.0): - Firebase/Messaging (11.4.0):
- Firebase/CoreOnly - Firebase/CoreOnly
- FirebaseMessaging (~> 10.25.0) - FirebaseMessaging (~> 11.4.0)
- firebase_core (2.32.0): - firebase_core (3.9.0):
- Firebase/CoreOnly (= 10.25.0) - Firebase/CoreOnly (= 11.4.0)
- Flutter - Flutter
- firebase_crashlytics (3.5.7): - firebase_crashlytics (4.2.0):
- Firebase/Crashlytics (= 10.25.0) - Firebase/Crashlytics (= 11.4.0)
- firebase_core - firebase_core
- Flutter - Flutter
- firebase_messaging (14.9.4): - firebase_messaging (15.1.6):
- Firebase/Messaging (= 10.25.0) - Firebase/Messaging (= 11.4.0)
- firebase_core - firebase_core
- Flutter - Flutter
- FirebaseCore (10.25.0): - FirebaseCore (11.4.0):
- FirebaseCoreInternal (~> 10.0) - FirebaseCoreInternal (~> 11.0)
- GoogleUtilities/Environment (~> 7.12) - GoogleUtilities/Environment (~> 8.0)
- GoogleUtilities/Logger (~> 7.12) - GoogleUtilities/Logger (~> 8.0)
- FirebaseCoreExtension (10.29.0): - FirebaseCoreExtension (11.4.1):
- FirebaseCore (~> 10.0) - FirebaseCore (~> 11.0)
- FirebaseCoreInternal (10.27.0): - FirebaseCoreInternal (11.6.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)" - "GoogleUtilities/NSData+zlib (~> 8.0)"
- FirebaseCrashlytics (10.25.0): - FirebaseCrashlytics (11.4.0):
- FirebaseCore (~> 10.5) - FirebaseCore (~> 11.4)
- FirebaseInstallations (~> 10.0) - FirebaseInstallations (~> 11.0)
- FirebaseRemoteConfigInterop (~> 10.23) - FirebaseRemoteConfigInterop (~> 11.0)
- FirebaseSessions (~> 10.5) - FirebaseSessions (~> 11.0)
- GoogleDataTransport (~> 9.2) - GoogleDataTransport (~> 10.0)
- GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/Environment (~> 8.0)
- nanopb (< 2.30911.0, >= 2.30908.0) - nanopb (~> 3.30910.0)
- PromisesObjC (~> 2.1) - PromisesObjC (~> 2.4)
- FirebaseInstallations (10.27.0): - FirebaseInstallations (11.4.0):
- FirebaseCore (~> 10.0) - FirebaseCore (~> 11.0)
- GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/Environment (~> 8.0)
- GoogleUtilities/UserDefaults (~> 7.8) - GoogleUtilities/UserDefaults (~> 8.0)
- PromisesObjC (~> 2.1) - PromisesObjC (~> 2.4)
- FirebaseMessaging (10.25.0): - FirebaseMessaging (11.4.0):
- FirebaseCore (~> 10.0) - FirebaseCore (~> 11.0)
- FirebaseInstallations (~> 10.0) - FirebaseInstallations (~> 11.0)
- GoogleDataTransport (~> 9.3) - GoogleDataTransport (~> 10.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.8) - GoogleUtilities/AppDelegateSwizzler (~> 8.0)
- GoogleUtilities/Environment (~> 7.8) - GoogleUtilities/Environment (~> 8.0)
- GoogleUtilities/Reachability (~> 7.8) - GoogleUtilities/Reachability (~> 8.0)
- GoogleUtilities/UserDefaults (~> 7.8) - GoogleUtilities/UserDefaults (~> 8.0)
- nanopb (< 2.30911.0, >= 2.30908.0) - nanopb (~> 3.30910.0)
- FirebaseRemoteConfigInterop (10.29.0) - FirebaseRemoteConfigInterop (11.6.0)
- FirebaseSessions (10.29.0): - FirebaseSessions (11.4.0):
- FirebaseCore (~> 10.5) - FirebaseCore (~> 11.4)
- FirebaseCoreExtension (~> 10.0) - FirebaseCoreExtension (~> 11.4)
- FirebaseInstallations (~> 10.0) - FirebaseInstallations (~> 11.0)
- GoogleDataTransport (~> 9.2) - GoogleDataTransport (~> 10.0)
- GoogleUtilities/Environment (~> 7.13) - GoogleUtilities/Environment (~> 8.0)
- GoogleUtilities/UserDefaults (~> 7.13) - GoogleUtilities/UserDefaults (~> 8.0)
- nanopb (< 2.30911.0, >= 2.30908.0) - nanopb (~> 3.30910.0)
- PromisesSwift (~> 2.1) - PromisesSwift (~> 2.1)
- Flutter (1.0.0) - Flutter (1.0.0)
- flutter_image_compress_common (1.0.0): - flutter_image_compress_common (1.0.0):
@@ -79,46 +79,44 @@ PODS:
- FlutterMacOS - FlutterMacOS
- GoogleSignIn (~> 7.1) - GoogleSignIn (~> 7.1)
- GTMSessionFetcher (>= 3.4.0) - GTMSessionFetcher (>= 3.4.0)
- GoogleDataTransport (9.4.1): - GoogleDataTransport (10.1.0):
- GoogleUtilities/Environment (~> 7.7) - nanopb (~> 3.30910.0)
- nanopb (< 2.30911.0, >= 2.30908.0) - PromisesObjC (~> 2.4)
- PromisesObjC (< 3.0, >= 1.2)
- GoogleSignIn (7.1.0): - GoogleSignIn (7.1.0):
- AppAuth (< 2.0, >= 1.7.3) - AppAuth (< 2.0, >= 1.7.3)
- GTMAppAuth (< 5.0, >= 4.1.1) - GTMAppAuth (< 5.0, >= 4.1.1)
- GTMSessionFetcher/Core (~> 3.3) - GTMSessionFetcher/Core (~> 3.3)
- GoogleUtilities/AppDelegateSwizzler (7.13.3): - GoogleUtilities/AppDelegateSwizzler (8.0.2):
- GoogleUtilities/Environment - GoogleUtilities/Environment
- GoogleUtilities/Logger - GoogleUtilities/Logger
- GoogleUtilities/Network - GoogleUtilities/Network
- GoogleUtilities/Privacy - GoogleUtilities/Privacy
- GoogleUtilities/Environment (7.13.3): - GoogleUtilities/Environment (8.0.2):
- GoogleUtilities/Privacy - GoogleUtilities/Privacy
- PromisesObjC (< 3.0, >= 1.2) - GoogleUtilities/Logger (8.0.2):
- GoogleUtilities/Logger (7.13.3):
- GoogleUtilities/Environment - GoogleUtilities/Environment
- GoogleUtilities/Privacy - GoogleUtilities/Privacy
- GoogleUtilities/Network (7.13.3): - GoogleUtilities/Network (8.0.2):
- GoogleUtilities/Logger - GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib" - "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Privacy - GoogleUtilities/Privacy
- GoogleUtilities/Reachability - GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (7.13.3)": - "GoogleUtilities/NSData+zlib (8.0.2)":
- GoogleUtilities/Privacy - GoogleUtilities/Privacy
- GoogleUtilities/Privacy (7.13.3) - GoogleUtilities/Privacy (8.0.2)
- GoogleUtilities/Reachability (7.13.3): - GoogleUtilities/Reachability (8.0.2):
- GoogleUtilities/Logger - GoogleUtilities/Logger
- GoogleUtilities/Privacy - GoogleUtilities/Privacy
- GoogleUtilities/UserDefaults (7.13.3): - GoogleUtilities/UserDefaults (8.0.2):
- GoogleUtilities/Logger - GoogleUtilities/Logger
- GoogleUtilities/Privacy - GoogleUtilities/Privacy
- GTMAppAuth (4.1.1): - GTMAppAuth (4.1.1):
- AppAuth/Core (~> 1.7) - AppAuth/Core (~> 1.7)
- GTMSessionFetcher/Core (< 4.0, >= 3.3) - GTMSessionFetcher/Core (< 4.0, >= 3.3)
- GTMSessionFetcher (3.4.1): - GTMSessionFetcher (3.5.0):
- GTMSessionFetcher/Full (= 3.4.1) - GTMSessionFetcher/Full (= 3.5.0)
- GTMSessionFetcher/Core (3.4.1) - GTMSessionFetcher/Core (3.5.0)
- GTMSessionFetcher/Full (3.4.1): - GTMSessionFetcher/Full (3.5.0):
- GTMSessionFetcher/Core - GTMSessionFetcher/Core
- image_cropper (0.0.4): - image_cropper (0.0.4):
- Flutter - Flutter
@@ -139,27 +137,28 @@ PODS:
- libwebp/sharpyuv - libwebp/sharpyuv
- local_auth_darwin (0.0.1): - local_auth_darwin (0.0.1):
- Flutter - Flutter
- FlutterMacOS
- Mantle (2.2.0): - Mantle (2.2.0):
- Mantle/extobjc (= 2.2.0) - Mantle/extobjc (= 2.2.0)
- Mantle/extobjc (2.2.0) - Mantle/extobjc (2.2.0)
- nanopb (2.30910.0): - nanopb (3.30910.0):
- nanopb/decode (= 2.30910.0) - nanopb/decode (= 3.30910.0)
- nanopb/encode (= 2.30910.0) - nanopb/encode (= 3.30910.0)
- nanopb/decode (2.30910.0) - nanopb/decode (3.30910.0)
- nanopb/encode (2.30910.0) - nanopb/encode (3.30910.0)
- path_provider_foundation (0.0.1): - path_provider_foundation (0.0.1):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
- PromisesObjC (2.4.0) - PromisesObjC (2.4.0)
- PromisesSwift (2.4.0): - PromisesSwift (2.4.0):
- PromisesObjC (= 2.4.0) - PromisesObjC (= 2.4.0)
- SDWebImage (5.19.7): - SDWebImage (5.20.0):
- SDWebImage/Core (= 5.19.7) - SDWebImage/Core (= 5.20.0)
- SDWebImage/Core (5.19.7) - SDWebImage/Core (5.20.0)
- SDWebImageWebPCoder (0.14.6): - SDWebImageWebPCoder (0.14.6):
- libwebp (~> 1.0) - libwebp (~> 1.0)
- SDWebImage/Core (~> 5.17) - SDWebImage/Core (~> 5.17)
- sqflite (0.0.3): - sqflite_darwin (0.0.4):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
- TOCropViewController (2.7.4) - TOCropViewController (2.7.4)
@@ -178,7 +177,7 @@ DEPENDENCIES:
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`) - local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- 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`)
SPEC REPOS: SPEC REPOS:
@@ -230,49 +229,49 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/local_auth_darwin/darwin" :path: ".symlinks/plugins/local_auth_darwin/darwin"
path_provider_foundation: path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin" :path: ".symlinks/plugins/path_provider_foundation/darwin"
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"
SPEC CHECKSUMS: SPEC CHECKSUMS:
AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa AppAuth: d4f13a8fe0baf391b2108511793e4b479691fb73
Firebase: 0312a2352584f782ea56f66d91606891d4607f06 Firebase: cf1b19f21410b029b6786a54e9764a0cacad3c99
firebase_core: a626d00494efa398e7c54f25f1454a64c8abf197 firebase_core: b62a5080210edad3f2934314a8b2c6f5124e8e10
firebase_crashlytics: 17e856fabec68d993662abaf2f6fe2413f0abece firebase_crashlytics: 757e252772ed3dd37c07638f9fcd4dceb5f101c8
firebase_messaging: 06391e8f35dc65a00c56580266285263d2861f10 firebase_messaging: 98619a0572d82cfb3668e78859ba9f1110e268c9
FirebaseCore: 7ec4d0484817f12c3373955bc87762d96842d483 FirebaseCore: e0510f1523bc0eb21653cac00792e1e2bd6f1771
FirebaseCoreExtension: 705ca5b14bf71d2564a0ddc677df1fc86ffa600f FirebaseCoreExtension: f1bc67a4702931a7caa097d8e4ac0a1b0d16720e
FirebaseCoreInternal: 4b297a2d56063dbea2c1d0d04222d44a8d058862 FirebaseCoreInternal: d98ab91e2d80a56d7b246856a8885443b302c0c2
FirebaseCrashlytics: 4b96efb0ce73b38b2a85e8b8bd1bd8f63f09d015 FirebaseCrashlytics: 41bbdd2b514a8523cede0c217aee6ef7ecf38401
FirebaseInstallations: 766dabca09fd94aef922538aaf144cc4a6fb6869 FirebaseInstallations: 6ef4a1c7eb2a61ee1f74727d7f6ce2e72acf1414
FirebaseMessaging: 88950ba9485052891ebe26f6c43a52bb62248952 FirebaseMessaging: f8a160d99c2c2e5babbbcc90c4a3e15db036aee2
FirebaseRemoteConfigInterop: 6efda51fb5e2f15b16585197e26eaa09574e8a4d FirebaseRemoteConfigInterop: e75e348953352a000331eb77caf01e424248e176
FirebaseSessions: dbd14adac65ce996228652c1fc3a3f576bdf3ecc FirebaseSessions: 3f56f177d9e53a85021d16b31f9a111849d1dd8b
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: 07375bfbf2620bc93a602c0e27160d6afc6ead38
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleSignIn: d4281ab6cf21542b1cfaff85c191f230b399d2db GoogleSignIn: d4281ab6cf21542b1cfaff85c191f230b399d2db
GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15 GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de
GTMSessionFetcher: 8000756fc1c19d2e5697b90311f7832d2e33f6cd GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6
image_cropper: 37d40f62177c101ff4c164906d259ea2c3aa70cf image_cropper: 37d40f62177c101ff4c164906d259ea2c3aa70cf
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1 image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009 libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009
local_auth_darwin: 4d56c90c2683319835a61274b57620df9c4520ab local_auth_darwin: 66e40372f1c29f383a314c738c7446e2f7fdadc3
Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d
nanopb: 438bc412db1928dac798aa6fd75726007be04262 nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851 PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
SDWebImage: 8a6b7b160b4d710e2a22b6900e25301075c34cb3 SDWebImage: 73c6079366fea25fa4bb9640d5fb58f0893facd8
SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380 SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654 TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
PODFILE CHECKSUM: 1959d098c91d8a792531a723c4a9d7e9f6a01e38 PODFILE CHECKSUM: 2d6dcdfb73160995f364ae9cd67e4000fd6077a8
COCOAPODS: 1.15.2 COCOAPODS: 1.16.2

View File

@@ -202,7 +202,6 @@
97C146EC1CF9000F007C117D /* Resources */, 97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */, 9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
E9260FFCE0F15D904C6E7C16 /* [CP] Embed Pods Frameworks */,
6A69BFBF5DAB5F688C4AF4E3 /* [CP] Copy Pods Resources */, 6A69BFBF5DAB5F688C4AF4E3 /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
@@ -346,23 +345,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
E9260FFCE0F15D904C6E7C16 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
F30F6A7446087F285F80AA2C /* [CP] Check Pods Manifest.lock */ = { F30F6A7446087F285F80AA2C /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;

View File

@@ -4,6 +4,12 @@ import '../env/env.dart';
import 'char_map.dart'; import 'char_map.dart';
class AK { class AK {
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 publishableKey = static final String publishableKey =
X.r(X.r(X.r(Env.stripePublishableKe, cn), cC), cs); X.r(X.r(X.r(Env.stripePublishableKe, cn), cC), cs);
static final String secretKey = X.r(X.r(X.r(Env.secretKey, cn), cC), cs); static final String secretKey = X.r(X.r(X.r(Env.secretKey, cn), cC), cs);

View File

@@ -8,6 +8,14 @@ class BoxName {
static const String carPlate = "carPlate"; static const String carPlate = "carPlate";
static const String statusDriverLocation = "statusDriverLocation"; static const String statusDriverLocation = "statusDriverLocation";
static const String password = "password"; static const String password = "password";
static const String keyOfApp = 'keyOfApp';
static const String initializationVector = 'initializationVector';
static const String firstTimeLoadKey = 'firstTimeLoadKey';
static const String jwt = "jwt";
static const String hmac = "hmac";
static const String fingerPrint = "fingerPrint";
static const String payMobApikey = "payMobApikey";
static const String refreshToken = "refreshToken";
static const String arrivalTime = "arrivalTime"; static const String arrivalTime = "arrivalTime";
static const String passwordDriver = "passwordDriver"; static const String passwordDriver = "passwordDriver";
static const String agreeTerms = "agreeTerms"; static const String agreeTerms = "agreeTerms";

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

@@ -1,19 +1,25 @@
import '../env/env.dart'; import '../env/env.dart';
class AppLink { class AppLink {
static final String seferPaymentServer0 = Env.seferPaymentServer; static String seferPaymentServer = 'https://wl.tripz-egypt.com/v1/main';
static final String seferPaymentServer = '${Env.seferPaymentServer}/ride'; static final String tripzPaymentServer0 = seferPaymentServer;
static final String seferAlexandriaServer = Env.seferAlexandriaServer; static final String tripzPaymentServer = '$seferPaymentServer/ride';
static final String seferCairoServer = Env.seferCairoServer; static final String tripzAlexandriaServer = Env.seferAlexandriaServer;
// static final String seferGizaServer = Env.seferGizaServer; static final String tripzCairoServer = Env.seferCairoServer;
static final String tripzGizaServer = Env.seferGizaServer;
// 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://api.sefer.live/sefer';
static final String server = 'https://api.tripz-egypt.com/tripz';
static String loginJwtDriver =
"https://api.tripz-egypt.com/tripz/loginAdmin.php";
static String getPaymentsDashboard =
"$seferPaymentServer/Admin/getPaymentsDashboard.php";
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';
static String gemini = static String gemini =
'https://generativelanguage.googleapis.com/v1beta3/models/text-bison-001:generateText'; 'https://generativelanguage.googleapis.com/v1beta3/models/text-bison-001:generateText';
static String loginWalletAdmin = "$seferPaymentServer/loginWalletAdmin.php";
static String test = "$server/test.php"; static String test = "$server/test.php";
//===============firebase========================== //===============firebase==========================
@@ -28,14 +34,14 @@ class AppLink {
//=======================Wallet=================== //=======================Wallet===================
static String addPaymentTokenDriver = static String addPaymentTokenDriver =
"$seferPaymentServer/driverWallet/addPaymentToken.php"; "$tripzPaymentServer/driverWallet/addPaymentToken.php";
static String addSeferWallet = "$seferPaymentServer/seferWallet/add.php"; static String addSeferWallet = "$tripzPaymentServer/seferWallet/add.php";
static String getSeferWallet = "$seferPaymentServer/seferWallet/get.php"; static String getSeferWallet = "$tripzPaymentServer/seferWallet/get.php";
static String addDrivePayment = "$seferPaymentServer/payment/add.php"; static String addDrivePayment = "$tripzPaymentServer/payment/add.php";
static String updatePaymetToPaid = static String updatePaymetToPaid =
"$seferPaymentServer/payment/updatePaymetToPaid.php"; "$tripzPaymentServer/payment/updatePaymetToPaid.php";
static String wallet = '$seferPaymentServer/passengerWallet'; static String wallet = '$tripzPaymentServer/passengerWallet';
static String walletDriver = '$seferPaymentServer/driverWallet'; static String walletDriver = '$tripzPaymentServer/driverWallet';
static String getAllPassengerTransaction = static String getAllPassengerTransaction =
"$wallet/getAllPassengerTransaction.php"; "$wallet/getAllPassengerTransaction.php";
static String getWalletByPassenger = "$wallet/getWalletByPassenger.php"; static String getWalletByPassenger = "$wallet/getWalletByPassenger.php";
@@ -85,17 +91,17 @@ class AppLink {
static String addKazanPercent = "$ride/kazan/add.php"; static String addKazanPercent = "$ride/kazan/add.php";
////-----------------DriverPayment------------------ ////-----------------DriverPayment------------------
static String addDriverpayment = "$seferPaymentServer/payment/add.php"; static String addDriverpayment = "$tripzPaymentServer/payment/add.php";
static String addDriverPaymentPoints = static String addDriverPaymentPoints =
"$seferPaymentServer/driverPayment/add.php"; "$tripzPaymentServer/driverPayment/add.php";
static String getDriverPaymentPoints = static String getDriverPaymentPoints =
"$seferPaymentServer/driverWallet/get.php"; "$tripzPaymentServer/driverWallet/get.php";
static String getDriverpaymentToday = "$seferPaymentServer/payment/get.php"; static String getDriverpaymentToday = "$tripzPaymentServer/payment/get.php";
static String getCountRide = "$seferPaymentServer/payment/getCountRide.php"; static String getCountRide = "$tripzPaymentServer/payment/getCountRide.php";
static String getAllPaymentFromRide = static String getAllPaymentFromRide =
"$seferPaymentServer/payment/getAllPayment.php"; "$tripzPaymentServer/payment/getAllPayment.php";
static String getAllPaymentVisa = static String getAllPaymentVisa =
"$seferPaymentServer/payment/getAllPaymentVisa.php"; "$tripzPaymentServer/payment/getAllPaymentVisa.php";
//-----------------Passenger NotificationCaptain------------------ //-----------------Passenger NotificationCaptain------------------
static String addNotificationPassenger = static String addNotificationPassenger =
@@ -166,7 +172,7 @@ class AppLink {
static String sendEmailToPassengerForTripDetails = static String sendEmailToPassengerForTripDetails =
"$ride/rides/emailToPassengerTripDetail.php"; "$ride/rides/emailToPassengerTripDetail.php";
static String sendEmailToDrivertransaction = static String sendEmailToDrivertransaction =
"https://api.sefer.live/sefer/Admin/sendEmailToDrivertransaction.php"; "https://api.tripz-egypt.com/tripz/Admin/sendEmailToDrivertransaction.php";
// =========================================== // ===========================================
static String pathImage = "$server/upload/types/"; static String pathImage = "$server/upload/types/";
@@ -232,6 +238,11 @@ class AppLink {
static String getdashbord = "$server/Admin/dashbord.php"; static String getdashbord = "$server/Admin/dashbord.php";
static String getEmployee = "$server/Admin/employee/get.php"; static String getEmployee = "$server/Admin/employee/get.php";
static String getBestDriver = "$server/Admin/driver/getBestDriver.php"; static String getBestDriver = "$server/Admin/driver/getBestDriver.php";
static String getBestDriverGiza =
"https://gizasefer.online/sefer/Admin/driver/getBestDriver.php";
static String getBestDriverAlexandria =
"$tripzAlexandriaServer/Admin/driver/getBestDriver.php";
static String deleteRecord = "$server/Admin/driver/deleteRecord.php";
static String addEmployee = "$server/Admin/employee/add.php"; static String addEmployee = "$server/Admin/employee/add.php";
static String getdashbordPayment = "$server/Admin/dashbordPayment.php"; static String getdashbordPayment = "$server/Admin/dashbordPayment.php";
static String getAdminUser = "$server/Admin/adminUser/get.php"; static String getAdminUser = "$server/Admin/adminUser/get.php";

View File

@@ -17,18 +17,60 @@ class DashboardController extends GetxController {
final formKey = GlobalKey<FormState>(); final formKey = GlobalKey<FormState>();
final smsText = TextEditingController(); final smsText = TextEditingController();
// Future getDashBoard() async {
// isLoading = true;
// update();
// var res = await CRUD().get(link: AppLink.getdashbord, payload: {});
// if (res != 'failure') {
// var d = jsonDecode(res);
// Log.print('d: ${d}');
// dashbord = d['message'];
// isLoading = false;
// update();
// }
// var res2 = await CRUD().kazumiSMS(
// link: 'https://sms.kazumi.me/api/sms/check-credit',
// payload: {"username": "Sefer", "password": AK.smsPasswordEgypt},
// );
// creditSMS = res2['credit'];
// Log.print(' res2[credit]: ${res2['credit']}');
// Log.print('creditSMS: ${creditSMS}');
// update();
// }
Future getDashBoard() async { Future getDashBoard() async {
isLoading = true; isLoading = true;
update(); update();
// الطلب من السيرفر الرئيسي
var res = await CRUD().get(link: AppLink.getdashbord, payload: {}); var res = await CRUD().get(link: AppLink.getdashbord, payload: {});
if (res != 'failure') { if (res != 'failure') {
var d = jsonDecode(res); var d = jsonDecode(res);
Log.print('d: ${d}'); // Log.print('d: ${d}');
dashbord = d['message']; dashbord = d['message']; // هذا عبارة عن List<Map>
isLoading = false;
update();
} }
// الطلب من سيرفر المحافظ
var resPayments = await CRUD().postWallet(
link: AppLink.getPaymentsDashboard,
payload: {},
);
if (resPayments != 'failure') {
var p = resPayments;
// Log.print('p: ${p}');
// نتأكد أن الكل Map بداخل List
if (dashbord.isNotEmpty &&
p['message'] is List &&
p['message'].isNotEmpty) {
dashbord[0].addAll(p['message'][0]); // ندمج المعلومات داخل نفس الـ Map
}
}
// كريدت الرسائل
var res2 = await CRUD().kazumiSMS( var res2 = await CRUD().kazumiSMS(
link: 'https://sms.kazumi.me/api/sms/check-credit', link: 'https://sms.kazumi.me/api/sms/check-credit',
payload: {"username": "Sefer", "password": AK.smsPasswordEgypt}, payload: {"username": "Sefer", "password": AK.smsPasswordEgypt},
@@ -38,9 +80,11 @@ class DashboardController extends GetxController {
Log.print(' res2[credit]: ${res2['credit']}'); Log.print(' res2[credit]: ${res2['credit']}');
Log.print('creditSMS: ${creditSMS}'); Log.print('creditSMS: ${creditSMS}');
isLoading = false;
update(); update();
} }
sendSMSMethod() async { sendSMSMethod() async {
if (formKey.currentState!.validate()) { if (formKey.currentState!.validate()) {
for (var phoneNumber in box.read(BoxName.tokensDrivers)['message']) { for (var phoneNumber in box.read(BoxName.tokensDrivers)['message']) {

View File

@@ -87,79 +87,104 @@ class StaticController extends GetxController {
} }
Future<void> fetchEmployee() async { Future<void> fetchEmployee() async {
isLoading = true; try {
update(); isLoading = true;
update();
var res = await CRUD().get(link: AppLink.getEmployeeStatic, payload: {}); var res = await CRUD().get(link: AppLink.getEmployeeStatic, payload: {});
var jsonResponse = jsonDecode(res) as Map<String, dynamic>;
isLoading = false;
final List<dynamic> jsonData = jsonResponse['message']; // First check if the response is valid JSON
totalMonthlyRides = jsonData[0]['totalMonthly'].toString(); if (res == 'failure') {
throw FormatException('Invalid response: $res');
// Group data by employee
Map<String, List<MonthlyEmployeeData>> employeeDataMap = {};
for (var item in jsonData) {
var employeeData = MonthlyEmployeeData.fromJson(item);
if (!employeeDataMap.containsKey(employeeData.name)) {
employeeDataMap[employeeData.name] = [];
} }
employeeDataMap[employeeData.name]!.add(employeeData);
var jsonResponse = jsonDecode(res) as Map<String, dynamic>;
// Initialize empty lists for all chart data
chartDataEmployeeMaryam = <FlSpot>[];
chartDataEmployeeRawda = <FlSpot>[];
chartDataEmployeeMena = <FlSpot>[];
chartDataEmployeeSefer4 = <FlSpot>[];
totalMonthlyRides = '0';
// Check for error response
if (jsonResponse['status'] == 'failure') {
isLoading = false;
update();
return;
}
final List<dynamic> jsonData = jsonResponse['message'];
if (jsonData.isEmpty) {
isLoading = false;
update();
return;
}
totalMonthlyRides = jsonData[0]['totalMonthly']?.toString() ?? '0';
// Group data by employee
Map<String, List<MonthlyEmployeeData>> employeeDataMap = {};
for (var item in jsonData) {
var employeeData = MonthlyEmployeeData.fromJson(item);
if (!employeeDataMap.containsKey(employeeData.name)) {
employeeDataMap[employeeData.name] = [];
}
employeeDataMap[employeeData.name]!.add(employeeData);
}
final today = DateTime.now().day;
// Create data for each employee
final employeeNames = {
'maryam': chartDataEmployeeMaryam,
'yasmine': chartDataEmployeeRawda,
'mena': chartDataEmployeeMena,
'ashjan': chartDataEmployeeSefer4,
};
employeeNames.forEach((name, chartData) {
var spots = <FlSpot>[];
for (int day = 1; day <= today; day++) {
spots.add(FlSpot(
day.toDouble(),
employeeDataMap[name]
?.firstWhere(
(e) => e.day == day,
orElse: () => MonthlyEmployeeData(
day: day,
totalEmployees: 0,
name: name,
),
)
.totalEmployees
.toDouble() ??
0,
));
}
// Explicitly cast to List<FlSpot>
if (name == 'maryam')
chartDataEmployeeMaryam = List<FlSpot>.from(spots);
if (name == 'yasmine')
chartDataEmployeeRawda = List<FlSpot>.from(spots);
if (name == 'mena') chartDataEmployeeMena = List<FlSpot>.from(spots);
if (name == 'ashjan')
chartDataEmployeeSefer4 = List<FlSpot>.from(spots);
});
} catch (e) {
Log.print('Error in fetchEmployee: $e');
// Set empty FlSpot lists in case of error
chartDataEmployeeMaryam = <FlSpot>[];
chartDataEmployeeRawda = <FlSpot>[];
chartDataEmployeeMena = <FlSpot>[];
chartDataEmployeeSefer4 = <FlSpot>[];
totalMonthlyRides = '0';
} finally {
isLoading = false;
update();
} }
// Create FlSpot data for each employee
List<FlSpot> chartDataMaryam = [];
List<FlSpot> chartDataRawda = [];
List<FlSpot> chartDataMena = [];
List<FlSpot> chartDataSefer4 = [];
for (int day = 1; day <= DateTime.now().day; day++) {
chartDataMaryam.add(FlSpot(
day.toDouble(),
employeeDataMap['maryam']
?.firstWhere((e) => e.day == day,
orElse: () => MonthlyEmployeeData(
day: day, totalEmployees: 0, name: 'maryam'))
.totalEmployees
.toDouble() ??
0));
chartDataRawda.add(FlSpot(
day.toDouble(),
employeeDataMap['yasmine']
?.firstWhere((e) => e.day == day,
orElse: () => MonthlyEmployeeData(
day: day, totalEmployees: 0, name: 'yasmine'))
.totalEmployees
.toDouble() ??
0));
chartDataMena.add(FlSpot(
day.toDouble(),
employeeDataMap['mena']
?.firstWhere((e) => e.day == day,
orElse: () => MonthlyEmployeeData(
day: day, totalEmployees: 0, name: 'mena'))
.totalEmployees
.toDouble() ??
0));
chartDataSefer4.add(FlSpot(
day.toDouble(),
employeeDataMap['ashjan']
?.firstWhere((e) => e.day == day,
orElse: () => MonthlyEmployeeData(
day: day, totalEmployees: 0, name: 'ashjan'))
.totalEmployees
.toDouble() ??
0));
}
// Combine spots into a single list if needed or keep them separate
chartDataEmployeeMaryam = chartDataMaryam;
chartDataEmployeeRawda = chartDataRawda;
chartDataEmployeeMena = chartDataMena;
chartDataEmployeeSefer4 = chartDataSefer4;
update();
} }
Future<void> fetchDrivers() async { Future<void> fetchDrivers() async {

View File

@@ -25,3 +25,44 @@ class Driverthebest extends GetxController {
super.onInit(); 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,22 +1,144 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io';
import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.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;
import 'package:jwt_decoder/jwt_decoder.dart';
import 'package:secure_string_operations/secure_string_operations.dart';
import '../../constant/api_key.dart'; import '../../constant/api_key.dart';
import '../../constant/box_name.dart'; import '../../constant/box_name.dart';
import '../../constant/char_map.dart';
import '../../constant/info.dart';
import '../../constant/links.dart'; import '../../constant/links.dart';
import '../../env/env.dart'; import '../../env/env.dart';
import '../../main.dart'; import '../../main.dart';
import '../../print.dart'; import '../../print.dart';
import '../../views/widgets/elevated_btn.dart'; import '../../views/widgets/elevated_btn.dart';
import 'device_info.dart';
import 'encrypt_decrypt.dart';
class CRUD { class CRUD {
var dev = '';
getJWT() async {
dev = Platform.isAndroid ? 'android' : 'ios';
var payload = {
'id': 'admin',
'password': AK.passnpassenger,
'aud': '${AK.allowed}$dev',
};
var response1 = await http.post(
Uri.parse(AppLink.loginJwtDriver),
body: payload,
);
if (response1.statusCode == 200) {
final decodedResponse1 = jsonDecode(response1.body);
final jwt = decodedResponse1['jwt'];
await box.write(BoxName.jwt, X.c(X.c(X.c(jwt, cn), cC), cs));
// await AppInitializer().getKey();
}
}
getJwtWallet() async {
String fingerPrint = await DeviceHelper.getDeviceFingerprint();
print('fingerPrint: ${fingerPrint}');
dev = Platform.isAndroid ? 'android' : 'ios';
var payload = {
'id': '1',
'password': AK.passnpassenger,
'aud': '${Env.allowedWallet}$dev',
'fingerPrint': fingerPrint
};
// Log.print('payload: ${payload}');
var response1 = await http.post(
Uri.parse(AppLink.loginWalletAdmin),
body: payload,
);
// Log.print('response.request: ${response1.request}');
// Log.print('response.body: ${response1.body}');
// print(payload);
// Log.print(
// 'jsonDecode(response1.body)["jwt"]: ${jsonDecode(response1.body)['jwt']}');
await box.write(BoxName.hmac, jsonDecode(response1.body)['hmac']);
return jsonDecode(response1.body)['jwt'].toString();
}
Future<dynamic> postWallet(
{required String link, Map<String, dynamic>? payload}) async {
var s = await getJwtWallet();
Log.print('jwt: ${s}');
final hmac = box.read(BoxName.hmac);
Log.print('hmac: ${hmac}');
var url = Uri.parse(link);
Log.print('url: ${url}');
try {
// await LoginDriverController().getJWT();
var response = await http.post(
url,
body: payload,
headers: {
"Content-Type": "application/x-www-form-urlencoded",
'Authorization': 'Bearer $s',
'X-HMAC-Auth': hmac.toString(),
},
);
Log.print('response.request:${response.request}');
Log.print('response.body: ${response.body}');
Log.print('payload:$payload');
if (response.statusCode == 200) {
try {
var jsonData = jsonDecode(response.body);
if (jsonData['status'] == 'success') {
return jsonData;
} else {
return jsonData['status'];
}
} catch (e) {
// addError(e.toString(), 'crud().post - JSON decoding');
return 'failure';
}
} else if (response.statusCode == 401) {
// Specifically handle 401 Unauthorized
var jsonData = jsonDecode(response.body);
if (jsonData['error'] == 'Token expired') {
return 'token_expired'; // Return a specific value for token expiration
} else {
// Other 401 errors
// addError('Unauthorized: ${jsonData['error']}', 'crud().post - 401');
return 'failure';
}
} else {
// addError('Non-200 response code: ${response.statusCode}',
// 'crud().post - Other');
return 'failure';
}
} catch (e) {
// addError('HTTP request error: $e', 'crud().post - HTTP');
return 'failure';
}
}
Future<dynamic> get({ Future<dynamic> get({
required String link, required String link,
Map<String, dynamic>? payload, Map<String, dynamic>? payload,
}) async { }) async {
if (box.read(BoxName.jwt) == null) {
await getJWT();
}
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();
}
// await Get.put(LoginDriverController()).getJWT();
var url = Uri.parse( var url = Uri.parse(
link, link,
); );
@@ -26,18 +148,148 @@ class CRUD {
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.request}'); if (response.statusCode == 200) {
// if (response.statusCode == 200) { Log.print('response: ${response.body}');
var jsonData = jsonDecode(response.body); var jsonData = jsonDecode(response.body);
if (jsonData['status'] == 'success') {
return response.body;
}
if (jsonData['status'] == 'success') { return jsonData['status'];
return response.body; } else if (response.statusCode == 401) {
// Specifically handle 401 Unauthorized
var jsonData = jsonDecode(response.body);
if (jsonData['error'] == 'Token expired') {
// Show snackbar prompting to re-login
// await Get.put(LoginDriverController()).getJWT();
// mySnackbarSuccess('please order now'.tr);
return 'token_expired'; // Return a specific value for token expiration
} else {
// Other 401 errors
// addError('Unauthorized: ${jsonData['error']}', 'crud().post - 401');
return 'failure';
}
} else {
// addError('Non-200 response code: ${response.statusCode}',
// 'crud().post - Other');
return 'failure';
} }
}
return jsonData['status']; // Future<dynamic> getWallet({
// required String link,
// Map<String, dynamic>? payload,
// }) async {
// var s = await getJwtWallet();
// var url = Uri.parse(
// link,
// );
// var response = await http.post(
// url,
// body: payload,
// headers: {
// "Content-Type": "application/x-www-form-urlencoded",
// 'Authorization': 'Bearer $s'
// },
// );
// if (response.statusCode == 200) {
// var jsonData = jsonDecode(response.body);
// if (jsonData['status'] == 'success') {
// return response.body;
// }
// return jsonData['status'];
// } else if (response.statusCode == 401) {
// // Specifically handle 401 Unauthorized
// var jsonData = jsonDecode(response.body);
// if (jsonData['error'] == 'Token expired') {
// // Show snackbar prompting to re-login
// // await Get.put(LoginDriverController()).getJwtWallet();
// return 'token_expired'; // Return a specific value for token expiration
// } else {
// // Other 401 errors
// addError('Unauthorized: ${jsonData['error']}', 'crud().post - 401');
// return 'failure';
// }
// } else {
// addError('Non-200 response code: ${response.statusCode}',
// 'crud().post - Other');
// return 'failure';
// }
// }
Future<dynamic> post(
{required String link, Map<String, dynamic>? payload}) async {
var url = Uri.parse(link);
try {
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(
url,
body: payload,
headers: {
"Content-Type": "application/x-www-form-urlencoded",
'Authorization':
'Bearer ${X.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs).toString().split(AppInformation.addd)[0]}'
// 'Authorization': 'Bearer ${box.read(BoxName.jwt)}'
},
);
if (response.statusCode == 200) {
try {
var jsonData = jsonDecode(response.body);
if (jsonData['status'] == 'success') {
return jsonData;
} else {
return jsonData['status'];
}
} catch (e) {
// addError(e.toString(), 'crud().post - JSON decoding');
return 'failure';
}
} else if (response.statusCode == 401) {
// Specifically handle 401 Unauthorized
var jsonData = jsonDecode(response.body);
if (jsonData['error'] == 'Token expired') {
// Show snackbar prompting to re-login
await getJWT();
// MyDialog().getDialog(
// 'Session expired. Please log in again.'.tr,
// '',
// () {
// Get.put(LoginController()).loginUsingCredentials(
// box.read(BoxName.passengerID), box.read(BoxName.email));
// Get.back();
// },
// );
return 'token_expired'; // Return a specific value for token expiration
} else {
// Other 401 errors
// addError('Unauthorized: ${jsonData['error']}', 'crud().post - 401');
return 'failure';
}
} else {
// addError('Non-200 response code: ${response.statusCode}',
// 'crud().post - Other');
return 'failure';
}
} catch (e) {
// addError('HTTP request error: $e', 'crud().post - HTTP');
return 'failure';
}
} }
// } // }
@@ -67,10 +319,7 @@ class CRUD {
http.StreamedResponse response = await request.send(); http.StreamedResponse response = await request.send();
if (response.statusCode == 200) { if (response.statusCode == 200) {
print(await response.stream.bytesToString()); } else {}
} else {
print(response.reasonPhrase);
}
} }
Future<dynamic> getAgoraToken({ Future<dynamic> getAgoraToken({
@@ -209,15 +458,12 @@ 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();
@@ -281,49 +527,6 @@ class CRUD {
} else {} } else {}
} }
Future<dynamic> post({
required String link,
Map<String, dynamic>? payload,
}) async {
try {
var url = Uri.parse(link);
var response = await http.post(
url,
body: payload,
headers: {
"Content-Type": "application/x-www-form-urlencoded",
'Authorization':
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
},
);
Log.print('payload: ${payload}');
var jsonData = jsonDecode(response.body);
Log.print('jsonData: ${jsonData}');
if (response.statusCode == 200) {
if (jsonData['status'] == 'success') {
return response.body;
} else {
return jsonData['status'];
}
} else {
// Log non-fatal errors to Crashlytics
await FirebaseCrashlytics.instance.log("Failed API request :$link");
FirebaseCrashlytics.instance.recordError(
Exception('Error: ${response.statusCode}'),
null,
reason: 'Failed HTTP POST request',
);
return response.statusCode;
}
} catch (e, stackTrace) {
// Log error to Crashlytics
await FirebaseCrashlytics.instance
.recordError(e, stackTrace, reason: 'Exception in post request');
return 'Error occurred';
}
}
Future<dynamic> kazumiSMS({ Future<dynamic> kazumiSMS({
required String link, required String link,
Map<String, dynamic>? payload, Map<String, dynamic>? payload,
@@ -344,7 +547,6 @@ class CRUD {
if (response.statusCode == 200) { if (response.statusCode == 200) {
var responseBody = await response.stream.bytesToString(); var responseBody = await response.stream.bytesToString();
var data = json.decode(responseBody); var data = json.decode(responseBody);
Log.print('data: ${data}');
return data; return data;
} else {} } else {}
} }
@@ -366,7 +568,6 @@ class CRUD {
body: body, body: body,
headers: headers, headers: headers,
); );
Log.print('res: ${res.body}');
} }
Future<dynamic> postPayMob({ Future<dynamic> postPayMob({

View File

@@ -1,6 +1,48 @@
// import 'dart:io'; // import 'dart:io';
// import 'package:device_info_plus/device_info_plus.dart'; import 'package:device_info_plus/device_info_plus.dart';
import 'dart:io';
class DeviceHelper {
static Future<String> getDeviceFingerprint() async {
final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
var deviceData;
try {
if (Platform.isAndroid) {
// Fetch Android-specific device information
AndroidDeviceInfo androidInfo = await deviceInfoPlugin.androidInfo;
deviceData = androidInfo.toMap(); // Convert to a map for easier access
// Log.print('deviceData: ${jsonEncode(deviceData)}');
} else if (Platform.isIOS) {
// Fetch iOS-specific device information
IosDeviceInfo iosInfo = await deviceInfoPlugin.iosInfo;
deviceData = iosInfo.toMap(); // Convert to a map for easier access
} else {
throw UnsupportedError('Unsupported platform');
}
// Extract relevant device information
final String deviceId = Platform.isAndroid
? deviceData['androidId'] ?? deviceData['serialNumber'] ?? 'unknown'
: deviceData['identifierForVendor'] ?? 'unknown';
final String deviceModel = deviceData['model'] ?? 'unknown';
final String osVersion = Platform.isAndroid
? deviceData['version']['release'] ?? 'unknown'
: deviceData['systemVersion'] ?? 'unknown';
// Log the extracted information
// Generate and return the encrypted fingerprint
final String fingerprint = '${deviceId}_${deviceModel}_$osVersion';
// print(EncryptionHelper.instance.encryptData(fingerprint));
return (fingerprint);
} catch (e) {
throw Exception('Failed to generate device fingerprint');
}
}
}
// class DeviceInfoPlus { // class DeviceInfoPlus {
// static List<Map<String, dynamic>> deviceDataList = []; // static List<Map<String, dynamic>> deviceDataList = [];

View File

@@ -0,0 +1,70 @@
import 'package:encrypt/encrypt.dart' as encrypt;
import 'package:flutter/foundation.dart';
import 'package:sefer_admin1/env/env.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 = Env.keyOfApp.toString().split('XrXlBl')[0];
//await storage.read(key: BoxName.keyOfApp);
// Log.print('keyOfApp: ${keyOfApp}');
String? initializationVector = Env.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

@@ -21,17 +21,17 @@ class WalletController extends GetxController {
addPaymentToDriver(String amount, driverID, token) async { addPaymentToDriver(String amount, driverID, token) async {
paymentToken = await generateTokenDriver(amount.toString(), driverID); paymentToken = await generateTokenDriver(amount.toString(), driverID);
var res = await CRUD().post(link: AppLink.addDrivePayment, payload: { var res = await CRUD().post(link: AppLink.addDrivePayment, payload: {
'rideId': 'gift$driverID', 'rideId': 'gift_$driverID _${DateTime.now().toIso8601String()}',
'amount': amount, 'amount': amount,
'payment_method': 'visaRide', 'payment_method': 'visaRide',
'passengerID': 'passengerId', 'passengerID': 'gift',
'token': paymentToken, 'token': paymentToken,
'driverID': driverID.toString(), 'driverID': driverID.toString(),
}); });
if (res != 'failure') { if (res != 'failure') {
FirebaseMessagesController().sendNotificationToAnyWithoutData( FirebaseMessagesController().sendNotificationToAnyWithoutData(
'you have gift from SEFER'.tr, "لديك هدية من سفَر".tr,
'', 'لقد حصلت على هدية من سفر بقيمة $amount ',
token, // Access token correctly token, // Access token correctly
'ding.wav', 'ding.wav',
); );

View File

@@ -10,6 +10,7 @@ import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart'; import 'package:get_storage/get_storage.dart';
import 'controller/firebase/firbase_messge.dart'; import 'controller/firebase/firbase_messge.dart';
import 'controller/functions/encrypt_decrypt.dart';
import 'firebase_options.dart'; import 'firebase_options.dart';
import 'models/db_sql.dart'; import 'models/db_sql.dart';
import 'views/admin/admin_home_page.dart'; import 'views/admin/admin_home_page.dart';
@@ -29,6 +30,7 @@ DbSql sql = DbSql.instance;
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
await GetStorage.init(); await GetStorage.init();
await EncryptionHelper.initialize();
if (Platform.isAndroid || Platform.isIOS) { if (Platform.isAndroid || Platform.isIOS) {
await Firebase.initializeApp( await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform, options: DefaultFirebaseOptions.currentPlatform,

View File

@@ -20,6 +20,7 @@ import '../../controller/functions/gemeni.dart';
import '../../print.dart'; import '../../print.dart';
import '../widgets/my_scafold.dart'; import '../widgets/my_scafold.dart';
import 'captain/captain.dart'; import 'captain/captain.dart';
import 'dashboard_widget.dart';
import 'drivers/driver_the_best.dart'; import 'drivers/driver_the_best.dart';
import 'packages.dart'; import 'packages.dart';
import 'passenger/passenger.dart'; import 'passenger/passenger.dart';
@@ -29,432 +30,352 @@ import 'wallet/wallet.dart';
class AdminHomePage extends StatelessWidget { class AdminHomePage extends StatelessWidget {
const AdminHomePage({super.key}); const AdminHomePage({super.key});
int _calculateCrossAxisCount(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
if (screenWidth > 1200) {
// Large desktops
return 5;
} else if (screenWidth > 900) {
// Desktops / Large Tablets
return 4;
} else if (screenWidth > 600) {
// Tablets
return 3;
} else {
// Phones
return 2;
}
}
// Helper to format currency (assuming '₵' is your currency symbol)
String _formatCurrency(dynamic value) {
final number = double.tryParse(value.toString());
if (number != null) {
return '${number.toStringAsFixed(2)}';
}
return value.toString(); // Fallback to original string if not a number
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Get.put(DashboardController()); Get.put(DashboardController());
return MyScafolld( return MyScafolld(
title: 'Admin Home Page', title: 'Admin Home Page',
action: IconButton( action: IconButton(
onPressed: () async { onPressed: () async {
await Get.find<DashboardController>().getDashBoard(); await Get.find<DashboardController>().getDashBoard();
}, },
icon: const Icon( icon: const Icon(
Icons.refresh, Icons.refresh,
color: AppColor.greenColor, color: AppColor.greenColor,
),
), ),
body: [ ),
GetBuilder<DashboardController>(builder: (dashboardController) { body: [
return dashboardController.dashbord.isEmpty // This is a List<Widget> for MyScafolld
? const MyCircularProgressIndicator() GetBuilder<DashboardController>(builder: (dashboardController) {
: Padding( return dashboardController.dashbord.isEmpty
padding: const EdgeInsets.all(8.0), ? const MyCircularProgressIndicator()
child: ListView( : Padding(
// crossAxisAlignment: WrapCrossAlignment.center, // This Padding wraps the entire content for this section
// alignment: WrapAlignment.center, padding: const EdgeInsets.all(8.0),
children: [ child: ListView(
Container( // Changed from a direct ListView for the whole page
width: Get.width, // to a ListView that contains the stats grid and then other items.
height: Get.height * .6, children: [
decoration: AppStyle.boxDecoration1, // --- Statistics Grid Section ---
child: Wrap( Container(
spacing: 6, // width: Get.width, // Not needed in ListView
alignment: WrapAlignment.spaceBetween, // height: Get.height * .6, // Let GridView determine its height
runAlignment: WrapAlignment.spaceBetween, padding: const EdgeInsets.all(
children: [ 8.0), // Padding for the grid container
Container( decoration: AppStyle.boxDecoration1.copyWith(
decoration: AppStyle.boxDecoration1, // Optional: slightly different background for the grid area
child: Padding( // color: (AppStyle.boxDecoration1.color as Color?)?.withAlpha(200) ?? Theme.of(context).cardColor.withAlpha(200),
padding: const EdgeInsets.all(8.0), boxShadow: [] // Remove shadow if cards have them, or use a very subtle one
child: Column( ),
children: [ child: GridView.count(
Text( crossAxisCount: _calculateCrossAxisCount(context),
'Sms', shrinkWrap: true,
style: AppStyle.title, physics:
), const NeverScrollableScrollPhysics(), // Grid shouldn't scroll independently
Text(dashboardController.creditSMS mainAxisSpacing: 10.0,
.toString()), crossAxisSpacing: 10.0,
], childAspectRatio:
), 1.7, // Adjust for desired card W/H ratio (e.g. 1.5 to 2.0)
)), children: [
Container( DashboardStatCard(
decoration: AppStyle.boxDecoration1, title: 'SMS Credits',
child: Padding( value: dashboardController.creditSMS.toString(),
padding: const EdgeInsets.all(8.0), icon: Icons.sms_outlined,
child: Column( iconColor: Colors.lightBlueAccent,
children: [ ),
Text( DashboardStatCard(
'Passengers', title: 'Passengers',
style: AppStyle.title, value: dashboardController.dashbord[0]
), ['countPassengers']
Text(dashboardController.dashbord[0] .toString(),
['countPassengers'] icon: Icons.people_alt_outlined,
.toString()), iconColor: Colors.teal,
], ),
), DashboardStatCard(
)), title: 'Drivers',
Container( value: dashboardController.dashbord[0]
decoration: AppStyle.boxDecoration1, ['countDriver']
child: Padding( .toString(),
padding: const EdgeInsets.all(8.0), icon: Icons.sports_motorsports_outlined,
child: Column( iconColor: Colors.orangeAccent,
children: [ ),
Text( DashboardStatCard(
'Drivers', title: 'Rides (Month)',
style: AppStyle.title, value: dashboardController.dashbord[0]
), ['countRideThisMonth']
Text(dashboardController.dashbord[0] .toString(),
['countDriver'] icon: Icons.calendar_month_outlined,
.toString()), iconColor: Colors.purpleAccent,
], ),
), DashboardStatCard(
)), title: 'Avg. Ride Cost',
Container( value: _formatCurrency(dashboardController
decoration: AppStyle.boxDecoration1, .dashbord[0]['avg_passenger_price']),
child: Padding( icon: Icons.monetization_on_outlined,
padding: const EdgeInsets.all(8.0), iconColor: Colors.green,
child: Column( valueColor: Colors.green.shade700,
children: [ ),
Text( DashboardStatCard(
'Rides this month', title: 'Completed Rides',
style: AppStyle.title, value: dashboardController.dashbord[0]
), ['completed_rides']
Text(dashboardController.dashbord[0] .toString(),
['countRideThisMonth'] icon: Icons.check_circle_outline,
.toString()), iconColor: AppColor.greenColor,
], ),
), DashboardStatCard(
)), title: 'Cancelled Rides',
Container( value: dashboardController.dashbord[0]
decoration: AppStyle.boxDecoration1, ['cancelled_rides']
child: Padding( .toString(),
padding: const EdgeInsets.all(8.0), icon: Icons.cancel_outlined,
child: Column( iconColor: AppColor.redColor,
children: [ ),
Text( DashboardStatCard(
'avg costs', title: 'Driver Payments',
style: AppStyle.title, value: _formatCurrency(
), dashboardController.dashbord[0]['payments']),
Text(dashboardController.dashbord[0] icon: Icons.payments_outlined,
['avg_passenger_price'] iconColor: Colors.indigoAccent,
.toString()), valueColor: Colors.indigo.shade700,
], ),
), DashboardStatCard(
)), title: 'Tripz Wallet',
Container( value: _formatCurrency(dashboardController
decoration: AppStyle.boxDecoration1, .dashbord[0]['seferWallet']),
child: Padding( icon: Icons.account_balance_wallet_outlined,
padding: const EdgeInsets.all(8.0), iconColor: Colors.deepOrangeAccent,
child: Column( valueColor: Colors.deepOrange.shade700,
children: [ ),
Text( DashboardStatCard(
'completed ride', title: 'Transfers Count',
style: AppStyle.title, value: dashboardController.dashbord[0]
), ['transfer_from_count']
Text(dashboardController.dashbord[0] .toString(),
['completed_rides'] icon: Icons.swap_horiz_outlined,
.toString()), iconColor: Colors.brown,
], ),
), DashboardStatCard(
)), title: 'Morning Rides',
Container( value: dashboardController.dashbord[0]
decoration: AppStyle.boxDecoration1, ['morning_ride_count']
child: Padding( .toString(),
padding: const EdgeInsets.all(8.0), icon: Icons.wb_sunny_outlined,
child: Column( iconColor: Colors.amberAccent,
children: [ ),
Text( DashboardStatCard(
'cancelled ride', title: 'Evening Rides',
style: AppStyle.title, value: dashboardController.dashbord[0]
), ['evening_ride_count']
Text(dashboardController.dashbord[0] .toString(),
['cancelled_rides'] icon: Icons.brightness_4_outlined,
.toString()), iconColor: Colors.blueGrey,
], ),
), DashboardStatCard(
)), title: 'Night Rides',
Container( value: dashboardController.dashbord[0]
decoration: AppStyle.boxDecoration1, ['night_ride_count']
child: Padding( .toString(),
padding: const EdgeInsets.all(8.0), icon: Icons.nightlight_round_outlined,
child: Column( iconColor: Colors.black54,
children: [ ),
Text( DashboardStatCard(
'payments to driver', title: 'Comfort Type',
style: AppStyle.title, value: dashboardController.dashbord[0]['comfort']
), .toString(),
Text(dashboardController.dashbord[0] icon: Icons.event_seat_outlined,
['payments'] iconColor: Colors.cyan,
.toString()), ),
], DashboardStatCard(
), title: 'Speed Type',
)), value: dashboardController.dashbord[0]['speed']
Container( .toString(),
decoration: AppStyle.boxDecoration1, icon: Icons.speed_outlined,
child: Padding( iconColor: Colors.red,
padding: const EdgeInsets.all(8.0), ),
child: Column( DashboardStatCard(
children: [ title: 'Lady Type',
Text( value: dashboardController.dashbord[0]['lady']
'sefer wallet', .toString(),
style: AppStyle.title, icon: Icons.woman_2_outlined,
), iconColor: Colors.pinkAccent,
Text(dashboardController.dashbord[0] ),
['seferWallet'] ],
.toString()), ),
], ),
), // --- End of Statistics Grid Section ---
)),
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Text(
'count of transfer',
style: AppStyle.title,
),
Text(dashboardController.dashbord[0]
['transfer_from_count']
.toString()),
],
),
)),
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Text(
'Morning',
style: AppStyle.title,
),
Text(dashboardController.dashbord[0]
['morning_ride_count']
.toString()),
],
),
)),
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Text(
'evening',
style: AppStyle.title,
),
Text(dashboardController.dashbord[0]
['evening_ride_count']
.toString()),
],
),
)),
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Text(
'night',
style: AppStyle.title,
),
Text(dashboardController.dashbord[0]
['night_ride_count']
.toString()),
],
),
)),
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Text(
'comfort',
style: AppStyle.title,
),
Text(dashboardController.dashbord[0]
['comfort']
.toString()),
],
),
)),
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Text(
'Speed',
style: AppStyle.title,
),
Text(dashboardController.dashbord[0]
['speed']
.toString()),
],
),
)),
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Text(
'Lady',
style: AppStyle.title,
),
Text(dashboardController.dashbord[0]
['lady']
.toString()),
],
),
)),
],
)),
AdminWidgetsDashBoard(
title: 'Passengers',
onPressed: () => Get.to(() => Passengrs(),
transition: Transition.topLevel)),
AdminWidgetsDashBoard(
title: 'Captains',
onPressed: () => Get.to(() => Captain(),
transition: Transition.size)),
AdminWidgetsDashBoard(
title: 'Wallet',
onPressed: () => Get.to(() => Wallet(),
transition: Transition.fade)),
AdminWidgetsDashBoard(
title: 'Rides',
onPressed: () => Get.to(() => Rides(),
transition: Transition.downToUp)),
AdminWidgetsDashBoard(
title: 'Static',
onPressed: () async {
await Get.put(StaticController()).getAll();
Get.to(() => const StaticDash()); // --- Your AdminWidgetsDashBoard items follow ---
}, AdminWidgetsDashBoard(
), title: 'Passengers',
AdminWidgetsDashBoard( icon: Icons.people_outline,
title: 'send Whatsapp to Drivers', onPressed: () => Get.to(() => Passengrs(),
onPressed: () async { transition: Transition.topLevel)),
Get.defaultDialog( AdminWidgetsDashBoard(
title: 'Are you sure to send by WhatsApp ?', title: 'Captains',
middleText: '', icon: Icons.sports_motorsports_outlined,
confirm: MyElevatedButton( onPressed: () => Get.to(() => Captain(),
title: 'Ok', transition: Transition.size)),
kolor: AppColor.greenColor, // ... (Add all your other AdminWidgetsDashBoard items here with icons)
onPressed: () async { AdminWidgetsDashBoard(
Log.print( title: 'Wallet',
'CRUD().phoneDriversTest.: ${CRUD().phoneDriversTest}'); icon: Icons.account_balance_wallet_outlined,
for (var phoneNumber onPressed: () => Get.to(() => Wallet(),
in CRUD().phoneDrivers) { transition: Transition.fade)),
await CRUD().sendWhatsAppAuth( AdminWidgetsDashBoard(
phoneNumber.toString()); title: 'Rides',
} icon: Icons.directions_car_filled_outlined,
}), onPressed: () => Get.to(() => Rides(),
cancel: MyElevatedButton( transition: Transition.downToUp)),
title: 'cancel', AdminWidgetsDashBoard(
kolor: AppColor.redColor, title: 'Static',
onPressed: () => Get.back())); icon: Icons.bar_chart_outlined,
}), onPressed: () async {
AdminWidgetsDashBoard( await Get.put(StaticController()).getAll();
title: 'send notification Drivers', Get.to(() => const StaticDash());
onPressed: () async { },
await Get.put(NotificationController()) ),
.getTokensDrivers(); AdminWidgetsDashBoard(
}), title: 'send Whatsapp to Drivers',
AdminWidgetsDashBoard( icon: Icons.message_outlined,
title: 'send SMS Drivers', iconColor: Colors.green,
onPressed: () async {
Get.defaultDialog(
title: 'Are you sure to send SMS ?',
middleText: '',
content: Padding(
padding: const EdgeInsets.all(8.0),
child: Form(
key: dashboardController.formKey,
child: MyTextForm(
controller:
dashboardController.smsText,
label: 'label',
hint: 'hint',
type: TextInputType.name)),
),
confirm: MyElevatedButton(
title: 'Ok',
kolor: AppColor.greenColor,
onPressed: () async {
dashboardController.sendSMSMethod();
}),
cancel: MyElevatedButton(
title: 'cancel',
kolor: AppColor.redColor,
onPressed: () => Get.back()));
}),
AdminWidgetsDashBoard(
title: 'send notification Passengers',
onPressed: () async {
await Get.put(NotificationController())
.getTokensPassengers();
}),
AdminWidgetsDashBoard(
title: 'register captain'.tr,
onPressed: () async { onPressed: () async {
await Get.put(RegisterCaptainController()) Get.defaultDialog(
.getDriverNotCompleteRegistration(); title: 'Are you sure to send by WhatsApp ?',
Get.to(() => const DriversCantRegister()); middleText: '',
}, confirm: MyElevatedButton(
), title: 'Ok',
AdminWidgetsDashBoard( kolor: AppColor.greenColor,
title: 'update packages'.tr, onPressed: () async {
Log.print(
'CRUD().phoneDriversTest.: ${CRUD().phoneDriversTest}');
for (var phoneNumber
in CRUD().phoneDrivers) {
await CRUD().sendWhatsAppAuth(
phoneNumber.toString());
}
}),
cancel: MyElevatedButton(
title: 'cancel',
kolor: AppColor.redColor,
onPressed: () => Get.back()));
}),
AdminWidgetsDashBoard(
title: 'send notification Drivers',
icon: Icons.notifications_active_outlined,
onPressed: () async { onPressed: () async {
Get.to(() => PackageUpdateScreen()); await Get.put(NotificationController())
}, .getTokensDrivers();
), }),
AdminWidgetsDashBoard( AdminWidgetsDashBoard(
title: 'Employee'.tr, title: 'send SMS Drivers',
icon: Icons.sms_outlined,
onPressed: () async { onPressed: () async {
Get.to(() => EmployeePage()); Get.defaultDialog(
}, title: 'Are you sure to send SMS ?',
), middleText: '',
AdminWidgetsDashBoard( content: Padding(
title: 'Drivers the best'.tr, padding: const EdgeInsets.all(8.0),
child: Form(
key: dashboardController.formKey,
child: MyTextForm(
controller:
dashboardController.smsText,
label: 'label',
hint: 'hint',
type: TextInputType.name)),
),
confirm: MyElevatedButton(
title: 'Ok',
kolor: AppColor.greenColor,
onPressed: () async {
dashboardController.sendSMSMethod();
}),
cancel: MyElevatedButton(
title: 'cancel',
kolor: AppColor.redColor,
onPressed: () => Get.back()));
}),
AdminWidgetsDashBoard(
title: 'send notification Passengers',
icon: Icons.notification_important_outlined,
onPressed: () async { onPressed: () async {
Get.to(() => DriverTheBest()); await Get.put(NotificationController())
}, .getTokensPassengers();
), }),
AdminWidgetsDashBoard(
// AdminWidgetsDashBoard( title: 'register captain'.tr,
// title: 'Llama', icon: Icons.person_add_alt_1_outlined,
// onPressed: () => onPressed: () async {
// CarRegistrationRecognizerController().scanText()), await Get.put(RegisterCaptainController())
AdminWidgetsDashBoard( .getDriverNotCompleteRegistration();
title: 'Add device to be Admin', Get.to(() => const DriversCantRegister());
onPressed: () async { },
// Map device = DeviceInfoPlus.deviceData; ),
await CRUD() AdminWidgetsDashBoard(
.post(link: AppLink.addAdminUser, payload: { title: 'update packages'.tr,
// 'deviceNumber': device['serialNumber'].toString(), icon: Icons.inventory_2_outlined,
'name': 'b', onPressed: () async {
}); Get.to(() => PackageUpdateScreen());
}), },
], ),
), AdminWidgetsDashBoard(
); title: 'Employee'.tr,
}) icon: Icons.badge_outlined,
], onPressed: () async {
isleading: false); Get.to(() => EmployeePage());
},
),
AdminWidgetsDashBoard(
title: 'Drivers the best'.tr,
icon: Icons.star_outline,
onPressed: () async {
Get.to(() => DriverTheBest());
},
),
AdminWidgetsDashBoard(
title: 'Add device to be Admin',
icon: Icons.admin_panel_settings_outlined,
onPressed: () async {
await CRUD()
.post(link: AppLink.addAdminUser, payload: {
'name': 'b',
});
}),
],
),
);
})
],
isleading: false,
);
} }
} }
@@ -463,25 +384,76 @@ class AdminWidgetsDashBoard extends StatelessWidget {
super.key, super.key,
required this.title, required this.title,
required this.onPressed, required this.onPressed,
this.icon, // Optional icon
this.iconColor,
this.backgroundColor,
}); });
final String title; final String title;
final Callback onPressed; final Callback onPressed;
final IconData? icon;
final Color? iconColor;
final Color? backgroundColor;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.symmetric(vertical: 6.0, horizontal: 12.0),
child: InkWell( child: InkWell(
onTap: onPressed, onTap: onPressed,
borderRadius:
BorderRadius.circular(12.0), // Rounded corners for tap effect
child: Container( child: Container(
decoration: AppStyle.boxDecoration, padding: const EdgeInsets.symmetric(
height: 50, horizontal: 16.0, vertical: 16.0), // Increased padding
width: Get.width * .4, decoration: BoxDecoration(
child: Center( color: backgroundColor ??
child: Text( Theme.of(context).cardColor, // Use provided or theme card color
title.tr, borderRadius: BorderRadius.circular(12.0),
style: AppStyle.title, boxShadow: [
), BoxShadow(
color: Colors.grey.withOpacity(0.15),
spreadRadius: 1,
blurRadius: 8,
offset: const Offset(0, 2), // changes position of shadow
),
],
// If you want to use AppStyle.boxDecoration as a base and modify it:
// ...AppStyle.boxDecoration.copyWith(
// color: backgroundColor ?? AppStyle.boxDecoration.color,
// // Potentially override other properties of AppStyle.boxDecoration if needed
// ),
),
child: Row(
children: [
if (icon != null) ...[
Icon(
icon,
size: 28, // Slightly larger icon
color: iconColor ??
AppColor.primaryColor, // Use primary color or provided
),
const SizedBox(width: 16),
],
Expanded(
child: Text(
title.tr,
style: AppStyle.title.copyWith(
fontSize: 16, // Adjust font size for better readability
fontWeight: FontWeight.w500, // Medium weight
color: Theme.of(context)
.textTheme
.bodyLarge
?.color, // Use theme text color
),
),
),
const Icon(
Icons.arrow_forward_ios,
size: 18,
color: Colors.grey, // Subtle indicator for navigation
),
],
), ),
), ),
), ),

View File

@@ -4,6 +4,7 @@ import 'package:get/get.dart';
import '../../../constant/colors.dart'; import '../../../constant/colors.dart';
import '../../../constant/style.dart'; import '../../../constant/style.dart';
import '../../../controller/admin/captain_admin_controller.dart'; import '../../../controller/admin/captain_admin_controller.dart';
import '../../../controller/functions/encrypt_decrypt.dart';
import '../../widgets/elevated_btn.dart'; import '../../widgets/elevated_btn.dart';
import '../../widgets/my_scafold.dart'; import '../../widgets/my_scafold.dart';
import '../../widgets/my_textField.dart'; import '../../widgets/my_textField.dart';
@@ -153,7 +154,7 @@ class Captain extends StatelessWidget {
.spaceBetween, .spaceBetween,
children: [ children: [
Text( Text(
'Name : ${user['first_name']} ${user['last_name']}', 'Name : ${(user['first_name'])} ${(user['last_name'])}',
style: AppStyle.title, style: AppStyle.title,
), ),
Text( Text(

View File

@@ -0,0 +1,94 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart'; // For Get.width if needed, and .tr
import 'package:sefer_admin1/constant/colors.dart'; // Assuming AppColor is here
import 'package:sefer_admin1/constant/style.dart'; // Assuming AppStyle is here
class DashboardStatCard extends StatelessWidget {
final String title;
final String value;
final IconData? icon;
final Color? iconColor;
final Color? backgroundColor;
final Color? valueColor;
const DashboardStatCard({
Key? key,
required this.title,
required this.value,
this.icon,
this.iconColor,
this.backgroundColor,
this.valueColor,
}) : super(key: key);
@override
Widget build(BuildContext context) {
// Attempt to use AppStyle.boxDecoration1 properties if it's a BoxDecoration
BoxDecoration? baseDecoration = AppStyle.boxDecoration1;
Color? finalBackgroundColor =
backgroundColor ?? baseDecoration?.color ?? Theme.of(context).cardColor;
BorderRadius? finalBorderRadius =
baseDecoration?.borderRadius?.resolve(Directionality.of(context)) ??
BorderRadius.circular(12.0);
return Container(
padding: const EdgeInsets.symmetric(horizontal: 14.0, vertical: 12.0),
decoration: BoxDecoration(
color: finalBackgroundColor,
borderRadius: finalBorderRadius,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.1),
spreadRadius: 1,
blurRadius: 6,
offset: const Offset(0, 2),
),
],
// If AppStyle.boxDecoration1 includes a border, you might want to add it here too
// border: baseDecoration?.border,
),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center, // Center content vertically
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Flexible(
child: Text(
title.tr,
style: AppStyle.title.copyWith(
fontSize: 13,
fontWeight: FontWeight.w500,
color: Theme.of(context).textTheme.bodySmall?.color,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
),
if (icon != null)
Icon(
icon,
size: 24,
color: iconColor ?? AppColor.primaryColor.withOpacity(0.7),
),
],
),
const SizedBox(height: 6),
Text(
value,
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.bold,
color: valueColor ?? AppColor.primaryColor,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
],
),
);
}
}

View File

@@ -0,0 +1,69 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:sefer_admin1/constant/links.dart';
import 'package:sefer_admin1/controller/functions/crud.dart';
import 'package:sefer_admin1/controller/functions/wallet.dart';
import 'package:sefer_admin1/views/widgets/my_scafold.dart';
import '../../../controller/drivers/driverthebest.dart';
class DriverTheBestAlexandria extends StatelessWidget {
const DriverTheBestAlexandria({super.key});
@override
Widget build(BuildContext context) {
Get.put(DriverTheBestAlexandriaController(), permanent: true);
return MyScafolld(
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(
((driver['driver_count'] * 5) / 3600)
.toStringAsFixed(0),
),
),
title: Text(driver['name_arabic'] ?? 'Unknown Name'),
subtitle: Text('Phone: ${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());
await CRUD().post(
link: AppLink.deleteRecord,
payload: {
'driver_id': driver['id'].toString()
});
driverthebest.driver.removeAt(index);
driverthebest.update();
},
onCancel: () => Get.back());
},
icon: const Icon(Icons.wallet_giftcard_rounded),
),
);
},
)
: const Center(
child: Text('No drivers available.'),
);
})
],
isleading: true,
);
}
}

View File

@@ -1,54 +1,96 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:sefer_admin1/constant/links.dart';
import 'package:sefer_admin1/controller/functions/crud.dart';
import 'package:sefer_admin1/controller/functions/encrypt_decrypt.dart';
import 'package:sefer_admin1/controller/functions/wallet.dart'; import 'package:sefer_admin1/controller/functions/wallet.dart';
import 'package:sefer_admin1/views/admin/wallet/wallet.dart'; import 'package:sefer_admin1/views/widgets/elevated_btn.dart';
import 'package:sefer_admin1/views/widgets/my_scafold.dart'; import 'package:sefer_admin1/views/widgets/my_scafold.dart';
import '../../../controller/drivers/driverthebest.dart'; import '../../../controller/drivers/driverthebest.dart';
import 'alexandria.dart';
import 'giza.dart';
class DriverTheBest extends StatelessWidget { class DriverTheBest extends StatelessWidget {
const DriverTheBest({super.key}); const DriverTheBest({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Get.put(Driverthebest()); Get.put(Driverthebest(), permanent: true);
return MyScafolld( return MyScafolld(
title: 'Best Drivers'.tr, title: 'Best Drivers'.tr,
body: [ body: [
GetBuilder<Driverthebest>(builder: (driverthebest) { GetBuilder<Driverthebest>(builder: (driverthebest) {
return driverthebest.driver.isNotEmpty return driverthebest.driver.isNotEmpty
? ListView.builder( ? Column(
itemCount: driverthebest.driver.length, children: [
itemBuilder: (context, index) { Row(
final driver = driverthebest.driver[index]; mainAxisAlignment: MainAxisAlignment.spaceAround,
return ListTile( children: [
leading: CircleAvatar( MyElevatedButton(
child: Text( title: 'Giza',
((driver['driver_count'] * 5) / 3600) onPressed: () {
.toStringAsFixed(0), Get.to(() => DriverTheBestGiza());
), }),
), MyElevatedButton(
title: Text(driver['name_arabic'] ?? 'Unknown Name'), title: 'Alexandria',
subtitle: Text('Phone: ${driver['phone'] ?? 'N/A'}'), onPressed: () {
trailing: IconButton( Get.to(() => DriverTheBestAlexandria());
onPressed: () async { }),
Get.defaultDialog( ],
title: ),
'are you sure to pay to this driver gift'.tr, SizedBox(
middleText: '', height: Get.height * .7,
onConfirm: () async { child: ListView.builder(
final wallet = Get.put(WalletController()); itemCount: driverthebest.driver.length,
await wallet.addPaymentToDriver('200', itemBuilder: (context, index) {
driver['id'].toString(), driver['token']); final driver = driverthebest.driver[index];
await wallet.addSeferWallet( return ListTile(
'200', driver['id'].toString()); leading: CircleAvatar(
child: Text(
(int.parse(driver['driver_count']) * 5 / 3600)
.toStringAsFixed(
0), // Perform division first, then convert to string
),
),
title:
Text((driver['name_arabic']) ?? 'Unknown Name'),
subtitle:
Text('Phone: ${(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(
'200',
driver['id'].toString(),
driver['token']);
await wallet.addSeferWallet(
'200', driver['id'].toString());
await CRUD().post(
link: AppLink.deleteRecord,
payload: {
'driver_id': driver['id'].toString()
});
driverthebest.driver.removeAt(index);
driverthebest.update();
Get.back();
},
onCancel: () => Get.back());
}, },
onCancel: () => Get.back()); icon: const Icon(Icons.wallet_giftcard_rounded),
),
);
}, },
icon: const Icon(Icons.wallet_giftcard_rounded),
), ),
); ),
}, ],
) )
: const Center( : const Center(
child: Text('No drivers available.'), child: Text('No drivers available.'),

View File

@@ -0,0 +1,69 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:sefer_admin1/constant/links.dart';
import 'package:sefer_admin1/controller/functions/crud.dart';
import 'package:sefer_admin1/controller/functions/wallet.dart';
import 'package:sefer_admin1/views/widgets/my_scafold.dart';
import '../../../controller/drivers/driverthebest.dart';
class DriverTheBestGiza extends StatelessWidget {
const DriverTheBestGiza({super.key});
@override
Widget build(BuildContext context) {
Get.put(DriverTheBestGizaController(), permanent: true);
return MyScafolld(
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(
((driver['driver_count'] * 5) / 3600)
.toStringAsFixed(0),
),
),
title: Text(driver['name_arabic'] ?? 'Unknown Name'),
subtitle: Text('Phone: ${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());
await CRUD().post(
link: AppLink.deleteRecord,
payload: {
'driver_id': driver['id'].toString()
});
driverthebest.driver.removeAt(index);
driverthebest.update();
},
onCancel: () => Get.back());
},
icon: const Icon(Icons.wallet_giftcard_rounded),
),
);
},
)
: const Center(
child: Text('No drivers available.'),
);
})
],
isleading: true,
);
}
}

View File

@@ -165,7 +165,8 @@ class EmployeeDetails extends StatelessWidget {
height: 200, height: 200,
width: 400, width: 400,
child: Image.network( child: Image.network(
'https://sefer.click/sefer/card_image/idFrontEmployee-${employeeController.employee[index]['id']}.jpg'), // https: //server.sefer.click/sefer.click/sefer/card_image/idFrontEmployee-GC15188P.jpg
'https://server.sefer.click/sefer.click/sefer/card_image/idFrontEmployee-${employeeController.employee[index]['id']}.jpg'),
), ),
const SizedBox( const SizedBox(
height: 10, height: 10,
@@ -174,7 +175,7 @@ class EmployeeDetails extends StatelessWidget {
height: 200, height: 200,
width: 400, width: 400,
child: Image.network( child: Image.network(
'https://sefer.click/sefer/card_image/idFrontEmployee-${employeeController.employee[index]['id']}.jpg'), 'https://server.sefer.click/sefer.click/sefer/card_image/idFrontEmployee-${employeeController.employee[index]['id']}.jpg'),
) )
], ],
); );

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:sefer_admin1/controller/functions/encrypt_decrypt.dart';
import '../../../constant/style.dart'; import '../../../constant/style.dart';
import '../../../controller/admin/passenger_admin_controller.dart'; import '../../../controller/admin/passenger_admin_controller.dart';
@@ -136,7 +137,7 @@ class Passengrs extends StatelessWidget {
.spaceBetween, .spaceBetween,
children: [ children: [
Text( Text(
'Name : ${user['first_name']} ${user['last_name']}', 'Name : ${(user['first_name'])} ${(user['last_name'])}',
style: AppStyle.title, style: AppStyle.title,
), ),
Text( Text(

View File

@@ -5,6 +5,7 @@
import FlutterMacOS import FlutterMacOS
import Foundation import Foundation
import device_info_plus
import file_selector_macos import file_selector_macos
import firebase_core import firebase_core
import firebase_crashlytics import firebase_crashlytics
@@ -12,11 +13,13 @@ import firebase_messaging
import flutter_image_compress_macos 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 local_auth_darwin
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) {
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseCrashlyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCrashlyticsPlugin")) FLTFirebaseCrashlyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCrashlyticsPlugin"))
@@ -24,6 +27,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin")) FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin"))
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin"))
FLALocalAuthPlugin.register(with: registry.registrar(forPlugin: "FLALocalAuthPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))

File diff suppressed because it is too large Load Diff

View File

@@ -33,20 +33,20 @@ dependencies:
secure_string_operations: secure_string_operations:
path: ./secure_string_operations path: ./secure_string_operations
dio: ^5.4.3+1 dio: ^5.4.3+1
envied: ^0.5.4+1 envied: ^1.0.0
firebase_core: ^2.30.1 firebase_core: ^3.9.0
firebase_messaging: ^14.9.1 firebase_messaging: ^15.1.6
fl_chart: ^0.67.0 fl_chart: ^0.70.0
flutter: flutter:
sdk: flutter sdk: flutter
flutter_launcher_icons: ^0.13.1 flutter_launcher_icons: ^0.14.2
# flutter_local_notifications: ^17.1.1 # flutter_local_notifications: ^17.1.1
# flutter_paypal: ^0.2.0 # flutter_paypal: ^0.2.0
flutter_secure_storage: ^9.0.0 flutter_secure_storage: ^9.0.0
# flutter_stripe: ^10.1.1 # flutter_stripe: ^10.1.1
get: ^4.6.6 get: ^4.6.6
get_storage: ^2.1.1 get_storage: ^2.1.1
google_fonts: ^4.0.4 google_fonts: ^6.2.1
# google_maps_flutter: ^2.6.1 # google_maps_flutter: ^2.6.1
google_sign_in: ^6.2.1 google_sign_in: ^6.2.1
http: ^1.0.0 http: ^1.0.0
@@ -61,14 +61,17 @@ dependencies:
url_launcher: ^6.2.6 url_launcher: ^6.2.6
# webview_flutter: ^4.7.0 # webview_flutter: ^4.7.0
googleapis_auth: ^1.6.0 googleapis_auth: ^1.6.0
firebase_crashlytics: ^3.5.7 firebase_crashlytics: ^4.2.0
flutter_image_compress: ^2.3.0 flutter_image_compress: ^2.3.0
jwt_decoder: ^2.0.1
encrypt: ^5.0.3
device_info_plus: ^11.5.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
flutter_lints: ^ 3.0.1 flutter_lints: ^5.0.0
envied_generator: ^0.5.2 envied_generator: ^1.0.0
build_runner: ^2.4.6 build_runner: ^2.4.6
flutter_launcher_icons: flutter_launcher_icons: