feat: استيراد كود سيرو إلى تريبز (سيرو @ecfe7568) — بلا تعديل

قرار المالك 2026-07-27: باك إند سيرو PHP هو المعتمد، وتطبيقاته المجرّبة
ميدانياً تحل محل إعادة البناء المؤرشفة. سيرو نفسه لم يُمسّ.

الخريطة:
  backend · payment_server · loction_server · ride_server ·
  passenger_server · docker · dashboard · stress_test  → الجذر
  siro_rider  → apps/rider          siro_driver  → apps/driver
  siro_admin  → dashboards/admin    siro_service → dashboards/service
  android_bot → apps/android_bot    socialBot    → apps/socialBot

نُسخ المتعقَّب في git سيرو فقط عبر `git archive` (3,198 ملفاً / ~169 م.ب)
لا `cp -r` — فاستُثنيت مخلفات البناء تلقائياً. بلا أي تعديل محتوى عمداً:
كل ما يلي يصير فرقاً مقروءاً مقابل المصدر.

لم يُستورد وسببه: siromove.com (الموقع التسويقي يبقى marketing/ في تريبز،
سيرو فيه 8 ملفات) · docs و planning (تريبز له docs/ الخاص) · deploy.sh
(ليس نشراً على سيرفر بل `git add . && git push origin --all` — فخّ في
مستودع آخر) · transit_dashboard (بانتظار قرار مصير backend-transit و
dashboards/transit-web).

⚠️ لا يبني بعد — ثلاثة نواقص متوقعة ومقصودة:
1. `.env` و `lib/env/env.g.dart` غير متعقَّبين في سيرو (أسرار لكل مستأجر):
   كل تطبيق فلاتر يحتاج .env خاصاً ثم توليد env.g.dart بـ build_runner.
2. إعدادات Firebase (9 ملفات google-services.json و GoogleService-Info.plist)
   يستبعدها .gitignore تريبز — ولكل مستأجر مشروع Firebase خاص أصلاً.
3. apps/driver في سيرو يشير إلى `../../Intaleq/packages/get` خارج المستودع →
   يجب ضمّ الحزم داخله أسوة بـ apps/rider.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Hamza-Ayed
2026-07-27 05:14:13 +03:00
co-authored by Claude Opus 5
parent 9909d9b4c1
commit 4d8414c96b
3198 changed files with 766859 additions and 0 deletions
@@ -0,0 +1,72 @@
import 'package:secure_string_operations/secure_string_operations.dart';
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 secretKey = X.r(X.r(X.r(Env.secretKey, cn), cC), cs);
static final String basicAuthCredentials =
X.r(X.r(X.r(Env.basicAuthCredentials, cn), cC), cs);
static final String accountSIDTwillo =
X.r(X.r(X.r(Env.accountSIDTwillo, cn), cC), cs);
static final String serverAPI = X.r(X.r(X.r(Env.serverAPI, cn), cC), cs);
static final String mapAPIKEY = X.r(X.r(X.r(Env.mapAPIKEY, cn), cC), cs);
static final String twilloRecoveryCode =
X.r(X.r(X.r(Env.twilloRecoveryCode, cn), cC), cs);
static final String authTokenTwillo =
X.r(X.r(X.r(Env.authTokenTwillo, cn), cC), cs);
static final String chatGPTkey = X.r(X.r(X.r(Env.chatGPTkey, cn), cC), cs);
static final String transactionCloude =
X.r(X.r(X.r(Env.transactionCloude, cn), cC), cs);
static final String visionApi = X.r(X.r(X.r(Env.visionApi, cn), cC), cs);
static final String chatGPTkeySefer =
X.r(X.r(X.r(Env.chatGPTkeySefer, cn), cC), cs);
static final String chatGPTkeySeferNew =
X.r(X.r(X.r(Env.chatGPTkeySeferNew, cn), cC), cs);
static final String serverPHP = Env.serverPHP;
static final String llamaKey = X.r(X.r(X.r(Env.llamaKey, cn), cC), cs);
static final String cohere = X.r(X.r(X.r(Env.cohere, cn), cC), cs);
static final String claudeAiAPI = X.r(X.r(X.r(Env.claudeAiAPI, cn), cC), cs);
static final String geminiApi = X.r(X.r(X.r(Env.geminiApi, cn), cC), cs);
static final String agoraAppId = X.r(X.r(X.r(Env.agoraAppId, cn), cC), cs);
static final String agoraAppCertificate =
X.r(X.r(X.r(Env.agoraAppCertificate, cn), cC), cs);
static final String integrationIdPayMob =
X.r(X.r(X.r(Env.integrationIdPayMob, cn), cC), cs);
static final String passwordPayMob =
X.r(X.r(X.r(Env.passwordPayMob, cn), cC), cs);
static final String usernamePayMob =
X.r(X.r(X.r(Env.usernamePayMob, cn), cC), cs);
static final String payMobApikey =
X.r(X.r(X.r(Env.payMobApikey, cn), cC), cs);
static final String integrationIdPayMobWallet =
X.r(X.r(X.r(Env.integrationIdPayMobWallet, cn), cC), cs);
static final String smsPasswordEgypt =
X.r(X.r(X.r(Env.smsPasswordEgypt, cn), cC), cs);
static final String ocpApimSubscriptionKey = Env.ocpApimSubscriptionKey;
static final String chatGPTkeySeferNew4 =
X.r(X.r(X.r(Env.chatGPTkeySeferNew4, cn), cC), cs);
static final String anthropicAIkeySeferNew =
X.r(X.r(X.r(Env.anthropicAIkeySeferNew, cn), cC), cs);
static final String llama3Key = X.r(X.r(X.r(Env.llama3Key, cn), cC), cs);
static final String payMobOutClientSecrret =
X.r(X.r(X.r(Env.payMobOutClientSecrret, cn), cC), cs);
static final String payMobOutClient_id =
X.r(X.r(X.r(Env.payMobOutClient_id, cn), cC), cs);
static final String payMobOutPassword =
X.r(X.r(X.r(Env.payMobOutPassword, cn), cC), cs);
static final String payMobOutUserName =
X.r(X.r(X.r(Env.payMobOutUserName, cn), cC), cs);
///////////
static final String keyOfApp = X.r(X.r(X.r(Env.keyOfApp, cn), cC), cs);
}
@@ -0,0 +1,84 @@
class BoxName {
static const String driverID = "driverID";
static const String countryCode = "countryCode";
static const String googlaMapApp = "googlaMapApp";
static const String lang = "lang";
static const String carType = "carType";
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 phoneVerified = "phoneVerified";
static const String adminPhone = "adminPhone";
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";
static const String serverChosen = "serverChosen";
static const String addWork = 'addWork';
static const String addHome = 'addHome';
static const String tipPercentage = 'tipPercentage';
static const String faceDetectTimes = "faceDetectTimes";
static const String sosPhonePassenger = "sosPhonePassenger";
static const String sosPhoneDriver = "sosPhoneDriver";
static const String passengerID = "pasengerID";
static const String phone = "phone";
static const String phoneDriver = "phoneDriver";
static const String dobDriver = "dobDriver";
static const String sexDriver = "sexDriver";
static const String lastNameDriver = "lastNameDriver";
static const String name = "name";
static const String nameDriver = "nameDriver";
static const String driverPhotoUrl = "driverPhotoUrl";
static const String email = "email";
static const String emailDriver = "emailDriver";
static const String tokens = "tokens";
static const String tokensDrivers = "tokensDrivers";
static const String tokensPassengers = "tokensPassengers";
static const String tokenFCM = "tokenFCM";
static const String tokenDriver = "tokenDriver";
static const String cardNumber = "cardNumber";
static const String cardNumberDriver = "cardNumberDriver";
static const String cardHolderName = "cardHolderName";
static const String cardHolderNameDriver = "cardHolderNameDriver";
static const String expiryDate = "expiryDate";
static const String expiryDateDriver = "expiryDateDriver";
static const String cvvCode = "cvvCode";
static const String cvvCodeDriver = "cvvCodeDriver";
static const String passengerWalletDetails = "passengerWalletDetails";
static const String passengerWalletTotal = "passengerWalletTotal";
static const String passengerWalletFound = "passengerWalletFound";
static const String periods = 'periods';
static const String onBoarding = 'onBoarding';
static const String apiKeyRun = 'apiKeyRun';
static const String serverAPI = 'serverAPI';
static const String secretKey = 'secretKey';
static const String basicAuthCredentials = 'basicAuthCredentials';
static const String mapAPIKEY = 'mapAPIKEY';
static const String twilloRecoveryCode = 'twilloRecoveryCode';
static const String accountSIDTwillo = 'accountSIDTwillo';
static const String authTokenTwillo = 'authTokenTwillo';
static const String chatGPTkey = 'chatGPTkey';
static const String chatGPTkeySefer = 'chatGPTkeySefer';
static const String transactionCloude = 'transactionCloude';
static const String visionApi = 'visionApi';
static const String vin = "vin";
static const String make = "make";
static const String model = "model";
static const String year = "year";
static const String expirationDate = "expirationDate";
static const String color = "color";
static const String owner = "owner";
static const String registrationDate = "registrationDate";
static const String recentLocations = 'recentLocations';
static const String tripData = 'tripData';
}
@@ -0,0 +1,68 @@
Map<String, String> cn = {
"0": "3",
"1": "7",
"2": "1",
"3": "9",
"4": "0",
"5": "5",
"6": "2",
"7": "6",
"8": "4",
"9": "8"
};
Map<String, String> cs = {
"a": "q",
"b": "x",
"c": "f",
"d": "y",
"e": "j",
"f": "u",
"g": "k",
"h": "w",
"i": "o",
"j": "e",
"k": "g",
"l": "r",
"m": "n",
"n": "b",
"o": "i",
"p": "v",
"q": "a",
"r": "l",
"s": "z",
"t": "c",
"u": "h",
"v": "p",
"w": "t",
"x": "d",
"y": "s",
"z": "m"
};
Map<String, String> cC = {
"A": "Q",
"B": "X",
"C": "F",
"D": "Y",
"E": "J",
"F": "U",
"G": "K",
"H": "W",
"I": "O",
"J": "E",
"K": "G",
"L": "R",
"M": "N",
"N": "B",
"O": "I",
"P": "V",
"Q": "A",
"R": "L",
"S": "Z",
"T": "C",
"U": "H",
"V": "P",
"W": "T",
"X": "D",
"Y": "S",
"Z": "M"
};
+42
View File
@@ -0,0 +1,42 @@
import 'package:flutter/material.dart';
class AppColor {
AppColor._();
// ─── Dark Mode Palette (static fallback / design tokens) ─────────────────
static const Color bg = Color(0xFF0A0A0B);
static const Color surface = Color(0xFF161618);
static const Color surfaceElevated = Color(0xFF222225);
static const Color surfaceGlass = Color(0xCC161618);
static const Color accent = Color(0xFF6366F1);
static const Color accentSoft = Color(0x266366F1);
static const Color accentBorder = Color(0x4D6366F1);
static const Color glow = Color(0xFF818CF8);
static const Color danger = Color(0xFFEF4444);
static const Color dangerSoft = Color(0x26EF4444);
static const Color success = Color(0xFF10B981);
static const Color successSoft = Color(0x2610B981);
static const Color warning = Color(0xFFF59E0B);
static const Color warningSoft = Color(0x26F59E0B);
static const Color info = Color(0xFF3B82F6);
static const Color infoSoft = Color(0x263B82F6);
static const Color textPrimary = Color(0xFFF3F4F6);
static const Color textSecondary = Color(0xFF9CA3AF);
static const Color textMuted = Color(0xFF6B7280);
static const Color divider = Color(0xFF2D2D30);
static const Color cardShadow = Color(0x66000000);
// ─── Legacy Mappings ─────────────────────────────────────────────────────
static const Color primaryColor = bg;
static const Color secondaryColor = textPrimary;
static const Color accentColor = accent;
static const Color redColor = danger;
static const Color greenColor = success;
static const Color blueColor = info;
static const Color yellowColor = warning;
static const Color deepPurpleAccent = accent;
}
@@ -0,0 +1,144 @@
import 'dart:convert';
import 'package:crypto/crypto.dart';
import '../controller/functions/crud.dart';
import '../main.dart';
import 'box_name.dart';
import 'char_map.dart';
import 'links.dart';
class AC {
gAK() async {
if (box.read(BoxName.apiKeyRun).toString() != 'run') {
var res = await CRUD().get(link: AppLink.getApiKey, payload: {});
var decod = res is String ? jsonDecode(res) : res;
print(decod);
Map<String, dynamic> jsonData = {};
for (var i = 0; i < decod['message'].length; i++) {
String h = decod['message'][i]['hashed_key'].toString();
String retrievedString = r(r(r(h, cn), cC), cs);
await storage.write(
key: decod['message'][i]['name'].toString(),
value: retrievedString.toString(),
);
//
String name = decod['message'][i]['name'].toString();
String value = decod['message'][i]['hashed_key'].toString();
jsonData[name] = value;
}
String jsonString = json.encode(jsonData);
print(jsonString);
box.write(BoxName.apiKeyRun, 'run');
}
}
String q(String b, String c) {
final d = utf8.encode(c);
final e = utf8.encode(b);
final f = Hmac(sha256, d);
final g = f.convert(e);
final h = g.bytes;
final i = base64Url.encode(h);
return i;
}
String j(String k, String l) {
final m = utf8.encode(l);
final n = base64Url.decode(k);
final o = Hmac(sha256, m);
final p = o.convert(n);
final q = utf8.decode(p.bytes);
return q;
}
String a(String b, String c) {
int d = b.length;
int e = d ~/ 4;
List<String> f = [];
for (int g = 0; g < d; g += e) {
int h = g + e;
if (h > d) {
h = d;
}
String i = b.substring(g, h);
f.add(i);
}
print(f);
Map<String, String> j = {};
j['birinci'] = f[4];
j['ikinci'] = f[2];
j['üçüncü'] = c + f[1];
j['dördüncü'] = f[0];
j['beş'] = f[3];
String k = '';
j.forEach((l, m) {
k += m;
});
return k;
}
Map<String, String> n(String o, String c) {
String p = o.replaceAll(c, '');
Map<String, String> q = {};
q['birinci'] = p[p.length - 5] + p[p.length - 3];
q['ikinci'] = p[p.length - 1] + p[p.length - 15];
q['üçüncü'] = p[p.length - 9] + p[p.length - 12];
q['dördüncü'] = p[p.length - 11] + p[p.length - 6];
q['beş'] = p[p.length - 2] + p[p.length - 8];
return q;
}
String c(String a, Map<String, String> b) {
StringBuffer c = StringBuffer();
c.write(a);
String d = "Bl";
c.write(b[d] ?? d);
StringBuffer e = StringBuffer();
String f = c.toString();
for (int g = 0; g < f.length; g++) {
String h = f[g];
e.write(b[h] ?? h);
}
return e.toString();
}
String r(String a, Map<String, String> b) {
StringBuffer c = StringBuffer();
String d = "Bl";
int e = d.length;
for (int f = 0; f < a.length; f++) {
String g = a[f];
String h = b.keys.firstWhere(
(i) => b[i] == g,
orElse: () => g,
);
c.write(h);
}
String j = c.toString();
if (j.endsWith(d)) {
j = j.substring(0, j.length - e);
}
return j;
}
}
File diff suppressed because one or more lines are too long
+477
View File
@@ -0,0 +1,477 @@
import '../env/env.dart';
import '../main.dart';
class AppLink {
static String seferPaymentServer =
'https://walletintaleq.intaleq.xyz/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 String get currentCountry => box.read('countryCode') ?? 'Jordan';
static String get server {
switch (currentCountry) {
case 'Syria':
return 'https://api-syria.siromove.com/siro_v3';
case 'Egypt':
return 'https://api-egypt.siromove.com/siro_v3';
case 'Jordan':
return 'https://jordan-siro.intaleqapp.com/backend';
default:
return 'https://api.siromove.com/siro_v3';
}
}
static String get endPoint => server;
static String get syria => 'https://api-syria.siromove.com/siro';
static String get paymentServer {
switch (currentCountry) {
case 'Syria':
return 'https://wallet-syria.siromove.com/v1/main';
case 'Egypt':
return 'https://wallet-egypt.siromove.com/v1/main';
case 'Jordan':
// TODO: Change to new subdomain when fully migrated
return 'https://walletintaleq.intaleq.xyz/v2/main';
default:
return 'https://wallet.siromove.com/v1/main';
}
}
static String get locationServer {
switch (currentCountry) {
case 'Syria':
return 'https://location-syria.siromove.com/siro/ride/location';
case 'Egypt':
return 'https://location-egypt.siromove.com/siro/ride/location';
case 'Jordan':
return 'https://jordan-siro.intaleqapp.com/loction_server/siro/ride/location';
default:
return 'https://location.siromove.com/siro/ride/location';
}
}
static String get locationServerSide => locationServer;
static String get mapSaasRoute {
switch (currentCountry) {
case 'Syria':
return 'https://map-syria.siromove.com/api/maps/route';
case 'Egypt':
return 'https://map-egypt.siromove.com/api/maps/route';
case 'Jordan':
// TODO: Change to new subdomain when fully migrated
return 'https://map-saas.intaleqapp.com/api/maps/route';
default:
return 'https://map-saas.intaleqapp.com/api/maps/route';
}
}
static String get mapSaasPlaces {
switch (currentCountry) {
case 'Syria':
return 'https://map-syria.siromove.com/api/geocoding/places';
case 'Egypt':
return 'https://map-egypt.siromove.com/api/geocoding/places';
case 'Jordan':
// TODO: Change to new subdomain when fully migrated
return 'https://map-saas.intaleqapp.com/api/geocoding/places';
default:
return 'https://map-saas.intaleqapp.com/api/geocoding/places';
}
}
static String get routeApiBaseUrl {
switch (currentCountry) {
case 'Syria':
return 'https://routes-syria.siromove.com/route/v1/driving';
case 'Egypt':
return 'https://routes-egypt.siromove.com/route/v1/driving';
case 'Jordan':
// TODO: Change to new subdomain when fully migrated
return 'https://routesjo.intaleq.xyz';
default:
return 'https://routes.siromove.com/route/v1/driving';
}
}
static String loginJwtDriver = "$server/loginAdmin.php";
//=============================
//=============================
static final getAllFingerprints =
'$server/migration/get_all_fingerprints.php';
static final updateFingerprintAdmin =
'$server/migration/update_fingerprint_admin.php';
static final getAllDriverFingerprints =
'$server/migration/get_all_driver_fingerprints.php';
static final updateDriverFingerprintAdmin =
'$server/migration/update_driver_fingerprint_admin.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 serverMonitor = "$server/Admin/monitor.php";
static String test = "$server/test.php";
static String loginWalletAdmin = "$seferPaymentServer/loginWalletAdmin.php";
static String loginWalletAdminV3 = "$server/Admin/auth/loginWallet.php";
//===============firebase==========================
static String getTokens = "$server/ride/firebase/get.php";
static String getInvoices = "$server/Admin/adminUser/invoice_total.php";
static String addInvoice = "$server/Admin/adminUser/add_invoice.php";
static String getAllTokenDrivers =
"$server/ride/firebase/getALlTokenDrivers.php";
static String getAllTokenPassengers =
"$server/ride/firebase/getAllTokenPassengers.php";
static String addTokens = "$server/ride/firebase/add.php";
static String addTokensDriver = "$server/ride/firebase/addDriver.php";
//=======================Wallet===================
static String addPaymentTokenDriver =
"$tripzPaymentServer/driverWallet/addPaymentToken.php";
static String addSeferWallet = "$tripzPaymentServer/seferWallet/add.php";
static String getPaymentsDashboard =
"$seferPaymentServer/Admin/getPaymentsDashboard.php";
static String getSeferWallet = "$tripzPaymentServer/seferWallet/get.php";
static String addDrivePayment = "$tripzPaymentServer/payment/add.php";
static String addFromAdmin =
"$tripzPaymentServer/driverWallet/addFromAdmin.php";
static String add300ToDriver =
"$tripzPaymentServer/driverWallet/add300ToDriver.php";
static String updatePaymetToPaid =
"$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";
static String getPassengersWallet = "$wallet/get.php";
static String getPassengerWalletArchive =
"$wallet/getPassengerWalletArchive.php";
static String addPassengersWallet = "$wallet/add.php";
static String deletePassengersWallet = "$wallet/delete.php";
static String updatePassengersWallet = "$wallet/update.php";
static String getWalletByDriver = "$walletDriver/getWalletByDriver.php";
static String getDriversWallet = "$walletDriver/get.php";
static String addDriversWalletPoints = "$walletDriver/add.php";
static String deleteDriversWallet = "$walletDriver/delete.php";
static String updateDriversWallet = "$walletDriver/update.php";
//=======================promo===================ride.mobile-app.store/ride/promo/get.php
static String promo = '$server/ride/promo';
static String getPassengersPromo = "$promo/get.php";
static String getPromoBytody = "$promo/getPromoBytody.php";
static String addPassengersPromo = "$promo/add.php";
static String deletePassengersPromo = "$promo/delete.php";
static String updatePassengersPromo = "$promo/update.php";
////=======================cancelRide===================
static String ride = '$server/ride';
static String addCancelRideFromPassenger = "$server/ride/cancelRide/add.php";
static String cancelRide = "$server/ride/cancelRide/get.php";
//-----------------ridessss------------------
static String addRides = "$ride/rides/add.php";
static String getRides = "$ride/rides/get.php";
static String getRideOrderID = "$ride/rides/getRideOrderID.php";
static String getRideStatus = "$ride/rides/getRideStatus.php";
static String getRideStatusBegin = "$ride/rides/getRideStatusBegin.php";
static String getRideStatusFromStartApp =
"$ride/rides/getRideStatusFromStartApp.php";
static String updateRides = "$ride/rides/update.php";
static String updateStausFromSpeed = "$ride/rides/updateStausFromSpeed.php";
static String deleteRides = "$ride/rides/delete.php";
//-----------------DriverPayment------------------
static String adddriverScam = "$ride/driver_scam/add.php";
static String getdriverScam = "$ride/driver_scam/get.php";
/////////---getKazanPercent===////////////
static String getKazanPercent = "$ride/kazan/get.php";
static String addKazanPercent = "$ride/kazan/add.php";
static String updateKazanPercent = "$ride/kazan/update.php";
////-----------------DriverPayment------------------
static String addDriverpayment = "$tripzPaymentServer/payment/add.php";
static String addDriverPaymentPoints =
"$tripzPaymentServer/driverPayment/add.php";
static String getDriverPaymentPoints =
"$tripzPaymentServer/driverWallet/get.php";
static String getDriverpaymentToday = "$tripzPaymentServer/payment/get.php";
static String getCountRide = "$tripzPaymentServer/payment/getCountRide.php";
static String getAllPaymentFromRide =
"$tripzPaymentServer/payment/getAllPayment.php";
static String getAllPaymentVisa =
"$tripzPaymentServer/payment/getAllPaymentVisa.php";
//-----------------Passenger NotificationCaptain------------------
static String addNotificationPassenger =
"$ride/notificationPassenger/add.php";
static String send_whatsapp_message =
"$server/Admin/send_whatsapp_message.php";
static String getNotificationPassenger =
"$ride/notificationPassenger/get.php";
static String updateNotificationPassenger =
"$ride/notificationPassenger/update.php";
//-----------------Driver NotificationCaptain------------------
static String addNotificationCaptain = "$ride/notificationCaptain/add.php";
static String addWaitingRide = "$ride/notificationCaptain/addWaitingRide.php";
static String getRideWaiting = "$ride/notificationCaptain/getRideWaiting.php";
static String getNotificationCaptain = "$ride/notificationCaptain/get.php";
static String updateNotificationCaptain =
"$ride/notificationCaptain/update.php";
static String deleteNotificationCaptain =
"$ride/notificationCaptain/delete.php";
//-----------------Api Key------------------
static String addApiKey = "$ride/apiKey/add.php";
static String getApiKey = "$ride/apiKey/get.php";
static String getCnMap = "$server/auth/cnMap.php";
static String updateApiKey = "$ride/apiKey/update.php";
static String deleteApiKey = "$ride/apiKey/delete.php";
//-----------------Feed Back------------------
static String addFeedBack = "$ride/feedBack/add.php";
static String getFeedBack = "$ride/feedBack/get.php";
static String updateFeedBack = "$ride/feedBack/updateFeedBack.php";
//-----------------Tips------------------
static String addTips = "$ride/tips/add.php";
static String getTips = "$ride/tips/get.php";
static String updateTips = "$ride/tips/update.php";
//-----------------Help Center------------------
static String addhelpCenter = "$ride/helpCenter/add.php";
static String gethelpCenter = "$ride/helpCenter/get.php";
static String getByIdhelpCenter = "$ride/helpCenter/getById.php";
static String updatehelpCenter = "$ride/helpCenter/update.php";
static String deletehelpCenter = "$ride/helpCenter/delete.php";
//-----------------license------------------
static String addLicense = "$ride/license/add.php";
static String getLicense = "$ride/license/get.php";
static String updateLicense = "$ride/license/updateFeedBack.php";
//-----------------RegisrationCar------------------
static String addRegisrationCar = "$ride/RegisrationCar/add.php";
static String getRegisrationCar = "$ride/RegisrationCar/get.php";
static String updateRegisrationCar = "$ride/RegisrationCar/update.php";
//-----------------DriverOrder------------------
static String addDriverOrder = "$ride/driver_order/add.php";
static String getDriverOrder = "$ride/driver_order/get.php";
static String getOrderCancelStatus =
"$ride/driver_order/getOrderCancelStatus.php";
static String updateDriverOrder = "$ride/driver_order/update.php";
static String deleteDriverOrder = "$ride/driver_order/delete.php";
// =====================================
static String addRateToPassenger = "$ride/rate/add.php";
static String addRateToDriver = "$ride/rate/addRateToDriver.php";
static String getDriverRate = "$ride/rate/getDriverRate.php";
static String getPassengerRate = "$ride/rate/getPassengerRate.php";
////////////////emails ============//
static String sendEmailToPassengerForTripDetails =
"$ride/rides/emailToPassengerTripDetail.php";
static String sendEmailToDrivertransaction =
"$server/Admin/sendEmailToDrivertransaction.php";
// ===========================================
static String pathImage = "$server/upload/types/";
static String uploadImage = "$server/uploadImage.php";
static String uploadImage1 = "$server/uploadImage1.php";
static String uploadImagePortrate = "$server/uploadImagePortrate.php";
static String uploadImageType = "$server/uploadImageType.php";
//=============egypt documents ==============
static String uploadEgyptidFront =
"$server/EgyptDocuments/uploadEgyptidFront.php";
static String uploadEgypt = "$server/uploadEgypt.php";
//==================certifcate==========
static String location = locationServer;
static String getCarsLocationByPassenger = "$location/get.php";
static String getFemalDriverLocationByPassenger =
"$location/getFemalDriver.php";
static String getDriverCarsLocationToPassengerAfterApplied =
"$location/getDriverCarsLocationToPassengerAfterApplied.php";
static String addCarsLocationByPassenger = "$location/add.php";
static String deleteCarsLocationByPassenger = "$location/delete.php";
static String updateCarsLocationByPassenger = "$location/update.php";
static String getTotalDriverDuration = "$location/getTotalDriverDuration.php";
static String getTotalDriverDurationToday =
"$location/getTotalDriverDurationToday.php";
//==================Blog=============
static String profile = '$server/ride/profile';
static String getprofile = "$profile/get.php";
static String getCaptainProfile = "$profile/getCaptainProfile.php";
static String addprofile = "$profile/add.php";
static String deleteprofile = "$profile/delete.php";
static String updateprofile = "$profile/update.php";
//===================Auth============
static String auth = '$server/auth';
static String login = "$auth/login.php";
static String signUp = "$auth/signup.php";
static String sendVerifyEmail = "$auth/sendVerifyEmail.php";
static String passengerRemovedAccountEmail =
"$auth/passengerRemovedAccountEmail.php";
static String verifyEmail = "$auth/verifyEmail.php";
//===================Auth Captin============
static String authCaptin = '$server/auth/captin';
static String loginCaptin = "$authCaptin/login.php";
static String signUpCaptin = "$authCaptin/register.php";
static String sendVerifyEmailCaptin = "$authCaptin/sendVerifyEmail.php";
static String verifyEmailCaptin = "$authCaptin/verifyEmail.php";
static String removeUser = "$authCaptin/removeAccount.php";
static String deletecaptainAccounr = "$authCaptin/deletecaptainAccounr.php";
static String updateAccountBank = "$authCaptin/updateAccountBank.php";
static String getAccount = "$authCaptin/getAccount.php";
//===================Admin Captin============
static String getDriversPhonesAndTokens =
"$server/Admin/AdminCaptain/getDriversPhonesAndTokens.php";
static String getPassengerDetailsByPassengerID =
"$server/Admin/getPassengerDetailsByPassengerID.php";
static String getPassengerDetails = "$server/Admin/getPassengerDetails.php";
static String admin_delete_and_blacklist_passenger =
"$server/Admin/passenger/admin_delete_and_blacklist_passenger.php";
static String admin_update_passenger =
"$server/Admin/passenger/admin_update_passenger.php";
static String admin_unblacklist =
"$server/Admin/passenger/admin_unblacklist.php";
static String admin_get_rides_by_phone =
"$server/Admin/rides/admin_get_rides_by_phone.php";
static String admin_update_ride_status =
"$server/Admin/rides/admin_update_ride_status.php";
static String getPassengerbyEmail = "$server/Admin/getPassengerbyEmail.php";
static String updateDriverFromAdmin =
"$server/Admin/driver/updateDriverFromAdmin.php";
static String find_driver_by_phone =
"$server/Admin/driver/find_driver_by_phone.php";
static String getDriversPending =
"$server/auth/driver/drivers_pending_list.php";
static String getDriverDetails =
"$server/auth/driver/driver_details.php";
static String deleteCaptain = "$server/Admin/driver/deleteCaptain.php";
static String addAdminUser = "$server/Admin/adminUser/add.php";
static String addStaff = "$server/Admin/Staff/add.php";
static String getdashbord = "$server/Admin/dashbord.php";
// Marketing & Price Anomalies Endpoints
static String getMarketAnomalies =
"$server/Admin/marketing/get_market_anomalies.php";
static String triggerCampaign =
"$server/Admin/marketing/trigger_campaign.php";
static String getCampaignsLog =
"$server/Admin/marketing/get_campaigns_log.php";
static String getTelemetry = "$server/Admin/marketing/get_telemetry.php";
static String getPriceComparison =
"$server/Admin/marketing/get_price_comparison.php";
static String whatIfSimulator =
"$server/Admin/marketing/what_if_simulator.php";
static String getPriceGapHeatmap =
"$server/Admin/marketing/get_price_gap_heatmap.php";
static String winbackHotspotTargets =
"$server/Admin/marketing/winback_hotspot_targets.php";
static String getMarketShareAnalytics =
"$server/Admin/marketing/get_market_share_analytics.php";
static String aiPricePrediction =
"$server/Admin/marketing/ai_price_prediction.php";
static String saveDriverDestination =
"$server/ride/location/save_driver_destination.php";
static String paymentServerV2 = 'https://walletintaleq.intaleq.xyz/v2/main';
static String realtimeDashboardV2 = "$server/Admin/v2/realtime_dashboard.php";
static String smartAlertsV2 = "$server/Admin/v2/smart_alerts.php";
static String growthV2 = "$server/Admin/v2/analytics/growth.php";
static String revenueV2 = "$server/Admin/v2/analytics/revenue.php";
static String driverRankingV2 =
"$server/Admin/v2/analytics/driver_ranking.php";
static String settlementsV2 =
"$paymentServerV2/Admin/v2/financial/settlements.php";
static String financialStatsV2 =
"$paymentServerV2/Admin/v2/financial/stats.php";
static String dashboardWalletV2 =
"$paymentServerV2/Admin/v2/financial/dashboard_wallet.php";
static String auditLogsV2 = "$server/Admin/v2/security/audit_logs.php";
static String blacklistManager =
"$server/Admin/v2/quality/blacklist_manager.php";
static String driverScorecard =
"$server/Admin/v2/quality/driver_scorecard.php";
static String analyticsDashboardData =
"$server/Admin/v2/analytics/dashboard_data.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";
static String getCaptainDetailsByEmailOrIDOrPhone =
"$server/Admin/AdminCaptain/getCaptainDetailsByEmailOrIDOrPhone.php";
static String getCaptainDetails = "$server/Admin/AdminCaptain/get.php";
static String getVisaForEachDriver =
"$seferPaymentServer/Admin/getVisaForEachDriver.php";
static String getRidesPerMonth =
"$server/Admin/AdminRide/getRidesPerMonth.php";
static String getRidesDetails = "$server/Admin/AdminRide/get.php";
static String getPassengersStatic = "$serviceApp/getPassengersStatic.php";
static String getRidesStatic = "$serviceApp/getRidesStatic.php";
static String getEmployeeStatic = "$serviceApp/getEmployeeStatic.php";
static String getNotesForEmployee = "$serviceApp/getNotesForEmployee.php";
static String getEmployeeDriverAfterCallingRegister =
"$serviceApp/getEmployeeDriverAfterCallingRegister.php";
static String getEditorStatsCalls = "$serviceApp/getEditorStatsCalls.php";
static String getdriverstotalMonthly =
"$serviceApp/getdriverstotalMonthly.php";
////////////////////////
static String serviceApp = "$server/serviceapp";
static String editCarPlate = "$serviceApp/editCarPlate.php";
static String getComplaintAllData = "$serviceApp/getComplaintAllData.php";
static String getComplaintAllDataForDriver =
"$serviceApp/getComplaintAllDataForDriver.php";
static String addCriminalDocuments = "$authCaptin/addCriminalDocuments.php";
static String getPassengersByPhone =
"$server/serviceApp/getPassengersByPhone.php";
static String getDriverByPhone = "$serviceApp/getDriverByPhone.php";
static String getNewDriverRegister = "$serviceApp/getNewDriverRegister.php";
static String addWelcomeDriverNote = "$serviceApp/addWelcomeDriverNote.php";
static String getDriverNotCompleteRegistration =
"$serviceApp/getDriverNotCompleteRegistration.php";
static String getPassengersNotCompleteRegistration =
"$serviceApp/getPassengersNotCompleteRegistration.php";
static String addNotesDriver = "$serviceApp/addNotesDriver.php";
static String getCarPlateNotEdit = "$serviceApp/getCarPlateNotEdit.php";
static String addNotesPassenger = "$serviceApp/addNotesPassenger.php";
static String getPackages = "$serviceApp/getPackages.php";
static String updatePackages = "$serviceApp/updatePackages.php";
static String updatePhoneInvalidSMSPassenger =
"$server/auth/sms/updatePhoneInvalidSMSPassenger.php";
static String detectCountryFromPhone(String phone) {
final clean = phone.replaceAll(RegExp(r'[^0-9]'), '');
if (clean.startsWith('962')) return 'Jordan';
if (clean.startsWith('963')) return 'Syria';
if (clean.startsWith('20')) return 'Egypt';
if (clean.startsWith('07') || clean.startsWith('7')) return 'Jordan';
if (clean.startsWith('09') || clean.startsWith('9')) return 'Syria';
if (clean.startsWith('01') || clean.startsWith('1')) return 'Egypt';
return '';
}
}
+173
View File
@@ -0,0 +1,173 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'colors.dart';
class AppStyle {
AppStyle._();
// ─── Static typography (dark mode defaults, backward compatible) ───────────
static TextStyle display = GoogleFonts.inter(
fontWeight: FontWeight.w800,
fontSize: 32,
color: AppColor.textPrimary,
letterSpacing: -1,
);
static TextStyle headTitle = GoogleFonts.cairo(
fontWeight: FontWeight.bold,
fontSize: 24,
color: AppColor.textPrimary,
);
static TextStyle title = GoogleFonts.inter(
fontWeight: FontWeight.w600,
fontSize: 16,
color: AppColor.textPrimary,
);
static TextStyle subtitle = GoogleFonts.inter(
fontWeight: FontWeight.w500,
fontSize: 14,
color: AppColor.textSecondary,
);
static TextStyle body = GoogleFonts.inter(
fontWeight: FontWeight.normal,
fontSize: 14,
color: AppColor.textPrimary,
);
static TextStyle caption = GoogleFonts.inter(
fontWeight: FontWeight.w400,
fontSize: 12,
color: AppColor.textMuted,
);
static TextStyle number = GoogleFonts.jetBrainsMono(
fontWeight: FontWeight.bold,
fontSize: 15,
color: AppColor.accent,
);
// ─── Context-aware typography (adapts to theme) ───────────────────────────
static TextStyle displayFor(BuildContext context) => GoogleFonts.inter(
fontWeight: FontWeight.w800,
fontSize: 32,
color: Theme.of(context).colorScheme.onSurface,
letterSpacing: -1,
);
static TextStyle headTitleFor(BuildContext context) => GoogleFonts.cairo(
fontWeight: FontWeight.bold,
fontSize: 24,
color: Theme.of(context).colorScheme.onSurface,
);
static TextStyle titleFor(BuildContext context) => GoogleFonts.inter(
fontWeight: FontWeight.w600,
fontSize: 16,
color: Theme.of(context).colorScheme.onSurface,
);
static TextStyle subtitleFor(BuildContext context) => GoogleFonts.inter(
fontWeight: FontWeight.w500,
fontSize: 14,
color: Theme.of(context).colorScheme.onSurfaceVariant,
);
static TextStyle bodyFor(BuildContext context) => GoogleFonts.inter(
fontWeight: FontWeight.normal,
fontSize: 14,
color: Theme.of(context).colorScheme.onSurface,
);
static TextStyle captionFor(BuildContext context) => GoogleFonts.inter(
fontWeight: FontWeight.w400,
fontSize: 12,
color: Theme.of(context).colorScheme.onSurfaceVariant.withValues(alpha: 0.6),
);
static TextStyle numberFor(BuildContext context) => GoogleFonts.jetBrainsMono(
fontWeight: FontWeight.bold,
fontSize: 15,
color: Theme.of(context).colorScheme.primary,
);
// ─── Context-aware decorations ────────────────────────────────────────────
static BoxDecoration cardDecorationFor(BuildContext context) {
final cs = Theme.of(context).colorScheme;
return BoxDecoration(
color: cs.surface,
borderRadius: BorderRadius.circular(16),
border: Border.all(color: cs.outline, width: 1),
boxShadow: [
BoxShadow(
color: cs.shadow.withValues(alpha: context.isDark ? 0.4 : 0.05),
blurRadius: 20,
offset: const Offset(0, 8),
),
],
);
}
static BoxDecoration elevatedCardFor(BuildContext context) {
final cs = Theme.of(context).colorScheme;
return BoxDecoration(
color: cs.surfaceContainerHighest,
borderRadius: BorderRadius.circular(20),
border: Border.all(
color: cs.primary.withValues(alpha: context.isDark ? 0.3 : 0.2),
width: 1,
),
);
}
static BoxDecoration glassDecorationFor(BuildContext context) {
final cs = Theme.of(context).colorScheme;
return BoxDecoration(
color: cs.surface.withValues(alpha: context.isDark ? 0.8 : 0.9),
borderRadius: BorderRadius.circular(24),
border: Border.all(color: cs.outline, width: 1),
);
}
// ─── Legacy static decorations ────────────────────────────────────────────
static BoxDecoration cardDecoration = BoxDecoration(
color: AppColor.surface,
borderRadius: BorderRadius.circular(16),
border: Border.all(color: AppColor.divider, width: 1),
boxShadow: const [
BoxShadow(
color: AppColor.cardShadow,
blurRadius: 20,
offset: Offset(0, 8),
),
],
);
static BoxDecoration elevatedCard = BoxDecoration(
color: AppColor.surfaceElevated,
borderRadius: BorderRadius.circular(20),
border: Border.all(color: AppColor.accentBorder, width: 1),
);
static BoxDecoration glassDecoration = BoxDecoration(
color: AppColor.surfaceGlass,
borderRadius: BorderRadius.circular(24),
border: Border.all(color: AppColor.divider, width: 1),
);
// ─── Legacy Mappings ─────────────────────────────────────────────────────
static TextStyle headTitle2 = headTitle;
static BoxDecoration boxDecoration = cardDecoration;
static BoxDecoration boxDecoration1 = elevatedCard;
}
extension _Brightness on BuildContext {
bool get isDark => Theme.of(this).brightness == Brightness.dark;
}
@@ -0,0 +1,9 @@
class TableName {
static const String placesFavorite = "placesFavorite";
static const String recentLocations = "recentLocations";
static const String carLocations = "carLocations";
static const String driverOrdersRefuse = "driverOrdersRefuse";
static const String rideLocation = "rideLocation";
static const String faceDetectTimes = "faceDetectTimes";
static const String captainNotification = "captainNotification";
}
+608
View File
@@ -0,0 +1,608 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'colors.dart';
class AppTheme {
AppTheme._();
// ─── Dark Theme (Premium SaaS) ─────────────────────────────────────────────
static ThemeData get darkTheme {
final darkScheme = ColorScheme.dark(
brightness: Brightness.dark,
primary: AppColor.accent,
onPrimary: Colors.white,
primaryContainer: AppColor.accentSoft,
onPrimaryContainer: AppColor.accent,
secondary: AppColor.glow,
onSecondary: Colors.white,
secondaryContainer: const Color(0x26818CF8),
onSecondaryContainer: AppColor.glow,
tertiary: AppColor.info,
onTertiary: Colors.white,
surface: AppColor.surface,
onSurface: AppColor.textPrimary,
onSurfaceVariant: AppColor.textSecondary,
error: AppColor.danger,
onError: Colors.white,
errorContainer: AppColor.dangerSoft,
onErrorContainer: AppColor.danger,
outline: AppColor.divider,
outlineVariant: const Color(0xFF3D3D42),
shadow: Colors.black,
scrim: Colors.black54,
inverseSurface: AppColor.textPrimary,
onInverseSurface: AppColor.bg,
inversePrimary: AppColor.glow,
);
return ThemeData(
useMaterial3: true,
brightness: Brightness.dark,
fontFamily: GoogleFonts.tajawal().fontFamily,
scaffoldBackgroundColor: AppColor.bg,
colorScheme: darkScheme,
dividerColor: AppColor.divider,
dividerTheme: const DividerThemeData(
color: AppColor.divider,
thickness: 1,
space: 1,
),
appBarTheme: AppBarTheme(
backgroundColor: AppColor.bg,
elevation: 0,
scrolledUnderElevation: 0,
centerTitle: true,
titleTextStyle: GoogleFonts.tajawal(
color: AppColor.textPrimary,
fontSize: 18,
fontWeight: FontWeight.bold,
),
iconTheme: const IconThemeData(color: AppColor.textPrimary),
),
cardTheme: CardThemeData(
color: AppColor.surface,
elevation: 0,
margin: EdgeInsets.zero,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
side: const BorderSide(color: AppColor.divider, width: 1),
),
),
dialogTheme: DialogThemeData(
backgroundColor: AppColor.surface,
elevation: 24,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
side: const BorderSide(color: AppColor.divider, width: 1),
),
titleTextStyle: GoogleFonts.tajawal(
color: AppColor.textPrimary,
fontSize: 18,
fontWeight: FontWeight.bold,
),
contentTextStyle: GoogleFonts.tajawal(
color: AppColor.textSecondary,
fontSize: 14,
),
),
bottomSheetTheme: const BottomSheetThemeData(
backgroundColor: AppColor.surface,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
),
),
snackBarTheme: SnackBarThemeData(
backgroundColor: AppColor.surfaceElevated,
contentTextStyle: GoogleFonts.tajawal(
color: AppColor.textPrimary,
fontSize: 14,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
behavior: SnackBarBehavior.floating,
),
inputDecorationTheme: InputDecorationTheme(
filled: true,
fillColor: AppColor.surfaceElevated,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none,
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none,
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(color: AppColor.accent, width: 1.5),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(color: AppColor.danger, width: 1),
),
labelStyle: const TextStyle(color: AppColor.textSecondary),
hintStyle: const TextStyle(color: AppColor.textMuted),
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
backgroundColor: AppColor.accent,
foregroundColor: Colors.white,
elevation: 0,
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 14),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
textStyle: GoogleFonts.tajawal(
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
),
outlinedButtonTheme: OutlinedButtonThemeData(
style: OutlinedButton.styleFrom(
foregroundColor: AppColor.textPrimary,
side: const BorderSide(color: AppColor.divider),
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 14),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
textStyle: GoogleFonts.tajawal(
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
),
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(
foregroundColor: AppColor.accent,
textStyle: GoogleFonts.tajawal(
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
),
switchTheme: SwitchThemeData(
thumbColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.selected)) return AppColor.success;
return AppColor.textMuted;
}),
trackColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.selected)) return AppColor.successSoft;
return AppColor.surfaceElevated;
}),
),
popupMenuTheme: PopupMenuThemeData(
color: AppColor.surface,
elevation: 8,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
side: const BorderSide(color: AppColor.divider),
),
),
tooltipTheme: TooltipThemeData(
decoration: BoxDecoration(
color: AppColor.surfaceElevated,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColor.divider),
),
textStyle: GoogleFonts.tajawal(
color: AppColor.textPrimary,
fontSize: 12,
),
),
floatingActionButtonTheme: const FloatingActionButtonThemeData(
backgroundColor: AppColor.accent,
foregroundColor: Colors.white,
elevation: 4,
),
progressIndicatorTheme: const ProgressIndicatorThemeData(
color: AppColor.accent,
linearTrackColor: AppColor.surfaceElevated,
),
tabBarTheme: TabBarThemeData(
labelColor: AppColor.accent,
unselectedLabelColor: AppColor.textSecondary,
indicatorColor: AppColor.accent,
dividerColor: AppColor.divider,
),
chipTheme: ChipThemeData(
backgroundColor: AppColor.surfaceElevated,
labelStyle: GoogleFonts.tajawal(color: AppColor.textPrimary, fontSize: 12),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: const BorderSide(color: AppColor.divider),
),
),
pageTransitionsTheme: PageTransitionsTheme(
builders: {
TargetPlatform.windows: const FadeUpwardsPageTransitionsBuilder(),
TargetPlatform.macOS: const FadeUpwardsPageTransitionsBuilder(),
TargetPlatform.linux: const FadeUpwardsPageTransitionsBuilder(),
TargetPlatform.fuchsia: const FadeUpwardsPageTransitionsBuilder(),
TargetPlatform.android: const FadeUpwardsPageTransitionsBuilder(),
TargetPlatform.iOS: const FadeUpwardsPageTransitionsBuilder(),
},
),
);
}
// ─── Light Theme (Premium SaaS) ────────────────────────────────────────────
static ThemeData get lightTheme {
const bgLight = Color(0xFFF8F9FC);
const surfaceLight = Color(0xFFFFFFFF);
const surfaceElevatedLight = Color(0xFFF1F3F9);
const dividerLight = Color(0xFFE2E5ED);
const textPrimaryLight = Color(0xFF111827);
const textSecondaryLight = Color(0xFF6B7280);
const textMutedLight = Color(0xFF9CA3AF);
const accentLight = Color(0xFF6366F1);
const accentSoftLight = Color(0x1A6366F1);
const glowLight = Color(0xFF4F46E5);
const dangerLight = Color(0xFFDC2626);
const dangerSoftLight = Color(0x1ADC2626);
const successLight = Color(0xFF059669);
const successSoftLight = Color(0x1A059669);
const infoLight = Color(0xFF2563EB);
final lightScheme = ColorScheme.light(
brightness: Brightness.light,
primary: accentLight,
onPrimary: Colors.white,
primaryContainer: accentSoftLight,
onPrimaryContainer: accentLight,
secondary: glowLight,
onSecondary: Colors.white,
secondaryContainer: const Color(0x1A4F46E5),
onSecondaryContainer: glowLight,
tertiary: infoLight,
onTertiary: Colors.white,
surface: surfaceLight,
onSurface: textPrimaryLight,
onSurfaceVariant: textSecondaryLight,
error: dangerLight,
onError: Colors.white,
errorContainer: dangerSoftLight,
onErrorContainer: dangerLight,
outline: dividerLight,
outlineVariant: const Color(0xFFD1D5DB),
shadow: Colors.black26,
scrim: Colors.black38,
inverseSurface: textPrimaryLight,
onInverseSurface: surfaceLight,
inversePrimary: const Color(0xFFC7D2FE),
);
return ThemeData(
useMaterial3: true,
brightness: Brightness.light,
fontFamily: GoogleFonts.tajawal().fontFamily,
scaffoldBackgroundColor: bgLight,
colorScheme: lightScheme,
dividerColor: dividerLight,
dividerTheme: const DividerThemeData(
color: dividerLight,
thickness: 1,
space: 1,
),
appBarTheme: AppBarTheme(
backgroundColor: bgLight,
elevation: 0,
scrolledUnderElevation: 0,
centerTitle: true,
titleTextStyle: GoogleFonts.tajawal(
color: textPrimaryLight,
fontSize: 18,
fontWeight: FontWeight.bold,
),
iconTheme: const IconThemeData(color: textPrimaryLight),
),
cardTheme: CardThemeData(
color: surfaceLight,
elevation: 0,
margin: EdgeInsets.zero,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
side: const BorderSide(color: dividerLight, width: 1),
),
),
dialogTheme: DialogThemeData(
backgroundColor: surfaceLight,
elevation: 24,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
side: const BorderSide(color: dividerLight, width: 1),
),
titleTextStyle: GoogleFonts.tajawal(
color: textPrimaryLight,
fontSize: 18,
fontWeight: FontWeight.bold,
),
contentTextStyle: GoogleFonts.tajawal(
color: textSecondaryLight,
fontSize: 14,
),
),
bottomSheetTheme: const BottomSheetThemeData(
backgroundColor: surfaceLight,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
),
),
snackBarTheme: SnackBarThemeData(
backgroundColor: surfaceElevatedLight,
contentTextStyle: GoogleFonts.tajawal(
color: textPrimaryLight,
fontSize: 14,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
behavior: SnackBarBehavior.floating,
),
inputDecorationTheme: InputDecorationTheme(
filled: true,
fillColor: surfaceElevatedLight,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none,
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none,
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(color: accentLight, width: 1.5),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(color: dangerLight, width: 1),
),
labelStyle: const TextStyle(color: textSecondaryLight),
hintStyle: const TextStyle(color: textMutedLight),
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
backgroundColor: accentLight,
foregroundColor: Colors.white,
elevation: 0,
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 14),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
textStyle: GoogleFonts.tajawal(
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
),
outlinedButtonTheme: OutlinedButtonThemeData(
style: OutlinedButton.styleFrom(
foregroundColor: textPrimaryLight,
side: const BorderSide(color: dividerLight),
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 14),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
textStyle: GoogleFonts.tajawal(
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
),
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(
foregroundColor: accentLight,
textStyle: GoogleFonts.tajawal(
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
),
switchTheme: SwitchThemeData(
thumbColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.selected)) return successLight;
return textMutedLight;
}),
trackColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.selected)) return successSoftLight;
return surfaceElevatedLight;
}),
),
popupMenuTheme: PopupMenuThemeData(
color: surfaceLight,
elevation: 8,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
side: const BorderSide(color: dividerLight),
),
),
tooltipTheme: TooltipThemeData(
decoration: BoxDecoration(
color: surfaceElevatedLight,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: dividerLight),
),
textStyle: GoogleFonts.tajawal(
color: textPrimaryLight,
fontSize: 12,
),
),
floatingActionButtonTheme: const FloatingActionButtonThemeData(
backgroundColor: accentLight,
foregroundColor: Colors.white,
elevation: 4,
),
progressIndicatorTheme: const ProgressIndicatorThemeData(
color: accentLight,
linearTrackColor: surfaceElevatedLight,
),
tabBarTheme: TabBarThemeData(
labelColor: accentLight,
unselectedLabelColor: textSecondaryLight,
indicatorColor: accentLight,
dividerColor: dividerLight,
),
chipTheme: ChipThemeData(
backgroundColor: surfaceElevatedLight,
labelStyle: GoogleFonts.tajawal(color: textPrimaryLight, fontSize: 12),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: const BorderSide(color: dividerLight),
),
),
pageTransitionsTheme: PageTransitionsTheme(
builders: {
TargetPlatform.windows: const FadeUpwardsPageTransitionsBuilder(),
TargetPlatform.macOS: const FadeUpwardsPageTransitionsBuilder(),
TargetPlatform.linux: const FadeUpwardsPageTransitionsBuilder(),
TargetPlatform.fuchsia: const FadeUpwardsPageTransitionsBuilder(),
TargetPlatform.android: const FadeUpwardsPageTransitionsBuilder(),
TargetPlatform.iOS: const FadeUpwardsPageTransitionsBuilder(),
},
),
);
}
}
// ─── Context Extensions for Theme Access ──────────────────────────────────────
extension ThemeExtensions on BuildContext {
ColorScheme get colors => Theme.of(this).colorScheme;
TextTheme get textStyles => Theme.of(this).textTheme;
Brightness get brightness => Theme.of(this).brightness;
bool get isDark => brightness == Brightness.dark;
}
// ─── Semantic Color Getters (light/dark adaptive) ─────────────────────────────
// These replace direct AppColor.* usage in views. They automatically adapt
// based on the current theme brightness.
class AppColors {
AppColors._();
static Color bg(BuildContext context) => context.isDark
? const Color(0xFF0A0A0B)
: const Color(0xFFF8F9FC);
static Color surface(BuildContext context) => context.isDark
? const Color(0xFF161618)
: const Color(0xFFFFFFFF);
static Color surfaceElevated(BuildContext context) => context.isDark
? const Color(0xFF222225)
: const Color(0xFFF1F3F9);
static Color surfaceGlass(BuildContext context) => context.isDark
? const Color(0xCC161618)
: const Color(0xCCFFFFFF);
static Color accent(BuildContext context) => context.isDark
? const Color(0xFF6366F1)
: const Color(0xFF6366F1);
static Color accentSoft(BuildContext context) => context.isDark
? const Color(0x266366F1)
: const Color(0x1A6366F1);
static Color accentBorder(BuildContext context) => context.isDark
? const Color(0x4D6366F1)
: const Color(0x336366F1);
static Color glow(BuildContext context) => context.isDark
? const Color(0xFF818CF8)
: const Color(0xFF4F46E5);
static Color danger(BuildContext context) => context.isDark
? const Color(0xFFEF4444)
: const Color(0xFFDC2626);
static Color dangerSoft(BuildContext context) => context.isDark
? const Color(0x26EF4444)
: const Color(0x1ADC2626);
static Color success(BuildContext context) => context.isDark
? const Color(0xFF10B981)
: const Color(0xFF059669);
static Color successSoft(BuildContext context) => context.isDark
? const Color(0x2610B981)
: const Color(0x1A059669);
static Color warning(BuildContext context) => context.isDark
? const Color(0xFFF59E0B)
: const Color(0xFFD97706);
static Color warningSoft(BuildContext context) => context.isDark
? const Color(0x26F59E0B)
: const Color(0x1AD97706);
static Color info(BuildContext context) => context.isDark
? const Color(0xFF3B82F6)
: const Color(0xFF2563EB);
static Color infoSoft(BuildContext context) => context.isDark
? const Color(0x263B82F6)
: const Color(0x1A2563EB);
static Color textPrimary(BuildContext context) => context.isDark
? const Color(0xFFF3F4F6)
: const Color(0xFF111827);
static Color textSecondary(BuildContext context) => context.isDark
? const Color(0xFF9CA3AF)
: const Color(0xFF6B7280);
static Color textMuted(BuildContext context) => context.isDark
? const Color(0xFF6B7280)
: const Color(0xFF9CA3AF);
static Color divider(BuildContext context) => context.isDark
? const Color(0xFF2D2D30)
: const Color(0xFFE2E5ED);
static Color cardShadow(BuildContext context) => context.isDark
? const Color(0x66000000)
: const Color(0x0D000000);
// Gradient helpers for charts
static LinearGradient accentGradient(BuildContext context) => LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
accent(context).withValues(alpha: 0.4),
accent(context).withValues(alpha: 0.0),
],
);
static LinearGradient successGradient(BuildContext context) => LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
success(context).withValues(alpha: 0.4),
success(context).withValues(alpha: 0.0),
],
);
static LinearGradient dangerGradient(BuildContext context) => LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
danger(context).withValues(alpha: 0.4),
danger(context).withValues(alpha: 0.0),
],
);
static LinearGradient infoGradient(BuildContext context) => LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
info(context).withValues(alpha: 0.4),
info(context).withValues(alpha: 0.0),
],
);
}