2/22/1
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:SEFER/views/home/my_wallet/payment_history_driver_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
@@ -23,7 +24,7 @@ class WaletCaptain extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(MapPassengerController());
|
||||
return MyScafolld(
|
||||
title: 'Captain Wallet'.tr,
|
||||
title: 'Driver Wallet'.tr,
|
||||
body: [
|
||||
GetBuilder<CaptainWalletController>(
|
||||
builder: (captainWalletController) => captainWalletController
|
||||
@@ -37,16 +38,23 @@ class WaletCaptain extends StatelessWidget {
|
||||
const SizedBox(),
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration.copyWith(
|
||||
color: double.parse(
|
||||
captainWalletController.totalPoints) <
|
||||
100
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
color: double.parse(captainWalletController
|
||||
.totalPoints) <
|
||||
0 &&
|
||||
double.parse(captainWalletController
|
||||
.totalPoints) >
|
||||
-500
|
||||
? AppColor.yellowColor
|
||||
: double.parse(captainWalletController
|
||||
.totalPoints) <
|
||||
-500
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Text(
|
||||
'Total Points is ${captainWalletController.totalPoints.toString()} 💎',
|
||||
'${'Total Points is'.tr} ${captainWalletController.totalPoints.toString()} 💎',
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
),
|
||||
@@ -56,9 +64,10 @@ class WaletCaptain extends StatelessWidget {
|
||||
),
|
||||
double.parse(captainWalletController.totalPoints
|
||||
.toString()) <
|
||||
100
|
||||
-500
|
||||
? MyElevatedButton(
|
||||
title: 'Charge your Account', onPressed: () {})
|
||||
title: 'Charge your Account'.tr,
|
||||
onPressed: () {})
|
||||
: const SizedBox(),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
@@ -75,7 +84,7 @@ class WaletCaptain extends StatelessWidget {
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Total Budget from trips is ',
|
||||
'Total Budget from trips is '.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Container(
|
||||
@@ -86,8 +95,9 @@ class WaletCaptain extends StatelessWidget {
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.snackbar(
|
||||
'Total Amount: ${captainWalletController.totalAmount}\$',
|
||||
'This amount for all trip I get from Passengers',
|
||||
'${'Total Amount:'.tr} ${captainWalletController.totalAmount}\$',
|
||||
'This amount for all trip I get from Passengers'
|
||||
.tr,
|
||||
duration:
|
||||
const Duration(seconds: 6),
|
||||
backgroundColor:
|
||||
@@ -112,7 +122,8 @@ class WaletCaptain extends StatelessWidget {
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Total Budget from trips by\nCredit card is ',
|
||||
'Total Budget from trips by\nCredit card is '
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Container(
|
||||
@@ -125,9 +136,11 @@ class WaletCaptain extends StatelessWidget {
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Get.snackbar(
|
||||
'Total Amount: ${captainWalletController.totalAmountVisa}\$',
|
||||
'This amount for all trip I get from Passengers and Collected For me in ${AppInformation.appName} Wallet'
|
||||
.tr,
|
||||
'${'Total Amount:'.tr} ${captainWalletController.totalAmountVisa}\$',
|
||||
'This amount for all trip I get from Passengers and Collected For me in'
|
||||
.tr +
|
||||
' ${AppInformation.appName} Wallet'
|
||||
.tr,
|
||||
duration:
|
||||
const Duration(seconds: 6),
|
||||
backgroundColor:
|
||||
@@ -164,8 +177,29 @@ class WaletCaptain extends StatelessWidget {
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Pay',
|
||||
onPressed: () async {
|
||||
await captainWalletController
|
||||
.payFromBudget();
|
||||
if (double.parse(
|
||||
captainWalletController
|
||||
.amountFromBudgetController
|
||||
.text) <
|
||||
double.parse(
|
||||
captainWalletController
|
||||
.totalAmount)) {
|
||||
await captainWalletController
|
||||
.payFromBudget();
|
||||
} else {
|
||||
Get.back();
|
||||
Get.snackbar(
|
||||
'Your Budget less than needed'
|
||||
.tr,
|
||||
'',
|
||||
duration: const Duration(
|
||||
seconds: 3),
|
||||
backgroundColor:
|
||||
AppColor.redColor,
|
||||
snackPosition:
|
||||
SnackPosition.BOTTOM,
|
||||
);
|
||||
}
|
||||
}),
|
||||
cancel: MyElevatedButton(
|
||||
title: 'Cancel'.tr,
|
||||
@@ -263,9 +297,8 @@ class WaletCaptain extends StatelessWidget {
|
||||
kolor: AppColor.blueColor,
|
||||
title: 'Payment History'.tr,
|
||||
onPressed: () {
|
||||
// Get.to(
|
||||
// () => const PaymentHistoryPassengerPage(),
|
||||
// transition: Transition.size);
|
||||
Get.to(() => const PaymentHistoryDriverPage(),
|
||||
transition: Transition.size);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user