This commit is contained in:
Hamza-Ayed
2024-06-25 15:08:56 +03:00
parent 9c73af74bb
commit 0407d37e9d
16 changed files with 513 additions and 493 deletions

View File

@@ -30,6 +30,8 @@ class BoxName {
static const String passengerID = "pasengerID"; static const String passengerID = "pasengerID";
static const String phone = "phone"; static const String phone = "phone";
static const String phoneDriver = "phoneDriver"; static const String phoneDriver = "phoneDriver";
static const String bankCodeDriver = "bankCodeDriver";
static const String accountBankNumberDriver = "accountBankNumberDriver";
static const String dobDriver = "dobDriver"; static const String dobDriver = "dobDriver";
static const String sexDriver = "sexDriver"; static const String sexDriver = "sexDriver";
static const String lastNameDriver = "lastNameDriver"; static const String lastNameDriver = "lastNameDriver";

View File

@@ -3,6 +3,10 @@ import 'package:flutter/material.dart';
class AppColor { class AppColor {
static const Color primaryColor = Color(0xFF1DA1F2); static const Color primaryColor = Color(0xFF1DA1F2);
static const Color writeColor = Color(0xff222359); static const Color writeColor = Color(0xff222359);
static const Color bronze = Color(0xFFCD7F32);
static const Color goldenBronze = Color(0xFFB87333); // Golden bronze color
static const Color gold = Color(0xFFD4AF37);
static const Color secondaryColor = Colors.white; static const Color secondaryColor = Colors.white;
static const Color accentColor = Colors.grey; static const Color accentColor = Colors.grey;
static const Color greyColor = Colors.grey; static const Color greyColor = Colors.grey;

View File

@@ -132,6 +132,10 @@ class LoginCaptinController extends GetxController {
box.write(BoxName.phoneVerified, box.write(BoxName.phoneVerified,
jsonDecoeded['data'][0]['is_verified'].toString()); jsonDecoeded['data'][0]['is_verified'].toString());
box.write(BoxName.phoneDriver, jsonDecoeded['data'][0]['phone']); box.write(BoxName.phoneDriver, jsonDecoeded['data'][0]['phone']);
box.write(
BoxName.bankCodeDriver, jsonDecoeded['data'][0]['bankCode']);
box.write(BoxName.accountBankNumberDriver,
jsonDecoeded['data'][0]['accountBank']);
box.write( box.write(
BoxName.nameDriver, BoxName.nameDriver,
'${jsonDecoeded['data'][0]['first_name']}' '${jsonDecoeded['data'][0]['first_name']}'

View File

@@ -1,8 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'dart:math' as math;
import 'dart:math' show cos;
import 'package:SEFER/constant/table_names.dart';
import 'package:SEFER/controller/home/captin/home_captain_controller.dart'; import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
@@ -523,10 +520,8 @@ class MapDriverController extends GetxController {
} }
double pointsSubtraction = 0; double pointsSubtraction = 0;
pointsSubtraction = double.parse(paymentAmount) * pointsSubtraction =
(-1) * double.parse(paymentAmount) * (-1) * double.parse(kazan);
double.parse(kazan) /
100; // for Egypt /100
var paymentToken2 = var paymentToken2 =
await generateTokenDriver((pointsSubtraction).toStringAsFixed(0)); await generateTokenDriver((pointsSubtraction).toStringAsFixed(0));
var res = await CRUD().post(link: AppLink.addDriversWalletPoints, payload: { var res = await CRUD().post(link: AppLink.addDriversWalletPoints, payload: {

View File

@@ -14,6 +14,7 @@ import 'package:SEFER/main.dart';
class CaptainWalletController extends GetxController { class CaptainWalletController extends GetxController {
bool isLoading = false; bool isLoading = false;
final formKeyTransfer = GlobalKey<FormState>(); final formKeyTransfer = GlobalKey<FormState>();
final formKeyAccount = GlobalKey<FormState>();
Map walletDate = {}; Map walletDate = {};
Map walletDateVisa = {}; Map walletDateVisa = {};
Map walletDriverPointsDate = {}; Map walletDriverPointsDate = {};
@@ -24,6 +25,8 @@ class CaptainWalletController extends GetxController {
final amountFromBudgetController = TextEditingController(); final amountFromBudgetController = TextEditingController();
final newDriverPhoneController = TextEditingController(); final newDriverPhoneController = TextEditingController();
final phoneWallet = TextEditingController(); final phoneWallet = TextEditingController();
final cardBank = TextEditingController();
final bankCode = TextEditingController();
payFromBudget() async { payFromBudget() async {
if (formKey.currentState!.validate()) { if (formKey.currentState!.validate()) {
@@ -198,7 +201,10 @@ class CaptainWalletController extends GetxController {
await CRUD().post(link: AppLink.addDriversWalletPoints, payload: { await CRUD().post(link: AppLink.addDriversWalletPoints, payload: {
'driverID': amountToNewDriverMap[0]['id'].toString(), 'driverID': amountToNewDriverMap[0]['id'].toString(),
'paymentID': paymentID.toString(), 'paymentID': paymentID.toString(),
'amount': (int.parse(amountFromBudgetController.text) - 5).toString(), 'amount': ((int.parse(amountFromBudgetController.text) - 5) / .08)
.toStringAsFixed(
0), // this will convert buddget to poitns by kazan .08
'token': paymentToken, 'token': paymentToken,
'paymentMethod': paymentMethod2.toString(), 'paymentMethod': paymentMethod2.toString(),
}); });

View File

@@ -4,7 +4,18 @@ class MyTranslation extends Translations {
@override @override
Map<String, Map<String, String>> get keys => { Map<String, Map<String, String>> get keys => {
"ar": { "ar": {
"You don't have enough money in your SEFER wallet": "Please enter a valid card 16-digit number.":
"الرجاء إدخال رقم بطاقة صحيح مكون من 16 رقمًا.",
"Insert card number": "أدخل رقم البطاقة",
"Bank account added successfully": "تمت إضافة الحساب البنكي بنجاح",
"Updated successfully": "تم التحديث بنجاح",
"Create Wallet to receive your money": "أنشئ محفظة لاستقبال أموالك",
"Insert Account Bank": "أدخل رقم حسابك البنكي",
"Insert Card Bank Details to Receive Your Visa Money Weekly":
"أدخل تفاصيل بطاقتك البنكية لاستقبال راتبك عبر فيزا كل أسبوع",
"Select Name of Your Bank": "اختر اسم بنكك",
"Create Wallet to receive your money"
"You don't have enough money in your SEFER wallet":
"لا يوجد رصيد كافٍ في محفظة SEFER الخاصة بك ", "لا يوجد رصيد كافٍ في محفظة SEFER الخاصة بك ",
"You have transferred to your wallet from": "لقد حولت إلى محفظتك من", "You have transferred to your wallet from": "لقد حولت إلى محفظتك من",
'Transfer': "تحويل", 'Transfer': "تحويل",
@@ -87,8 +98,8 @@ class MyTranslation extends Translations {
'This amount for all trip I get from Passengers and Collected For me in': 'This amount for all trip I get from Passengers and Collected For me in':
'هذا المبلغ لجميع الرحلات التي أحصل عليها من الركاب والمجموعة لي في', 'هذا المبلغ لجميع الرحلات التي أحصل عليها من الركاب والمجموعة لي في',
'Total Budget from trips is ': 'إجمالي الميزانية من الرحلات هو ', 'Total Budget from trips is ': 'إجمالي الميزانية من الرحلات هو ',
'You can buy Points to let you online\nby this list below': "You can purchase a budget to enable online access through the options listed below.":
'يمكنك سداد المديونية من هذه القائمة', 'يمكنك ‏إضافة رصيد من هذه القائمة',
'You can buy points from your budget': 'You can buy points from your budget':
'يمكنك سداد المديونية من حسابك', 'يمكنك سداد المديونية من حسابك',
"expiration_date": "تاريخ الانتهاء", "expiration_date": "تاريخ الانتهاء",
@@ -648,11 +659,12 @@ class MyTranslation extends Translations {
"Please help! Contact me as soon as possible.": "Please help! Contact me as soon as possible.":
"من فضلك ساعدني! تواصل معي في أقرب وقت ممكن.", "من فضلك ساعدني! تواصل معي في أقرب وقت ممكن.",
"Share Trip Details": "شارك تفاصيل الرحلة", "Share Trip Details": "شارك تفاصيل الرحلة",
"Car Plate is": "لوحة السيارة", "Car Plate is": "لوحة السيارة", 'L.E': 'جنيه',
"the 300 points equal 300 L.E for you": "the 3000 points equal 3000 L.E for you":
"الـ 300 نقطة تعادل 300 جنيه مصري بالنسبة لك", "الـ 3000 نقطة تعادل 3000 جنيه مصري بالنسبة لك",
"So go and gain your money": "انطلق واكسب مالك", "So go and gain your money": "انطلق واكسب مالك",
"the 300 points equal 300 L.E": "الـ 300 نقطة تساوي 300 جنيه مصري", "the 3000 points equal 3000 L.E":
"الـ 3000 نقطة تساوي 3000 جنيه مصري",
"The payment was not approved. Please try again.": "The payment was not approved. Please try again.":
"لم يتم الموافقة على الدفع. يرجى المحاولة مرة أخرى.", "لم يتم الموافقة على الدفع. يرجى المحاولة مرة أخرى.",
"Payment Failed": "تعذرت عملية الدفع", "Payment Failed": "تعذرت عملية الدفع",
@@ -676,8 +688,8 @@ class MyTranslation extends Translations {
' is ON for this month': ' لهذا الشهر ', ' is ON for this month': ' لهذا الشهر ',
"Origin": "الأصل", "Origin": "الأصل",
"Destination": "مكان الوصول", "Destination": "مكان الوصول",
'the 300 points equal 300 L.E for you \nSo go and gain your money': 'the 3000 points equal 3000 L.E for you \nSo go and gain your money':
"ال300 نقطة تعادل 300 ج.م لك، فاذهب واكسب مالك.", "ال3000 نقطة تعادل 3000 ج.م لك، فاذهب واكسب مالك.",
"Driver Name": "اسم السائق", "Driver Name": "اسم السائق",
"Driver Car Plate": "لوحة سيارة السائق", "Driver Car Plate": "لوحة سيارة السائق",
"Available for rides": "‏الرحلات المتوفرة", "Available for rides": "‏الرحلات المتوفرة",
@@ -1423,18 +1435,18 @@ class MyTranslation extends Translations {
"Konumum doğru. Navigasyon uygulamasını kullanarak beni arayabilirsiniz", "Konumum doğru. Navigasyon uygulamasını kullanarak beni arayabilirsiniz",
"Share Trip Details": "Seni bekliyorum", "Share Trip Details": "Seni bekliyorum",
"Car Plate is": "Merhaba, kararlaştırılan yerdeyim", "Car Plate is": "Merhaba, kararlaştırılan yerdeyim",
"the 300 points equal 300 L.E for you": "the 3000 points equal 3000 L.E for you":
"Hızın 100 km/s'yi aştığını fark ettik. Lütfen güvenliğiniz için yavaşlayın. Kendinizi güvende hissetmiyorsanız yolculuk bilgilerinizi bir kişiyle paylaşabilir veya kırmızı sos düğmesini kullanarak polisi arayabilirsiniz.", "Hızın 100 km/s'yi aştığını fark ettik. Lütfen güvenliğiniz için yavaşlayın. Kendinizi güvende hissetmiyorsanız yolculuk bilgilerinizi bir kişiyle paylaşabilir veya kırmızı sos düğmesini kullanarak polisi arayabilirsiniz.",
"So go and gain your money": "Uyarı: Hız algılandı!", "So go and gain your money": "Uyarı: Hız algılandı!",
"the 300 points equal 300 L.E": "the 3000 points equal 3000 L.E":
"Lütfen yardım edin! En kısa sürede benimle iletişime geçin.", "Lütfen yardım edin! En kısa sürede benimle iletişime geçin.",
"The payment was not approved. Please try again.": "The payment was not approved. Please try again.":
"Yolculuk bilgilerini paylaşın", "Yolculuk bilgilerini paylaşın",
"Payment Failed": "Araç Plakası:", "Payment Failed": "Araç Plakası:",
"Error": "300 puan sizin için 300 L.E.' ye eşittir", "Error": "3000 puan sizin için 3000 L.E.' ye eşittir",
"An error occurred during the payment process.": "An error occurred during the payment process.":
"Öyleyse git ve paranı kazan", "Öyleyse git ve paranı kazan",
"The payment was approved.": "300 puan 300 L.E.' ye eşittir.", "The payment was approved.": "3000 puan 3000 L.E.' ye eşittir.",
"Payment Successful": "Ödeme onaylanmadı. Please try again later.", "Payment Successful": "Ödeme onaylanmadı. Please try again later.",
"No ride found yet": "Ödeme Başarısız", "No ride found yet": "Ödeme Başarısız",
"Accept Order": "Error", "Accept Order": "Error",
@@ -2220,10 +2232,10 @@ class MyTranslation extends Translations {
"Aide-moi s'il te plaît. Contactez-moi dès que possible.", "Aide-moi s'il te plaît. Contactez-moi dès que possible.",
"Share Trip Details": "Partagez les détails de la", "Share Trip Details": "Partagez les détails de la",
"Car Plate is": "Le numéro d'immatriculation ?", "Car Plate is": "Le numéro d'immatriculation ?",
"the 300 points equal 300 L.E for you": "the 3000 points equal 3000 L.E for you":
"300 points équivaut à 300 EGP pour vous", "3000 points équivaut à 3000 EGP pour vous",
"So go and gain your money": "Gagnez de l'argent", "So go and gain your money": "Gagnez de l'argent",
"the 300 points equal 300 L.E": "300 points équivaut à 300 EGP", "the 3000 points equal 3000 L.E": "3000 points équivaut à 3000 EGP",
"The payment was not approved. Please try again.": "The payment was not approved. Please try again.":
"Paiement non approuvé. Réessayer", "Paiement non approuvé. Réessayer",
"Payment Failed": "Échec du paiement", "Payment Failed": "Échec du paiement",
@@ -3020,10 +3032,10 @@ class MyTranslation extends Translations {
"Aide-moi s'il te plaît. Contactez-moi dès que possible.", "Aide-moi s'il te plaît. Contactez-moi dès que possible.",
"Share Trip Details": "Partagez les détails de la", "Share Trip Details": "Partagez les détails de la",
"Car Plate is": "Le numéro d'immatriculation ?", "Car Plate is": "Le numéro d'immatriculation ?",
"the 300 points equal 300 L.E for you": "the 3000 points equal 3000 L.E for you":
"300 points équivaut à 300 EGP pour vous", "3000 points équivaut à 3000 EGP pour vous",
"So go and gain your money": "Gagnez de l'argent", "So go and gain your money": "Gagnez de l'argent",
"the 300 points equal 300 L.E": "300 points équivaut à 300 EGP", "the 3000 points equal 3000 L.E": "3000 points équivaut à 3000 EGP",
"The payment was not approved. Please try again.": "The payment was not approved. Please try again.":
"Paiement non approuvé. Réessayer", "Paiement non approuvé. Réessayer",
"Payment Failed": "Échec du paiement", "Payment Failed": "Échec du paiement",
@@ -3817,10 +3829,10 @@ class MyTranslation extends Translations {
"Aide-moi s'il te plaît. Contactez-moi dès que possible.", "Aide-moi s'il te plaît. Contactez-moi dès que possible.",
"Share Trip Details": "Partagez les détails de la", "Share Trip Details": "Partagez les détails de la",
"Car Plate is": "Le numéro d'immatriculation ?", "Car Plate is": "Le numéro d'immatriculation ?",
"the 300 points equal 300 L.E for you": "the 3000 points equal 3000 L.E for you":
"300 points équivaut à 300 EGP pour vous", "3000 points équivaut à 3000 EGP pour vous",
"So go and gain your money": "Gagnez de l'argent", "So go and gain your money": "Gagnez de l'argent",
"the 300 points equal 300 L.E": "300 points équivaut à 300 EGP", "the 3000 points equal 3000 L.E": "3000 points équivaut à 3000 EGP",
"The payment was not approved. Please try again.": "The payment was not approved. Please try again.":
"Paiement non approuvé. Réessayer", "Paiement non approuvé. Réessayer",
"Payment Failed": "Échec du paiement", "Payment Failed": "Échec du paiement",
@@ -4615,10 +4627,10 @@ class MyTranslation extends Translations {
"Aide-moi s'il te plaît. Contactez-moi dès que possible.", "Aide-moi s'il te plaît. Contactez-moi dès que possible.",
"Share Trip Details": "Partagez les détails de la", "Share Trip Details": "Partagez les détails de la",
"Car Plate is": "Le numéro d'immatriculation ?", "Car Plate is": "Le numéro d'immatriculation ?",
"the 300 points equal 300 L.E for you": "the 3000 points equal 3000 L.E for you":
"300 points équivaut à 300 EGP pour vous", "3000 points équivaut à 3000 EGP pour vous",
"So go and gain your money": "Gagnez de l'argent", "So go and gain your money": "Gagnez de l'argent",
"the 300 points equal 300 L.E": "300 points équivaut à 300 EGP", "the 3000 points equal 3000 L.E": "3000 points équivaut à 3000 EGP",
"The payment was not approved. Please try again.": "The payment was not approved. Please try again.":
"Paiement non approuvé. Réessayer", "Paiement non approuvé. Réessayer",
"Payment Failed": "Échec du paiement", "Payment Failed": "Échec du paiement",
@@ -5418,10 +5430,10 @@ class MyTranslation extends Translations {
"Aide-moi s'il te plaît. Contactez-moi dès que possible.", "Aide-moi s'il te plaît. Contactez-moi dès que possible.",
"Share Trip Details": "Partagez les détails de la", "Share Trip Details": "Partagez les détails de la",
"Car Plate is": "Le numéro d'immatriculation ?", "Car Plate is": "Le numéro d'immatriculation ?",
"the 300 points equal 300 L.E for you": "the 3000 points equal 3000 L.E for you":
"300 points équivaut à 300 EGP pour vous", "3000 points équivaut à 3000 EGP pour vous",
"So go and gain your money": "Gagnez de l'argent", "So go and gain your money": "Gagnez de l'argent",
"the 300 points equal 300 L.E": "300 points équivaut à 300 EGP", "the 3000 points equal 3000 L.E": "3000 points équivaut à 3000 EGP",
"The payment was not approved. Please try again.": "The payment was not approved. Please try again.":
"Paiement non approuvé. Réessayer", "Paiement non approuvé. Réessayer",
"Payment Failed": "Échec du paiement", "Payment Failed": "Échec du paiement",
@@ -6204,10 +6216,10 @@ class MyTranslation extends Translations {
"कृपया मेरी मदद करें! जितनी जल्दी हो सके मुझसे संपर्क करें।", "कृपया मेरी मदद करें! जितनी जल्दी हो सके मुझसे संपर्क करें।",
"Share Trip Details": "ट्रिप का ब्यौरा दें", "Share Trip Details": "ट्रिप का ब्यौरा दें",
"Car Plate is": "कार के चारों ओर ले आओ।", "Car Plate is": "कार के चारों ओर ले आओ।",
"the 300 points equal 300 L.E for you": "the 3000 points equal 3000 L.E for you":
"300 अंक आपके लिए 300 EGP के बराबर है", "3000 अंक आपके लिए 3000 EGP के बराबर है",
"So go and gain your money": "अपने पैसे कमाने के लिए आगे बढ़ें", "So go and gain your money": "अपने पैसे कमाने के लिए आगे बढ़ें",
"the 300 points equal 300 L.E": "300 points बराबर है: 300 EGP", "the 3000 points equal 3000 L.E": "3000 points बराबर है: 3000 EGP",
"The payment was not approved. Please try again.": "The payment was not approved. Please try again.":
"भुगतान मंज़ूर नहीं किया गया। फिर से कोशिश करें", "भुगतान मंज़ूर नहीं किया गया। फिर से कोशिश करें",
"Payment Failed": "भुगतान नहीं हो सका", "Payment Failed": "भुगतान नहीं हो सका",
@@ -6983,10 +6995,11 @@ class MyTranslation extends Translations {
"لطفأ ، کمکم کن. در اسرع وقت با من تماس بگیرید.", "لطفأ ، کمکم کن. در اسرع وقت با من تماس بگیرید.",
"Share Trip Details": "جزئیات سفر را به اشتراک بگذارید", "Share Trip Details": "جزئیات سفر را به اشتراک بگذارید",
"Car Plate is": "پلاک اتومبیل", "Car Plate is": "پلاک اتومبیل",
"the 300 points equal 300 L.E for you": "the 3000 points equal 3000 L.E for you":
"300 امتیاز برای شما معادل 300 پوند مصر است", "3000 امتیاز برای شما معادل 3000 پوند مصر است",
"So go and gain your money": "برو جلو و پولت را در بیاور", "So go and gain your money": "برو جلو و پولت را در بیاور",
"the 300 points equal 300 L.E": "300 امتیاز معادل 300 پوند مصر است", "the 3000 points equal 3000 L.E":
"3000 امتیاز معادل 3000 پوند مصر است",
"The payment was not approved. Please try again.": "The payment was not approved. Please try again.":
"پرداخت تایید نشد سعی مجدد", "پرداخت تایید نشد سعی مجدد",
"Payment Failed": "پرداخت ناموفق", "Payment Failed": "پرداخت ناموفق",
@@ -7706,9 +7719,9 @@ class MyTranslation extends Translations {
"Please help! Contact me as soon as possible.": "請幫幫我!請盡快與我聯絡。", "Please help! Contact me as soon as possible.": "請幫幫我!請盡快與我聯絡。",
"Share Trip Details": "提供行程詳細資訊", "Share Trip Details": "提供行程詳細資訊",
"Car Plate is": "車牌號碼", "Car Plate is": "車牌號碼",
"the 300 points equal 300 L.E for you": "300分等於300 EGP", "the 3000 points equal 3000 L.E for you": "3000分等於3000 EGP",
"So go and gain your money": "開始賺取收入", "So go and gain your money": "開始賺取收入",
"the 300 points equal 300 L.E": "300分等於300 EGP", "the 3000 points equal 3000 L.E": "3000分等於3000 EGP",
"The payment was not approved. Please try again.": "付款未批準。請再試一次。", "The payment was not approved. Please try again.": "付款未批準。請再試一次。",
"Payment Failed": "付款失敗", "Payment Failed": "付款失敗",
"Error": "錯誤", "Error": "錯誤",

View File

@@ -1,45 +0,0 @@
import 'dart:convert';
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart';
import 'package:get/get.dart';
import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/constant/links.dart';
import 'package:SEFER/controller/functions/crud.dart';
import 'package:SEFER/main.dart';
class PassengerWalletHistoryController extends GetxController {
bool isLoading = false;
List archive = [];
getArchivePayment() async {
isLoading = true;
update();
var res = await CRUD().get(
link: AppLink.getPassengerWalletArchive,
payload: {'passenger_id': box.read(BoxName.passengerID)});
if (res != 'failure') {
archive = jsonDecode(res)['message'];
isLoading = false;
update();
} else {
Get.defaultDialog(
barrierDismissible: false,
title: 'No wallet record found'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'OK'.tr,
onPressed: () {
Get.back();
Get.back();
}));
}
}
@override
void onInit() {
getArchivePayment();
super.onInit();
}
}

View File

@@ -50,7 +50,7 @@ class SplashScreen extends StatelessWidget {
TypewriterAnimatedText( TypewriterAnimatedText(
'Welcome to ${AppInformation.appName}', 'Welcome to ${AppInformation.appName}',
textStyle: textStyle:
AppStyle.headTitle2.copyWith(color: AppColor.greenColor), AppStyle.headTitle2.copyWith(color: AppColor.writeColor),
speed: const Duration(milliseconds: 200), speed: const Duration(milliseconds: 200),
), ),
], isRepeatingAnimation: true), ], isRepeatingAnimation: true),

View File

@@ -40,7 +40,7 @@ class DrawerCaptain extends StatelessWidget {
_buildDrawerItem( _buildDrawerItem(
icon: Icons.person, icon: Icons.person,
text: 'Profile'.tr, text: 'Profile'.tr,
onTap: () => Get.to(() => const ProfileCaptain(), onTap: () => Get.to(() => ProfileCaptain(),
transition: Transition.rightToLeftWithFade), transition: Transition.rightToLeftWithFade),
), ),
_buildDivider(), _buildDivider(),

View File

@@ -0,0 +1,51 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class BankController extends GetxController {
String selectedBank = '';
Map<String, String> bankNames = {
'CIB Bank'.tr: 'CIB',
'National Bank of Egypt'.tr: 'NBE',
'QNB Al Ahli'.tr: 'QNB',
'Bank Misr'.tr: 'BM',
// Add other bank full names and short names here
};
@override
void onInit() {
super.onInit();
selectedBank = bankNames.values.first;
}
void updateSelectedBank(String? bankShortName) {
selectedBank = bankShortName ?? '';
update();
}
List<DropdownMenuItem<String>> getDropdownItems() {
return bankNames.keys.map<DropdownMenuItem<String>>((bankFullName) {
return DropdownMenuItem<String>(
value: bankNames[bankFullName],
child: Text(bankFullName),
);
}).toList();
}
}
class BankDropdown extends StatelessWidget {
final BankController bankController = Get.put(BankController());
@override
Widget build(BuildContext context) {
return GetBuilder<BankController>(
init: bankController,
builder: (controller) {
return DropdownButton<String>(
value: controller.selectedBank,
onChanged: controller.updateSelectedBank,
items: controller.getDropdownItems(),
);
},
);
}
}

View File

@@ -152,17 +152,20 @@ class CardSeferWalletDriver extends StatelessWidget {
color: AppColor.deepPurpleAccent, color: AppColor.deepPurpleAccent,
borderRadius: const BorderRadius.all(Radius.circular(12)), borderRadius: const BorderRadius.all(Radius.circular(12)),
gradient: const LinearGradient( gradient: const LinearGradient(
colors: [AppColor.blueColor, AppColor.primaryColor]), colors: [AppColor.greyColor, AppColor.writeColor]),
), ),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
Row( Row(
children: [ children: [
Text( Padding(
'${AppInformation.appName} Wallet', padding: const EdgeInsets.symmetric(horizontal: 10),
style: AppStyle.headTitle child: Text(
.copyWith(color: AppColor.primaryColor), '${AppInformation.appName} Wallet',
style: AppStyle.headTitle
.copyWith(color: AppColor.writeColor),
),
) )
], ],
), ),

View File

@@ -1,61 +0,0 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:SEFER/constant/colors.dart';
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/controller/payment/passenger_wallet_history_controller.dart';
import 'package:SEFER/views/widgets/my_scafold.dart';
import 'package:SEFER/views/widgets/mycircular.dart';
class PaymentHistoryPassengerPage extends StatelessWidget {
const PaymentHistoryPassengerPage({super.key});
@override
Widget build(BuildContext context) {
Get.put(PassengerWalletHistoryController());
return MyScafolld(
title: 'Payment History'.tr,
body: [
GetBuilder<PassengerWalletHistoryController>(
builder: (controller) => controller.isLoading
? const MyCircularProgressIndicator()
: controller.archive.isEmpty
? Center(
child: Text(
'No wallet record found'.tr,
style: AppStyle.title,
),
)
: ListView.builder(
itemCount: controller.archive.length,
itemBuilder: (BuildContext context, int index) {
var list = controller.archive[index];
return Padding(
padding: const EdgeInsets.all(4),
child: Container(
decoration: BoxDecoration(
color: double.parse(list['balance']) < 0
? AppColor.redColor.withOpacity(.4)
: AppColor.greenColor.withOpacity(.4)),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
list['balance'],
style: AppStyle.title,
),
Text(
list['created_at'],
style: AppStyle.title,
),
],
),
),
);
},
),
)
],
isleading: true);
}
}

View File

@@ -97,30 +97,43 @@ class PointsCaptain extends StatelessWidget {
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 3, vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 3, vertical: 8),
child: Container( child: Container(
width: Get.width * .22, width: Get.width * .22,
height: Get.width * .22, height: Get.width * .22,
margin: const EdgeInsets.all(4), margin: const EdgeInsets.all(4),
decoration: BoxDecoration( decoration: BoxDecoration(
color: kolor, gradient: LinearGradient(
border: Border.all(color: AppColor.accentColor), colors: [
borderRadius: BorderRadius.circular(12), kolor.withOpacity(0.3),
shape: BoxShape.rectangle, kolor,
kolor.withOpacity(0.7),
kolor,
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
), ),
child: Center( border: Border.all(color: AppColor.accentColor),
child: Column( borderRadius: BorderRadius.circular(12),
children: [ shape: BoxShape.rectangle,
Text( ),
'$countPoint ${'Point'.tr}', child: Center(
style: AppStyle.subtitle, child: Column(
), mainAxisAlignment: MainAxisAlignment.spaceAround,
Text( children: [
'$pricePoint ${box.read(BoxName.countryCode) == 'Jordan' ? 'JOD'.tr : 'LE'.tr}', Text(
style: AppStyle.title, '$countPoint ${box.read(BoxName.countryCode) == 'Jordan' ? 'JOD'.tr : 'L.E'.tr}',
textAlign: TextAlign.center, style: AppStyle.subtitle
), .copyWith(color: AppColor.secondaryColor),
], ),
), Text(
)), '$pricePoint ${box.read(BoxName.countryCode) == 'Jordan' ? 'JOD'.tr : 'L.E'.tr}',
style:
AppStyle.title.copyWith(color: AppColor.secondaryColor),
textAlign: TextAlign.center,
),
],
),
),
),
), ),
); );
} }

View File

@@ -1,5 +1,8 @@
import 'package:SEFER/constant/links.dart';
import 'package:SEFER/controller/functions/crud.dart';
import 'package:SEFER/controller/functions/tts.dart'; import 'package:SEFER/controller/functions/tts.dart';
import 'package:SEFER/controller/home/payment/paymob_payout.dart'; import 'package:SEFER/controller/home/payment/paymob_payout.dart';
import 'package:SEFER/views/home/my_wallet/bank_account_egypt.dart';
import 'package:SEFER/views/home/my_wallet/payment_history_driver_page.dart'; import 'package:SEFER/views/home/my_wallet/payment_history_driver_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@@ -48,19 +51,19 @@ class WalletCaptain extends StatelessWidget {
0 && 0 &&
double.parse( double.parse(
captainWalletController.totalPoints) > captainWalletController.totalPoints) >
-300 -3000
? AppColor.yellowColor ? AppColor.yellowColor
: double.parse( : double.parse(
captainWalletController.totalPoints) < captainWalletController.totalPoints) <
-300 -3000
? AppColor.redColor ? AppColor.redColor
: AppColor.greenColor, : AppColor.greenColor,
// ), // ),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Get.snackbar( Get.snackbar(
'the 300 points equal 300 L.E'.tr, 'the 3000 points equal 3000 L.E'.tr,
'the 300 points equal 300 L.E for you \nSo go and gain your money' 'the 3000 points equal 3000 L.E for you \nSo go and gain your money'
.tr, .tr,
backgroundColor: AppColor.greenColor, backgroundColor: AppColor.greenColor,
snackPosition: SnackPosition.BOTTOM, snackPosition: SnackPosition.BOTTOM,
@@ -83,7 +86,7 @@ class WalletCaptain extends StatelessWidget {
), ),
double.parse(captainWalletController.totalPoints double.parse(captainWalletController.totalPoints
.toString()) < .toString()) <
-300 -3000
? MyElevatedButton( ? MyElevatedButton(
title: 'Charge your Account'.tr, title: 'Charge your Account'.tr,
onPressed: () {}) onPressed: () {})
@@ -110,7 +113,7 @@ class WalletCaptain extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
width: 2, width: 2,
color: AppColor.redColor)), color: AppColor.writeColor)),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
Get.snackbar( Get.snackbar(
@@ -159,7 +162,7 @@ class WalletCaptain extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
width: 2, width: 2,
color: AppColor.greenColor)), color: AppColor.writeColor)),
child: Padding( child: Padding(
padding: const EdgeInsets.all(2), padding: const EdgeInsets.all(2),
child: InkWell( child: InkWell(
@@ -276,47 +279,47 @@ class WalletCaptain extends StatelessWidget {
height: 10, height: 10,
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
decoration: AppStyle.boxDecoration, decoration: AppStyle.boxDecoration,
child: Column( child: Column(children: [
children: [ Text(
Text( "You can purchase a budget to enable online access through the options listed below."
'You can buy Points to let you online\nby this list below' .tr,
.tr, textAlign: TextAlign.center,
textAlign: TextAlign.center, style: AppStyle.title,
style: AppStyle.title, ),
), const Divider(
const Divider( indent: 30,
indent: 30, endIndent: 30,
endIndent: 30, color: AppColor.accentColor,
color: AppColor.accentColor, thickness: 3,
thickness: 3, ),
), const SizedBox(
const SizedBox( height: 10,
height: 10, ),
), Container(
Container(
decoration: AppStyle.boxDecoration, decoration: AppStyle.boxDecoration,
height: Get.height * .19, height: Get.height * .19,
child: ListView( child: ListView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: [ children: [
PointsCaptain( PointsCaptain(
kolor: AppColor.blueColor, kolor: AppColor.greyColor,
pricePoint: pricePoint:
box.read(BoxName.countryCode) == box.read(BoxName.countryCode) ==
'Jordan' 'Jordan'
? 5 ? 5
: 100, : 80,
countPoint: countPoint:
box.read(BoxName.countryCode) == box.read(BoxName.countryCode) ==
'Jordan' 'Jordan'
? '300' ? '3000'
: '100', : '1000',
), ),
PointsCaptain( PointsCaptain(
kolor: Colors.green, kolor: AppColor
.bronze, // Bronze color for medium value
pricePoint: pricePoint:
box.read(BoxName.countryCode) == box.read(BoxName.countryCode) ==
'Jordan' 'Jordan'
@@ -326,10 +329,11 @@ class WalletCaptain extends StatelessWidget {
box.read(BoxName.countryCode) == box.read(BoxName.countryCode) ==
'Jordan' 'Jordan'
? '1040' ? '1040'
: '210', : '2500',
), ),
PointsCaptain( PointsCaptain(
kolor: Colors.amberAccent, kolor: AppColor
.goldenBronze, // Golden bronze color for higher value
pricePoint: pricePoint:
box.read(BoxName.countryCode) == box.read(BoxName.countryCode) ==
'Jordan' 'Jordan'
@@ -338,11 +342,12 @@ class WalletCaptain extends StatelessWidget {
countPoint: countPoint:
box.read(BoxName.countryCode) == box.read(BoxName.countryCode) ==
'Jordan' 'Jordan'
? '2300' ? '23000'
: '450', : '5100',
), ),
PointsCaptain( PointsCaptain(
kolor: AppColor.yellowColor, kolor: AppColor
.gold, // Gold color for highest value
pricePoint: pricePoint:
box.read(BoxName.countryCode) == box.read(BoxName.countryCode) ==
'Jordan' 'Jordan'
@@ -352,14 +357,12 @@ class WalletCaptain extends StatelessWidget {
box.read(BoxName.countryCode) == box.read(BoxName.countryCode) ==
'Jordan' 'Jordan'
? '55000' ? '55000'
: '1200', : '130000',
), ),
], ],
)), ),
], ),
), ]))),
),
),
const SizedBox( const SizedBox(
height: 30, height: 30,
), ),
@@ -374,10 +377,11 @@ class WalletCaptain extends StatelessWidget {
title: title:
'Create Wallet to receive your money', 'Create Wallet to receive your money',
onPressed: () async { onPressed: () async {
PaymentController paymentController = box.read(BoxName.countryCode) == 'Egypt'
Get.find<PaymentController>(); ? addBankCodeEgypt(
paymentController captainWalletController)
.createConnectAccount(); : Get.find<PaymentController>()
.createConnectAccount();
}), }),
], ],
) )
@@ -440,6 +444,49 @@ class WalletCaptain extends StatelessWidget {
} }
} }
Future<dynamic> addBankCodeEgypt(
CaptainWalletController captainWalletController) {
return Get.defaultDialog(
title: "Insert Account Bank".tr,
content: Form(
key: captainWalletController.formKeyAccount,
child: Column(
children: [
Text("Insert Card Bank Details to Receive Your Visa Money Weekly"
.tr),
MyTextForm(
controller: captainWalletController.cardBank,
label: "Insert card number".tr,
hint: '4123 4567 8910 1235',
type: TextInputType.number),
const SizedBox(
height: 10,
),
BankDropdown()
],
)),
confirm: MyElevatedButton(
title: 'Ok'.tr,
onPressed: () async {
if (captainWalletController.formKeyAccount.currentState!
.validate()) {
Get.back();
var res =
await CRUD().post(link: AppLink.updateAccountBank, payload: {
"bankCode": Get.find<BankController>().selectedBank.toString(),
"accountBank": captainWalletController.cardBank.text.toString(),
"id": box.read(BoxName.driverID).toString()
});
print('res: ${res}');
if (res != 'failure') {
Get.snackbar(
'updated succses'.tr, 'bank account added succesfly',
backgroundColor: AppColor.greenColor);
}
}
}));
}
class MyDropDown1 extends StatelessWidget { class MyDropDown1 extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

View File

@@ -1,13 +1,16 @@
import 'package:SEFER/constant/style.dart'; import 'package:SEFER/constant/style.dart';
import 'package:SEFER/controller/home/payment/captain_wallet_controller.dart';
import 'package:SEFER/views/widgets/mycircular.dart'; import 'package:SEFER/views/widgets/mycircular.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:SEFER/controller/profile/captain_profile_controller.dart'; import 'package:SEFER/controller/profile/captain_profile_controller.dart';
import 'package:SEFER/views/widgets/my_scafold.dart'; import 'package:SEFER/views/widgets/my_scafold.dart';
class ProfileCaptain extends StatelessWidget { import '../my_wallet/walet_captain.dart';
const ProfileCaptain({super.key});
class ProfileCaptain extends StatelessWidget {
ProfileCaptain({super.key});
CaptainWalletController captainWalletController = CaptainWalletController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Get.put(CaptainProfileController()); Get.put(CaptainProfileController());
@@ -21,43 +24,77 @@ class ProfileCaptain extends StatelessWidget {
child: Center( child: Center(
child: controller.isLoading child: controller.isLoading
? const MyCircularProgressIndicator() ? const MyCircularProgressIndicator()
: DriverProfileCard( : Column(
driverId: children: [
controller.captainProfileData['driverID'] ?? '', Container(
name: controller.captainProfileData['first_name'] + decoration: AppStyle.boxDecoration1,
' ' + child: InkWell(
(controller.captainProfileData['last_name'] ?? ''), onTap: () async {
phoneNumber: addBankCodeEgypt(captainWalletController);
controller.captainProfileData['phone'] ?? '', },
email: controller.captainProfileData['email'] ?? '', child: Padding(
birthdate: padding: const EdgeInsets.all(8.0),
controller.captainProfileData['birthdate'] ?? '', child: Text(
gender: controller.captainProfileData['gender'] ?? '', 'Add bank Account'.tr,
education: style: AppStyle.title,
controller.captainProfileData['education'] ?? '', ),
carMake: controller.captainProfileData['make'] ?? '', ),
carModel: controller.captainProfileData['model'] ?? '', ),
carPlate: ),
controller.captainProfileData['car_plate'] ?? '', SizedBox(
carColor: controller.captainProfileData['color'] ?? '', height: Get.height * .8,
vin: controller.captainProfileData['vin'] ?? '', child: DriverProfileCard(
registrationDate: controller driverId:
.captainProfileData['registration_date'] ?? controller.captainProfileData['driverID'] ??
'', '',
expirationDate: name: controller
controller.captainProfileData['expiration_date'] ?? .captainProfileData['first_name'] +
'', ' ' +
ratingCount: (controller.captainProfileData['last_name'] ??
controller.captainProfileData['ratingCount'] ?? 0, ''),
ratingDriver: phoneNumber:
controller.captainProfileData['ratingDriver'] != controller.captainProfileData['phone'] ?? '',
null email:
? double.tryParse(controller controller.captainProfileData['email'] ?? '',
.captainProfileData['ratingDriver'] birthdate:
.toString()) ?? controller.captainProfileData['birthdate'] ??
0 '',
: null, gender:
age: controller.captainProfileData['age'] ?? 0, controller.captainProfileData['gender'] ?? '',
education:
controller.captainProfileData['education'] ??
'',
carMake:
controller.captainProfileData['make'] ?? '',
carModel:
controller.captainProfileData['model'] ?? '',
carPlate:
controller.captainProfileData['car_plate'] ??
'',
carColor:
controller.captainProfileData['color'] ?? '',
vin: controller.captainProfileData['vin'] ?? '',
registrationDate: controller.captainProfileData[
'registration_date'] ??
'',
expirationDate: controller
.captainProfileData['expiration_date'] ??
'',
ratingCount: controller
.captainProfileData['ratingCount'] ??
0,
ratingDriver: controller
.captainProfileData['ratingDriver'] !=
null
? double.tryParse(controller
.captainProfileData['ratingDriver']
.toString()) ??
0
: null,
age: controller.captainProfileData['age'] ?? 0,
),
),
],
), ),
), ),
), ),
@@ -65,63 +102,6 @@ class ProfileCaptain extends StatelessWidget {
) )
], ],
isleading: true, isleading: true,
// action: GetBuilder<CaptainProfileController>(
// builder: (controller) => IconButton(
// onPressed: () {
// Get.defaultDialog(
// title: 'Edit Your data'.tr,
// titleStyle: AppStyle.title,
// content: SizedBox(
// height: Get.height * .4,
// child: SingleChildScrollView(
// child: Column(
// children: [
// MyTextForm(
// controller: controller.vin,
// hint: 'write vin for your car'.tr,
// label: 'VIN'.tr,
// type: TextInputType.emailAddress,
// ),
// MyTextForm(
// controller: controller.color,
// hint: 'write Color for your car'.tr,
// label: 'Color'.tr,
// type: TextInputType.emailAddress,
// ),
// MyTextForm(
// controller: controller.make,
// hint: 'write Make for your car'.tr,
// label: 'Make'.tr,
// type: TextInputType.emailAddress,
// ),
// MyTextForm(
// controller: controller.model,
// hint: 'write Model for your car'.tr,
// label: 'Model'.tr,
// type: TextInputType.emailAddress,
// ),
// MyTextForm(
// controller: controller.year,
// hint: 'write Year for your car'.tr,
// label: 'Year'.tr,
// type: TextInputType.number,
// ),
// MyTextForm(
// controller: controller.expirationDate,
// hint: 'write Expiration Date for your car'.tr,
// label: 'Expiration Date'.tr,
// type: TextInputType.datetime),
// MyElevatedButton(
// title: 'Update'.tr,
// onPressed: () => controller.updateFields())
// ],
// ),
// ),
// ));
// },
// icon: const Icon(Icons.edit),
// ),
// )
); );
} }
} }
@@ -167,175 +147,178 @@ class DriverProfileCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Card( return Container(
elevation: 8, // elevation: 8,
decoration: AppStyle.boxDecoration1,
margin: const EdgeInsets.all(16), margin: const EdgeInsets.all(16),
child: Padding( child: SingleChildScrollView(
padding: const EdgeInsets.all(16), child: Padding(
child: Column( padding: const EdgeInsets.all(16),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Text( children: [
style: AppStyle.title, Text(
name, style: AppStyle.title,
), name,
const SizedBox(height: 8), ),
Row( const SizedBox(height: 8),
children: [ Row(
const Icon(Icons.phone), children: [
const SizedBox(width: 8), const Icon(Icons.phone),
Text(style: AppStyle.title, phoneNumber), const SizedBox(width: 8),
], Text(style: AppStyle.title, phoneNumber),
), ],
const SizedBox(height: 8), ),
Row( const SizedBox(height: 8),
children: [ Row(
const Icon(Icons.calendar_today), children: [
const SizedBox(width: 8), const Icon(Icons.calendar_today),
Text( const SizedBox(width: 8),
style: AppStyle.title, Text(
'${'birthdate'.tr} : $birthdate', style: AppStyle.title,
), '${'birthdate'.tr} : $birthdate',
], ),
), ],
const SizedBox(height: 8), ),
Row( const SizedBox(height: 8),
children: [ Row(
const Icon(Icons.wc), children: [
const SizedBox(width: 8), const Icon(Icons.wc),
Text( const SizedBox(width: 8),
style: AppStyle.title, Text(
'${'gender'.tr} : $gender', style: AppStyle.title,
), '${'gender'.tr} : $gender',
], ),
), ],
const SizedBox(height: 8), ),
Row( const SizedBox(height: 8),
children: [ Row(
const Icon(Icons.school), children: [
const SizedBox(width: 8), const Icon(Icons.school),
Text( const SizedBox(width: 8),
style: AppStyle.title, Text(
'${'education'.tr} : $education', style: AppStyle.title,
), '${'education'.tr} : $education',
], ),
), ],
const SizedBox(height: 8), ),
Row( const SizedBox(height: 8),
children: [ Row(
const Icon(Icons.car_repair), children: [
const SizedBox(width: 8), const Icon(Icons.car_repair),
Text( const SizedBox(width: 8),
style: AppStyle.title, Text(
'${'Make'.tr} : $carMake', style: AppStyle.title,
), '${'Make'.tr} : $carMake',
], ),
), ],
const SizedBox(height: 8), ),
Row( const SizedBox(height: 8),
children: [ Row(
const Icon(Icons.model_training), children: [
const SizedBox(width: 8), const Icon(Icons.model_training),
Text( const SizedBox(width: 8),
style: AppStyle.title, Text(
'${'car_model'.tr} : $carModel', style: AppStyle.title,
), '${'car_model'.tr} : $carModel',
], ),
), ],
const SizedBox(height: 8), ),
Row( const SizedBox(height: 8),
children: [ Row(
const Icon(Icons.drive_eta), children: [
const SizedBox(width: 8), const Icon(Icons.drive_eta),
Text( const SizedBox(width: 8),
style: AppStyle.title, Text(
'${'car_plate'.tr} : $carPlate', style: AppStyle.title,
), '${'car_plate'.tr} : $carPlate',
], ),
), ],
const SizedBox(height: 8), ),
Row( const SizedBox(height: 8),
children: [ Row(
const Icon(Icons.color_lens), children: [
const SizedBox(width: 8), const Icon(Icons.color_lens),
Text( const SizedBox(width: 8),
style: AppStyle.title, Text(
'${'car_color'.tr} : $carColor', style: AppStyle.title,
), '${'car_color'.tr} : $carColor',
], ),
), ],
const SizedBox(height: 8), ),
Row( const SizedBox(height: 8),
children: [ Row(
const Icon(Icons.confirmation_number), children: [
const SizedBox(width: 8), const Icon(Icons.confirmation_number),
Text( const SizedBox(width: 8),
style: AppStyle.title, Text(
'${'vin'.tr} : $vin', style: AppStyle.title,
), '${'vin'.tr} : $vin',
], ),
), ],
const SizedBox(height: 8), ),
Row( const SizedBox(height: 8),
children: [ Row(
const Icon(Icons.calendar_today), children: [
const SizedBox(width: 8), const Icon(Icons.calendar_today),
Text( const SizedBox(width: 8),
style: AppStyle.title, Text(
'${'registration_date'.tr} : $registrationDate', style: AppStyle.title,
), '${'registration_date'.tr} : $registrationDate',
], ),
), ],
const SizedBox(height: 8), ),
Row( const SizedBox(height: 8),
children: [ Row(
const Icon(Icons.calendar_today), children: [
const SizedBox(width: 8), const Icon(Icons.calendar_today),
Text( const SizedBox(width: 8),
style: AppStyle.title, Text(
'${'expiration_date'.tr} : $expirationDate', style: AppStyle.title,
), '${'expiration_date'.tr} : $expirationDate',
], ),
), ],
const SizedBox(height: 8), ),
Row( const SizedBox(height: 8),
children: [ Row(
const Icon(Icons.star), children: [
const SizedBox(width: 8), const Icon(Icons.star),
Text( const SizedBox(width: 8),
style: AppStyle.title, Text(
'${'rating_count'.tr} : $ratingCount', style: AppStyle.title,
), '${'rating_count'.tr} : $ratingCount',
], ),
), ],
const SizedBox(height: 8), ),
Row( const SizedBox(height: 8),
children: [ Row(
const Icon(Icons.star_rate), children: [
const SizedBox(width: 8), const Icon(Icons.star_rate),
ratingDriver != null const SizedBox(width: 8),
? Text( ratingDriver != null
style: AppStyle.title, ? Text(
'${'rating_driver'.tr} : $ratingDriver', style: AppStyle.title,
) '${'rating_driver'.tr} : $ratingDriver',
: Text( )
style: AppStyle.title, : Text(
'${'rating_driver'.tr} : 0', style: AppStyle.title,
), '${'rating_driver'.tr} : 0',
], ),
), ],
const SizedBox(height: 8), ),
Row( const SizedBox(height: 8),
children: [ Row(
const Icon(Icons.person), children: [
const SizedBox(width: 8), const Icon(Icons.person),
Text( const SizedBox(width: 8),
style: AppStyle.title, Text(
'${'age'.tr} : $age', style: AppStyle.title,
), '${'age'.tr} : $age',
], ),
), ],
], ),
],
),
), ),
), ),
); );

View File

@@ -7,7 +7,7 @@ import 'package:get_storage/get_storage.dart';
import '../../constant/colors.dart'; import '../../constant/colors.dart';
class MyTextForm extends StatelessWidget { class MyTextForm extends StatelessWidget {
const MyTextForm({ MyTextForm({
super.key, super.key,
required this.controller, required this.controller,
required this.label, required this.label,
@@ -47,6 +47,11 @@ class MyTextForm extends StatelessWidget {
if (value!.isEmpty) { if (value!.isEmpty) {
return '${'Please enter'.tr} $label.'.tr; return '${'Please enter'.tr} $label.'.tr;
} }
if (label.contains("Insert card number".tr)) {
if (value.length != 16) {
return "Please enter a valid card 16-digit number.".tr;
}
}
if (type == TextInputType.emailAddress) { if (type == TextInputType.emailAddress) {
if (!value.contains('@')) { if (!value.contains('@')) {