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
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/
# IntelliJ related

View File

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

View File

@@ -8,7 +8,7 @@ buildscript {
}
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"
}
}

View File

@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
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 {
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
id "com.google.gms.google-services" version "4.3.15" apply false
// 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'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
# Disable CocoaPods analytics to improve Flutter build latency
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
# Define Flutter project configurations
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
# Helper function to locate the Flutter installation path
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
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)
# Set up Flutter iOS Pods
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
# Enable modular headers and static linkage for better compatibility
use_frameworks! :linkage => :static
# Install all Flutter-related pods
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
# Test target configuration
target 'RunnerTests' do
inherit! :search_paths
end
end
# Post-install configurations for CocoaPods
post_install do |installer|
installer.pods_project.targets.each do |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

View File

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

View File

@@ -4,6 +4,12 @@ import '../env/env.dart';
import 'char_map.dart';
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 =
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);

View File

@@ -8,6 +8,14 @@ class BoxName {
static const String carPlate = "carPlate";
static const String statusDriverLocation = "statusDriverLocation";
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 passwordDriver = "passwordDriver";
static const String agreeTerms = "agreeTerms";

View File

@@ -8,6 +8,7 @@ class AppInformation {
static const String email = 'hamzaayed@mobile-app.store';
static const String complaintPrompt =
'for this data for complaint from driver or passenger i collect all data i want you analyze this complaint and show what is reason and what is solution .this data collected from many table to find solution if payment in visa not complete and if ride status is finished it will be paymnet in payment table if ride status is not finished there is no need to pay and payment table is null for this ride and if paymentFromPaymentTable not null and visa type not cash the payment sucssessed . if ratingpassenger is low or passengr rating drivers low grade then dont mine of this passenger ,look at driver too like passengerratingdriver with rating or ratingtopassenger .in json add status of complaint and message to passenger and message to driver and message to call center write in arabic in json output with key in english .for output please just json i want';
static const String addd = 'BlBlNl';
static const String privacyPolicy = '''

View File

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

View File

@@ -17,18 +17,60 @@ class DashboardController extends GetxController {
final formKey = GlobalKey<FormState>();
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 {
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();
// Log.print('d: ${d}');
dashbord = d['message']; // هذا عبارة عن List<Map>
}
// الطلب من سيرفر المحافظ
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(
link: 'https://sms.kazumi.me/api/sms/check-credit',
payload: {"username": "Sefer", "password": AK.smsPasswordEgypt},
@@ -38,9 +80,11 @@ class DashboardController extends GetxController {
Log.print(' res2[credit]: ${res2['credit']}');
Log.print('creditSMS: ${creditSMS}');
isLoading = false;
update();
}
sendSMSMethod() async {
if (formKey.currentState!.validate()) {
for (var phoneNumber in box.read(BoxName.tokensDrivers)['message']) {

View File

@@ -87,79 +87,104 @@ class StaticController extends GetxController {
}
Future<void> fetchEmployee() async {
isLoading = true;
update();
try {
isLoading = true;
update();
var res = await CRUD().get(link: AppLink.getEmployeeStatic, payload: {});
var jsonResponse = jsonDecode(res) as Map<String, dynamic>;
isLoading = false;
var res = await CRUD().get(link: AppLink.getEmployeeStatic, payload: {});
final List<dynamic> jsonData = jsonResponse['message'];
totalMonthlyRides = jsonData[0]['totalMonthly'].toString();
// 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] = [];
// First check if the response is valid JSON
if (res == 'failure') {
throw FormatException('Invalid response: $res');
}
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 {

View File

@@ -25,3 +25,44 @@ class Driverthebest extends GetxController {
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:io';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:get/get.dart';
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/box_name.dart';
import '../../constant/char_map.dart';
import '../../constant/info.dart';
import '../../constant/links.dart';
import '../../env/env.dart';
import '../../main.dart';
import '../../print.dart';
import '../../views/widgets/elevated_btn.dart';
import 'device_info.dart';
import 'encrypt_decrypt.dart';
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({
required String link,
Map<String, dynamic>? payload,
}) 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(
link,
);
@@ -26,18 +148,148 @@ class CRUD {
headers: {
"Content-Type": "application/x-www-form-urlencoded",
'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) {
var jsonData = jsonDecode(response.body);
if (response.statusCode == 200) {
Log.print('response: ${response.body}');
var jsonData = jsonDecode(response.body);
if (jsonData['status'] == 'success') {
return 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()).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();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
} else {
print(response.reasonPhrase);
}
} else {}
}
Future<dynamic> getAgoraToken({
@@ -209,15 +458,12 @@ class CRUD {
String imagePathFull =
'${AppLink.server}/card_image/$imagePath-$driverID.jpg';
Log.print('imagePathFull: $imagePathFull');
var request = http.Request(
'POST',
Uri.parse(
'https://eastus.api.cognitive.microsoft.com/computervision/imageanalysis:analyze?features=caption,read&model-version=latest&language=en&api-version=2024-02-01'));
request.body = json.encode({"url": imagePathFull});
Log.print('request.body: ${request.body}');
request.headers.addAll(headers);
Log.print('request.headers: ${request.headers}');
http.StreamedResponse response = await request.send();
@@ -281,49 +527,6 @@ class CRUD {
} 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({
required String link,
Map<String, dynamic>? payload,
@@ -344,7 +547,6 @@ class CRUD {
if (response.statusCode == 200) {
var responseBody = await response.stream.bytesToString();
var data = json.decode(responseBody);
Log.print('data: ${data}');
return data;
} else {}
}
@@ -366,7 +568,6 @@ class CRUD {
body: body,
headers: headers,
);
Log.print('res: ${res.body}');
}
Future<dynamic> postPayMob({

View File

@@ -1,6 +1,48 @@
// 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 {
// 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 {
paymentToken = await generateTokenDriver(amount.toString(), driverID);
var res = await CRUD().post(link: AppLink.addDrivePayment, payload: {
'rideId': 'gift$driverID',
'rideId': 'gift_$driverID _${DateTime.now().toIso8601String()}',
'amount': amount,
'payment_method': 'visaRide',
'passengerID': 'passengerId',
'passengerID': 'gift',
'token': paymentToken,
'driverID': driverID.toString(),
});
if (res != 'failure') {
FirebaseMessagesController().sendNotificationToAnyWithoutData(
'you have gift from SEFER'.tr,
'',
"لديك هدية من سفَر".tr,
'لقد حصلت على هدية من سفر بقيمة $amount ',
token, // Access token correctly
'ding.wav',
);

View File

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

View File

@@ -20,6 +20,7 @@ import '../../controller/functions/gemeni.dart';
import '../../print.dart';
import '../widgets/my_scafold.dart';
import 'captain/captain.dart';
import 'dashboard_widget.dart';
import 'drivers/driver_the_best.dart';
import 'packages.dart';
import 'passenger/passenger.dart';
@@ -29,432 +30,352 @@ import 'wallet/wallet.dart';
class AdminHomePage extends StatelessWidget {
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
Widget build(BuildContext context) {
Get.put(DashboardController());
return MyScafolld(
title: 'Admin Home Page',
action: IconButton(
onPressed: () async {
await Get.find<DashboardController>().getDashBoard();
},
icon: const Icon(
Icons.refresh,
color: AppColor.greenColor,
),
title: 'Admin Home Page',
action: IconButton(
onPressed: () async {
await Get.find<DashboardController>().getDashBoard();
},
icon: const Icon(
Icons.refresh,
color: AppColor.greenColor,
),
body: [
GetBuilder<DashboardController>(builder: (dashboardController) {
return dashboardController.dashbord.isEmpty
? const MyCircularProgressIndicator()
: Padding(
padding: const EdgeInsets.all(8.0),
child: ListView(
// crossAxisAlignment: WrapCrossAlignment.center,
// alignment: WrapAlignment.center,
children: [
Container(
width: Get.width,
height: Get.height * .6,
decoration: AppStyle.boxDecoration1,
child: Wrap(
spacing: 6,
alignment: WrapAlignment.spaceBetween,
runAlignment: WrapAlignment.spaceBetween,
children: [
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Text(
'Sms',
style: AppStyle.title,
),
Text(dashboardController.creditSMS
.toString()),
],
),
)),
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Text(
'Passengers',
style: AppStyle.title,
),
Text(dashboardController.dashbord[0]
['countPassengers']
.toString()),
],
),
)),
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Text(
'Drivers',
style: AppStyle.title,
),
Text(dashboardController.dashbord[0]
['countDriver']
.toString()),
],
),
)),
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Text(
'Rides this month',
style: AppStyle.title,
),
Text(dashboardController.dashbord[0]
['countRideThisMonth']
.toString()),
],
),
)),
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Text(
'avg costs',
style: AppStyle.title,
),
Text(dashboardController.dashbord[0]
['avg_passenger_price']
.toString()),
],
),
)),
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Text(
'completed ride',
style: AppStyle.title,
),
Text(dashboardController.dashbord[0]
['completed_rides']
.toString()),
],
),
)),
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Text(
'cancelled ride',
style: AppStyle.title,
),
Text(dashboardController.dashbord[0]
['cancelled_rides']
.toString()),
],
),
)),
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Text(
'payments to driver',
style: AppStyle.title,
),
Text(dashboardController.dashbord[0]
['payments']
.toString()),
],
),
)),
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Text(
'sefer wallet',
style: AppStyle.title,
),
Text(dashboardController.dashbord[0]
['seferWallet']
.toString()),
],
),
)),
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();
),
body: [
// This is a List<Widget> for MyScafolld
GetBuilder<DashboardController>(builder: (dashboardController) {
return dashboardController.dashbord.isEmpty
? const MyCircularProgressIndicator()
: Padding(
// This Padding wraps the entire content for this section
padding: const EdgeInsets.all(8.0),
child: ListView(
// Changed from a direct ListView for the whole page
// to a ListView that contains the stats grid and then other items.
children: [
// --- Statistics Grid Section ---
Container(
// width: Get.width, // Not needed in ListView
// height: Get.height * .6, // Let GridView determine its height
padding: const EdgeInsets.all(
8.0), // Padding for the grid container
decoration: AppStyle.boxDecoration1.copyWith(
// Optional: slightly different background for the grid area
// color: (AppStyle.boxDecoration1.color as Color?)?.withAlpha(200) ?? Theme.of(context).cardColor.withAlpha(200),
boxShadow: [] // Remove shadow if cards have them, or use a very subtle one
),
child: GridView.count(
crossAxisCount: _calculateCrossAxisCount(context),
shrinkWrap: true,
physics:
const NeverScrollableScrollPhysics(), // Grid shouldn't scroll independently
mainAxisSpacing: 10.0,
crossAxisSpacing: 10.0,
childAspectRatio:
1.7, // Adjust for desired card W/H ratio (e.g. 1.5 to 2.0)
children: [
DashboardStatCard(
title: 'SMS Credits',
value: dashboardController.creditSMS.toString(),
icon: Icons.sms_outlined,
iconColor: Colors.lightBlueAccent,
),
DashboardStatCard(
title: 'Passengers',
value: dashboardController.dashbord[0]
['countPassengers']
.toString(),
icon: Icons.people_alt_outlined,
iconColor: Colors.teal,
),
DashboardStatCard(
title: 'Drivers',
value: dashboardController.dashbord[0]
['countDriver']
.toString(),
icon: Icons.sports_motorsports_outlined,
iconColor: Colors.orangeAccent,
),
DashboardStatCard(
title: 'Rides (Month)',
value: dashboardController.dashbord[0]
['countRideThisMonth']
.toString(),
icon: Icons.calendar_month_outlined,
iconColor: Colors.purpleAccent,
),
DashboardStatCard(
title: 'Avg. Ride Cost',
value: _formatCurrency(dashboardController
.dashbord[0]['avg_passenger_price']),
icon: Icons.monetization_on_outlined,
iconColor: Colors.green,
valueColor: Colors.green.shade700,
),
DashboardStatCard(
title: 'Completed Rides',
value: dashboardController.dashbord[0]
['completed_rides']
.toString(),
icon: Icons.check_circle_outline,
iconColor: AppColor.greenColor,
),
DashboardStatCard(
title: 'Cancelled Rides',
value: dashboardController.dashbord[0]
['cancelled_rides']
.toString(),
icon: Icons.cancel_outlined,
iconColor: AppColor.redColor,
),
DashboardStatCard(
title: 'Driver Payments',
value: _formatCurrency(
dashboardController.dashbord[0]['payments']),
icon: Icons.payments_outlined,
iconColor: Colors.indigoAccent,
valueColor: Colors.indigo.shade700,
),
DashboardStatCard(
title: 'Tripz Wallet',
value: _formatCurrency(dashboardController
.dashbord[0]['seferWallet']),
icon: Icons.account_balance_wallet_outlined,
iconColor: Colors.deepOrangeAccent,
valueColor: Colors.deepOrange.shade700,
),
DashboardStatCard(
title: 'Transfers Count',
value: dashboardController.dashbord[0]
['transfer_from_count']
.toString(),
icon: Icons.swap_horiz_outlined,
iconColor: Colors.brown,
),
DashboardStatCard(
title: 'Morning Rides',
value: dashboardController.dashbord[0]
['morning_ride_count']
.toString(),
icon: Icons.wb_sunny_outlined,
iconColor: Colors.amberAccent,
),
DashboardStatCard(
title: 'Evening Rides',
value: dashboardController.dashbord[0]
['evening_ride_count']
.toString(),
icon: Icons.brightness_4_outlined,
iconColor: Colors.blueGrey,
),
DashboardStatCard(
title: 'Night Rides',
value: dashboardController.dashbord[0]
['night_ride_count']
.toString(),
icon: Icons.nightlight_round_outlined,
iconColor: Colors.black54,
),
DashboardStatCard(
title: 'Comfort Type',
value: dashboardController.dashbord[0]['comfort']
.toString(),
icon: Icons.event_seat_outlined,
iconColor: Colors.cyan,
),
DashboardStatCard(
title: 'Speed Type',
value: dashboardController.dashbord[0]['speed']
.toString(),
icon: Icons.speed_outlined,
iconColor: Colors.red,
),
DashboardStatCard(
title: 'Lady Type',
value: dashboardController.dashbord[0]['lady']
.toString(),
icon: Icons.woman_2_outlined,
iconColor: Colors.pinkAccent,
),
],
),
),
// --- End of Statistics Grid Section ---
Get.to(() => const StaticDash());
},
),
AdminWidgetsDashBoard(
title: 'send Whatsapp to Drivers',
onPressed: () async {
Get.defaultDialog(
title: 'Are you sure to send by WhatsApp ?',
middleText: '',
confirm: MyElevatedButton(
title: 'Ok',
kolor: AppColor.greenColor,
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',
onPressed: () async {
await Get.put(NotificationController())
.getTokensDrivers();
}),
AdminWidgetsDashBoard(
title: 'send SMS Drivers',
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,
// --- Your AdminWidgetsDashBoard items follow ---
AdminWidgetsDashBoard(
title: 'Passengers',
icon: Icons.people_outline,
onPressed: () => Get.to(() => Passengrs(),
transition: Transition.topLevel)),
AdminWidgetsDashBoard(
title: 'Captains',
icon: Icons.sports_motorsports_outlined,
onPressed: () => Get.to(() => Captain(),
transition: Transition.size)),
// ... (Add all your other AdminWidgetsDashBoard items here with icons)
AdminWidgetsDashBoard(
title: 'Wallet',
icon: Icons.account_balance_wallet_outlined,
onPressed: () => Get.to(() => Wallet(),
transition: Transition.fade)),
AdminWidgetsDashBoard(
title: 'Rides',
icon: Icons.directions_car_filled_outlined,
onPressed: () => Get.to(() => Rides(),
transition: Transition.downToUp)),
AdminWidgetsDashBoard(
title: 'Static',
icon: Icons.bar_chart_outlined,
onPressed: () async {
await Get.put(StaticController()).getAll();
Get.to(() => const StaticDash());
},
),
AdminWidgetsDashBoard(
title: 'send Whatsapp to Drivers',
icon: Icons.message_outlined,
iconColor: Colors.green,
onPressed: () async {
await Get.put(RegisterCaptainController())
.getDriverNotCompleteRegistration();
Get.to(() => const DriversCantRegister());
},
),
AdminWidgetsDashBoard(
title: 'update packages'.tr,
Get.defaultDialog(
title: 'Are you sure to send by WhatsApp ?',
middleText: '',
confirm: MyElevatedButton(
title: 'Ok',
kolor: AppColor.greenColor,
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 {
Get.to(() => PackageUpdateScreen());
},
),
AdminWidgetsDashBoard(
title: 'Employee'.tr,
await Get.put(NotificationController())
.getTokensDrivers();
}),
AdminWidgetsDashBoard(
title: 'send SMS Drivers',
icon: Icons.sms_outlined,
onPressed: () async {
Get.to(() => EmployeePage());
},
),
AdminWidgetsDashBoard(
title: 'Drivers the best'.tr,
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',
icon: Icons.notification_important_outlined,
onPressed: () async {
Get.to(() => DriverTheBest());
},
),
// AdminWidgetsDashBoard(
// title: 'Llama',
// onPressed: () =>
// CarRegistrationRecognizerController().scanText()),
AdminWidgetsDashBoard(
title: 'Add device to be Admin',
onPressed: () async {
// Map device = DeviceInfoPlus.deviceData;
await CRUD()
.post(link: AppLink.addAdminUser, payload: {
// 'deviceNumber': device['serialNumber'].toString(),
'name': 'b',
});
}),
],
),
);
})
],
isleading: false);
await Get.put(NotificationController())
.getTokensPassengers();
}),
AdminWidgetsDashBoard(
title: 'register captain'.tr,
icon: Icons.person_add_alt_1_outlined,
onPressed: () async {
await Get.put(RegisterCaptainController())
.getDriverNotCompleteRegistration();
Get.to(() => const DriversCantRegister());
},
),
AdminWidgetsDashBoard(
title: 'update packages'.tr,
icon: Icons.inventory_2_outlined,
onPressed: () async {
Get.to(() => PackageUpdateScreen());
},
),
AdminWidgetsDashBoard(
title: 'Employee'.tr,
icon: Icons.badge_outlined,
onPressed: () async {
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,
required this.title,
required this.onPressed,
this.icon, // Optional icon
this.iconColor,
this.backgroundColor,
});
final String title;
final Callback onPressed;
final IconData? icon;
final Color? iconColor;
final Color? backgroundColor;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.symmetric(vertical: 6.0, horizontal: 12.0),
child: InkWell(
onTap: onPressed,
borderRadius:
BorderRadius.circular(12.0), // Rounded corners for tap effect
child: Container(
decoration: AppStyle.boxDecoration,
height: 50,
width: Get.width * .4,
child: Center(
child: Text(
title.tr,
style: AppStyle.title,
),
padding: const EdgeInsets.symmetric(
horizontal: 16.0, vertical: 16.0), // Increased padding
decoration: BoxDecoration(
color: backgroundColor ??
Theme.of(context).cardColor, // Use provided or theme card color
borderRadius: BorderRadius.circular(12.0),
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/style.dart';
import '../../../controller/admin/captain_admin_controller.dart';
import '../../../controller/functions/encrypt_decrypt.dart';
import '../../widgets/elevated_btn.dart';
import '../../widgets/my_scafold.dart';
import '../../widgets/my_textField.dart';
@@ -153,7 +154,7 @@ class Captain extends StatelessWidget {
.spaceBetween,
children: [
Text(
'Name : ${user['first_name']} ${user['last_name']}',
'Name : ${(user['first_name'])} ${(user['last_name'])}',
style: AppStyle.title,
),
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: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/views/admin/wallet/wallet.dart';
import 'package:sefer_admin1/views/widgets/elevated_btn.dart';
import 'package:sefer_admin1/views/widgets/my_scafold.dart';
import '../../../controller/drivers/driverthebest.dart';
import 'alexandria.dart';
import 'giza.dart';
class DriverTheBest extends StatelessWidget {
const DriverTheBest({super.key});
@override
Widget build(BuildContext context) {
Get.put(Driverthebest());
Get.put(Driverthebest(), permanent: true);
return MyScafolld(
title: 'Best Drivers'.tr,
body: [
GetBuilder<Driverthebest>(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('200',
driver['id'].toString(), driver['token']);
await wallet.addSeferWallet(
'200', driver['id'].toString());
? Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
MyElevatedButton(
title: 'Giza',
onPressed: () {
Get.to(() => DriverTheBestGiza());
}),
MyElevatedButton(
title: 'Alexandria',
onPressed: () {
Get.to(() => DriverTheBestAlexandria());
}),
],
),
SizedBox(
height: Get.height * .7,
child: ListView.builder(
itemCount: driverthebest.driver.length,
itemBuilder: (context, index) {
final driver = driverthebest.driver[index];
return ListTile(
leading: CircleAvatar(
child: Text(
(int.parse(driver['driver_count']) * 5 / 3600)
.toStringAsFixed(
0), // 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(
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,
width: 400,
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(
height: 10,
@@ -174,7 +175,7 @@ class EmployeeDetails extends StatelessWidget {
height: 200,
width: 400,
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:get/get.dart';
import 'package:sefer_admin1/controller/functions/encrypt_decrypt.dart';
import '../../../constant/style.dart';
import '../../../controller/admin/passenger_admin_controller.dart';
@@ -136,7 +137,7 @@ class Passengrs extends StatelessWidget {
.spaceBetween,
children: [
Text(
'Name : ${user['first_name']} ${user['last_name']}',
'Name : ${(user['first_name'])} ${(user['last_name'])}',
style: AppStyle.title,
),
Text(

View File

@@ -5,6 +5,7 @@
import FlutterMacOS
import Foundation
import device_info_plus
import file_selector_macos
import firebase_core
import firebase_crashlytics
@@ -12,11 +13,13 @@ import firebase_messaging
import flutter_image_compress_macos
import flutter_secure_storage_macos
import google_sign_in_ios
import local_auth_darwin
import path_provider_foundation
import sqflite
import sqflite_darwin
import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseCrashlyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCrashlyticsPlugin"))
@@ -24,6 +27,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin"))
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin"))
FLALocalAuthPlugin.register(with: registry.registrar(forPlugin: "FLALocalAuthPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
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:
path: ./secure_string_operations
dio: ^5.4.3+1
envied: ^0.5.4+1
firebase_core: ^2.30.1
firebase_messaging: ^14.9.1
fl_chart: ^0.67.0
envied: ^1.0.0
firebase_core: ^3.9.0
firebase_messaging: ^15.1.6
fl_chart: ^0.70.0
flutter:
sdk: flutter
flutter_launcher_icons: ^0.13.1
flutter_launcher_icons: ^0.14.2
# flutter_local_notifications: ^17.1.1
# flutter_paypal: ^0.2.0
flutter_secure_storage: ^9.0.0
# flutter_stripe: ^10.1.1
get: ^4.6.6
get_storage: ^2.1.1
google_fonts: ^4.0.4
google_fonts: ^6.2.1
# google_maps_flutter: ^2.6.1
google_sign_in: ^6.2.1
http: ^1.0.0
@@ -61,14 +61,17 @@ dependencies:
url_launcher: ^6.2.6
# webview_flutter: ^4.7.0
googleapis_auth: ^1.6.0
firebase_crashlytics: ^3.5.7
firebase_crashlytics: ^4.2.0
flutter_image_compress: ^2.3.0
jwt_decoder: ^2.0.1
encrypt: ^5.0.3
device_info_plus: ^11.5.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^ 3.0.1
envied_generator: ^0.5.2
flutter_lints: ^5.0.0
envied_generator: ^1.0.0
build_runner: ^2.4.6
flutter_launcher_icons: