This commit is contained in:
Hamza Aleghwairyeen
2024-04-13 00:55:09 +03:00
parent 4e35874f2b
commit a02965fac9
11 changed files with 142 additions and 42 deletions

View File

@@ -127,7 +127,7 @@ class DrawerCaptain extends StatelessWidget {
),
onTap: () {
// Handle wallet item tap
Get.to(() => WaletCaptain(), transition: Transition.native);
Get.to(() => WalletCaptain(), transition: Transition.native);
},
),
ListTile(

View File

@@ -116,7 +116,7 @@ class PassengerInfoWindow extends StatelessWidget {
children: [
Container(
decoration: AppStyle.boxDecoration1,
width: Get.width * .25,
width: Get.width * .22,
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Text(
@@ -131,7 +131,7 @@ class PassengerInfoWindow extends StatelessWidget {
width: 16.0), // Add spacing between sections
Container(
decoration: AppStyle.boxDecoration1,
width: Get.width * .27,
width: Get.width * .22,
child: Padding(
padding: const EdgeInsets.all(4),
child: Text(

View File

@@ -417,13 +417,7 @@ class Burc extends StatelessWidget {
.tr),
icon: const Icon(Icons.headphones)),
Text(
'you have a negative balance of'.tr +
'${passengerWallet.toStringAsFixed(2)}\n'
' in your'
.tr +
' ${AppInformation.appName}'
' wallet due to a previous trip.'
.tr,
'${'you have a negative balance of'.tr}${'${passengerWallet.toStringAsFixed(2)}\n${' in your'.tr}'} ${AppInformation.appName}${' wallet due to a previous trip.'.tr}',
textAlign: TextAlign.center,
style: AppStyle.subtitle,
),

View File

@@ -5,6 +5,9 @@ import 'package:SEFER/constant/style.dart';
import 'package:SEFER/controller/home/payment/captain_wallet_controller.dart';
import 'package:SEFER/controller/payment/payment_controller.dart';
import '../../../constant/box_name.dart';
import '../../../main.dart';
class PointsCaptain extends StatelessWidget {
PaymentController paymentController = Get.put(PaymentController());
CaptainWalletController captainWalletController =
@@ -24,7 +27,9 @@ class PointsCaptain extends StatelessWidget {
Widget build(BuildContext context) {
return InkWell(
onTap: () async {
await paymentController.makePaymentStripe(pricePoint, 'USD', () async {
await paymentController.makePaymentStripe(pricePoint,
box.read(BoxName.countryCode) == 'Jordan' ? 'jod' : 'egp',
() async {
await captainWalletController.addDriverPayment('visa', pricePoint);
await captainWalletController.addDriverWallet('visa', countPoint);
await captainWalletController.getCaptainWalletFromBuyPoints();
@@ -48,7 +53,7 @@ class PointsCaptain extends StatelessWidget {
style: AppStyle.subtitle,
),
Text(
'$pricePoint\$',
'$pricePoint ${box.read(BoxName.countryCode) == 'Jordan' ? 'JOD'.tr : 'LE'.tr}',
style: AppStyle.title,
),
],

View File

@@ -1,3 +1,4 @@
import 'package:SEFER/controller/functions/tts.dart';
import 'package:SEFER/views/home/my_wallet/payment_history_driver_page.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -17,8 +18,8 @@ import 'package:path/path.dart';
import '../../widgets/my_scafold.dart';
import 'points_captain.dart';
class WaletCaptain extends StatelessWidget {
WaletCaptain({super.key});
class WalletCaptain extends StatelessWidget {
WalletCaptain({super.key});
CaptainWalletController captainWalletController =
Get.put(CaptainWalletController());
@override
@@ -55,8 +56,8 @@ class WaletCaptain extends StatelessWidget {
child: InkWell(
onTap: () {
Get.snackbar(
'the 300 points equal 30 L.E'.tr,
'the 300 points equal 30 L.E for you \nSo go and gain your money'
'the 300 points equal 300 L.E'.tr,
'the 300 points equal 300 L.E for you \nSo go and gain your money'
.tr,
backgroundColor: AppColor.greenColor,
snackPosition: SnackPosition.BOTTOM,
@@ -109,13 +110,23 @@ class WaletCaptain extends StatelessWidget {
child: GestureDetector(
onTap: () {
Get.snackbar(
icon: InkWell(
onTap: () async {
await Get.find<
TextToSpeechController>()
.speakText(
'This amount for all trip I get from Passengers'
.tr);
},
child: const Icon(
Icons.headphones)),
'${'Total Amount:'.tr} ${captainWalletController.totalAmount}\$',
'This amount for all trip I get from Passengers'
.tr,
duration:
const Duration(seconds: 6),
backgroundColor:
AppColor.deepPurpleAccent,
AppColor.yellowColor,
snackPosition: SnackPosition.BOTTOM,
);
},
@@ -150,6 +161,19 @@ class WaletCaptain extends StatelessWidget {
child: InkWell(
onTap: () {
Get.snackbar(
icon: InkWell(
onTap: () async {
await Get.find<
TextToSpeechController>()
.speakText(
'This amount for all trip I get from Passengers and Collected For me in'
.tr +
' SAFAR Wallet'.tr,
);
},
child: const Icon(
Icons.headphones),
),
'${'Total Amount:'.tr} ${captainWalletController.totalAmountVisa}\$',
'This amount for all trip I get from Passengers and Collected For me in'
.tr +
@@ -158,7 +182,7 @@ class WaletCaptain extends StatelessWidget {
duration:
const Duration(seconds: 6),
backgroundColor:
AppColor.deepPurpleAccent,
AppColor.redColor,
snackPosition:
SnackPosition.BOTTOM,
);
@@ -178,15 +202,16 @@ class WaletCaptain extends StatelessWidget {
onPressed: () {
Get.defaultDialog(
title: 'Pay from my budget'.tr,
titleStyle: AppStyle.title,
content: Form(
key: captainWalletController.formKey,
child: MyTextForm(
controller: captainWalletController
.amountFromBudgetController,
label:
'${'You have in account'.tr} ${captainWalletController.totalAmount}',
'${'You have in account'.tr} ${captainWalletController.totalAmountVisa}',
hint:
'${'You have in account'.tr} ${captainWalletController.totalAmount}',
'${'You have in account'.tr} ${captainWalletController.totalAmountVisa}',
type: TextInputType.number,
),
),
@@ -199,7 +224,7 @@ class WaletCaptain extends StatelessWidget {
.text) <
double.parse(
captainWalletController
.totalAmount)) {
.totalAmountVisa)) {
await captainWalletController
.payFromBudget();
} else {
@@ -258,23 +283,55 @@ class WaletCaptain extends StatelessWidget {
children: [
PointsCaptain(
kolor: AppColor.blueColor,
pricePoint: 5.6,
countPoint: '300',
pricePoint:
box.read(BoxName.countryCode) ==
'Jordan'
? 5
: 100,
countPoint:
box.read(BoxName.countryCode) ==
'Jordan'
? '300'
: '100',
),
PointsCaptain(
kolor: Colors.green,
pricePoint: 11.2,
countPoint: '1040',
pricePoint:
box.read(BoxName.countryCode) ==
'Jordan'
? 10
: 200,
countPoint:
box.read(BoxName.countryCode) ==
'Jordan'
? '1040'
: '210',
),
PointsCaptain(
kolor: Colors.amberAccent,
pricePoint: 22.4,
countPoint: '2100',
pricePoint:
box.read(BoxName.countryCode) ==
'Jordan'
? 22
: 400,
countPoint:
box.read(BoxName.countryCode) ==
'Jordan'
? '2300'
: '440',
),
PointsCaptain(
kolor: AppColor.yellowColor,
pricePoint: 56,
countPoint: '52000',
pricePoint:
box.read(BoxName.countryCode) ==
'Jordan'
? 50
: 1000,
countPoint:
box.read(BoxName.countryCode) ==
'Jordan'
? '55000'
: '1200',
),
],
)),