2/22/1
This commit is contained in:
@@ -11,7 +11,6 @@ import '../../../controller/payment/payment_controller.dart';
|
||||
import '../../../main.dart';
|
||||
import '../../widgets/elevated_btn.dart';
|
||||
import '../../widgets/my_scafold.dart';
|
||||
import '../map_widget.dart/payment_method.page.dart';
|
||||
import 'passenger_wallet_dialoge.dart';
|
||||
|
||||
class PassengerWallet extends StatelessWidget {
|
||||
@@ -22,7 +21,7 @@ class PassengerWallet extends StatelessWidget {
|
||||
Get.put(PaymentController());
|
||||
Get.put(CreditCardController());
|
||||
return MyScafolld(
|
||||
title: 'My Wallet',
|
||||
title: 'My Wallet'.tr,
|
||||
isleading: true,
|
||||
body: [
|
||||
GetBuilder<PaymentController>(
|
||||
|
||||
@@ -126,7 +126,7 @@ class PassengerWalletDialoge extends StatelessWidget {
|
||||
const Spacer(),
|
||||
MyElevatedButton(
|
||||
kolor: AppColor.blueColor,
|
||||
title: 'Pay with Your PayPal'.tr,
|
||||
title: '${'Pay with Your'.tr} PayPal',
|
||||
onPressed: () {
|
||||
if (controller.selectedAmount != 0) {
|
||||
controller.makePaymentPayPal(context);
|
||||
@@ -145,7 +145,9 @@ class PassengerWalletDialoge extends StatelessWidget {
|
||||
controller.makePaymentStripe(
|
||||
controller.selectedAmount!
|
||||
.toDouble(), // Convert int to double
|
||||
'USD', () {
|
||||
// 'EGP', () {
|
||||
// 'USD', () {
|
||||
'JOD', () {
|
||||
controller.addPassengerWallet();
|
||||
controller.changePromoSheetDialogue();
|
||||
controller.getPassengerWallet();
|
||||
|
||||
54
lib/views/home/my_wallet/payment_history_driver_page.dart
Normal file
54
lib/views/home/my_wallet/payment_history_driver_page.dart
Normal file
@@ -0,0 +1,54 @@
|
||||
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/views/widgets/my_scafold.dart';
|
||||
import 'package:SEFER/views/widgets/mycircular.dart';
|
||||
|
||||
import '../../../controller/payment/driver_payment_controller.dart';
|
||||
|
||||
class PaymentHistoryDriverPage extends StatelessWidget {
|
||||
const PaymentHistoryDriverPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(DriverWalletHistoryController());
|
||||
return MyScafolld(
|
||||
title: 'Payment History'.tr,
|
||||
body: [
|
||||
GetBuilder<DriverWalletHistoryController>(
|
||||
builder: (controller) => controller.isLoading
|
||||
? const MyCircularProgressIndicator()
|
||||
: 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);
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@ class PointsCaptain extends StatelessWidget {
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'$countPoint Point',
|
||||
'$countPoint ${'Point'.tr}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
|
||||
@@ -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