BASE: Update Icons & Name Of The App.
This commit is contained in:
@@ -9,7 +9,7 @@ import 'package:customer/themes/text_field_widget.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../../../themes/show_toast_dialog.dart';
|
||||
|
||||
@@ -25,10 +25,19 @@ class PaymentListScreen extends StatelessWidget {
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text("Top up Wallet".tr(), style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500)),
|
||||
title: Text(
|
||||
"Top up Wallet".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
@@ -40,40 +49,152 @@ class PaymentListScreen extends StatelessWidget {
|
||||
title: 'Amount'.tr(),
|
||||
hintText: 'Enter Amount'.tr(),
|
||||
controller: controller.topUpAmountController.value,
|
||||
textInputType: const TextInputType.numberWithOptions(decimal: true, signed: true),
|
||||
prefix: Padding(padding: const EdgeInsets.all(12.0), child: Text(Constant.currencyModel!.symbol.toString(), style: const TextStyle(fontSize: 20, color: AppThemeData.grey800))),
|
||||
inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9]'))],
|
||||
textInputType: const TextInputType.numberWithOptions(
|
||||
decimal: true,
|
||||
signed: true,
|
||||
),
|
||||
prefix: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Text(
|
||||
Constant.currencyModel!.symbol.toString(),
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
color: AppThemeData.grey800,
|
||||
),
|
||||
),
|
||||
),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
child: Text(
|
||||
"Select Top up Options".tr(),
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(borderRadius: const BorderRadius.all(Radius.circular(20)), color: isDark ? AppThemeData.grey900 : AppThemeData.grey50),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
||||
color:
|
||||
isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Visibility(visible: controller.stripeModel.value.isEnabled == true, child: cardDecoration(controller, PaymentGateway.stripe, isDark, "assets/images/stripe.png")),
|
||||
Visibility(visible: controller.payPalModel.value.isEnabled == true, child: cardDecoration(controller, PaymentGateway.paypal, isDark, "assets/images/paypal.png")),
|
||||
Visibility(visible: controller.payStackModel.value.isEnable == true, child: cardDecoration(controller, PaymentGateway.payStack, isDark, "assets/images/paystack.png")),
|
||||
Visibility(
|
||||
visible: controller.mercadoPagoModel.value.isEnabled == true,
|
||||
child: cardDecoration(controller, PaymentGateway.mercadoPago, isDark, "assets/images/mercado-pago.png"),
|
||||
visible:
|
||||
controller.stripeModel.value.isEnabled == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.stripe,
|
||||
isDark,
|
||||
"assets/images/stripe.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: controller.flutterWaveModel.value.isEnable == true,
|
||||
child: cardDecoration(controller, PaymentGateway.flutterWave, isDark, "assets/images/flutterwave_logo.png"),
|
||||
visible:
|
||||
controller.payPalModel.value.isEnabled == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.paypal,
|
||||
isDark,
|
||||
"assets/images/paypal.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.payStackModel.value.isEnable == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.payStack,
|
||||
isDark,
|
||||
"assets/images/paystack.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.mercadoPagoModel.value.isEnabled ==
|
||||
true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.mercadoPago,
|
||||
isDark,
|
||||
"assets/images/mercado-pago.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.flutterWaveModel.value.isEnable ==
|
||||
true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.flutterWave,
|
||||
isDark,
|
||||
"assets/images/flutterwave_logo.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.payFastModel.value.isEnable == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.payFast,
|
||||
isDark,
|
||||
"assets/images/payfast.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.razorPayModel.value.isEnabled == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.razorpay,
|
||||
isDark,
|
||||
"assets/images/razorpay.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.midTransModel.value.enable == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.midTrans,
|
||||
isDark,
|
||||
"assets/images/midtrans.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.orangeMoneyModel.value.enable == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.orangeMoney,
|
||||
isDark,
|
||||
"assets/images/orange_money.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: controller.xenditModel.value.enable == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.xendit,
|
||||
isDark,
|
||||
"assets/images/xendit.png",
|
||||
),
|
||||
),
|
||||
Visibility(visible: controller.payFastModel.value.isEnable == true, child: cardDecoration(controller, PaymentGateway.payFast, isDark, "assets/images/payfast.png")),
|
||||
Visibility(visible: controller.razorPayModel.value.isEnabled == true, child: cardDecoration(controller, PaymentGateway.razorpay, isDark, "assets/images/razorpay.png")),
|
||||
Visibility(visible: controller.midTransModel.value.enable == true, child: cardDecoration(controller, PaymentGateway.midTrans, isDark, "assets/images/midtrans.png")),
|
||||
Visibility(visible: controller.orangeMoneyModel.value.enable == true, child: cardDecoration(controller, PaymentGateway.orangeMoney, isDark, "assets/images/orange_money.png")),
|
||||
Visibility(visible: controller.xenditModel.value.enable == true, child: cardDecoration(controller, PaymentGateway.xendit, isDark, "assets/images/xendit.png")),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -96,40 +217,101 @@ class PaymentListScreen extends StatelessWidget {
|
||||
if (controller.topUpAmountController.value.text.isEmpty) {
|
||||
ShowToastDialog.showToast("Please Enter Amount".tr());
|
||||
} else {
|
||||
if (double.parse(controller.topUpAmountController.value.text) >= double.parse(Constant.minimumAmountToDeposit.toString())) {
|
||||
if (controller.selectedPaymentMethod.value == PaymentGateway.stripe.name) {
|
||||
controller.stripeMakePayment(amount: controller.topUpAmountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.paypal.name) {
|
||||
controller.paypalPaymentSheet(controller.topUpAmountController.value.text, context);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.payStack.name) {
|
||||
controller.payStackPayment(controller.topUpAmountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.mercadoPago.name) {
|
||||
controller.mercadoPagoMakePayment(context: context, amount: controller.topUpAmountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.flutterWave.name) {
|
||||
controller.flutterWaveInitiatePayment(context: context, amount: controller.topUpAmountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.payFast.name) {
|
||||
controller.payFastPayment(context: context, amount: controller.topUpAmountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.midTrans.name) {
|
||||
controller.midtransMakePayment(context: context, amount: controller.topUpAmountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.orangeMoney.name) {
|
||||
controller.orangeMakePayment(context: context, amount: controller.topUpAmountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.xendit.name) {
|
||||
controller.xenditPayment(context, controller.topUpAmountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.razorpay.name) {
|
||||
RazorPayController().createOrderRazorPay(amount: double.parse(controller.topUpAmountController.value.text), razorpayModel: controller.razorPayModel.value).then((value) {
|
||||
if (value == null) {
|
||||
Get.back();
|
||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||
} else {
|
||||
CreateRazorPayOrderModel result = value;
|
||||
controller.openCheckout(amount: controller.topUpAmountController.value.text, orderId: result.id);
|
||||
}
|
||||
});
|
||||
if (double.parse(
|
||||
controller.topUpAmountController.value.text,
|
||||
) >=
|
||||
double.parse(
|
||||
Constant.minimumAmountToDeposit.toString(),
|
||||
)) {
|
||||
if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.stripe.name) {
|
||||
controller.stripeMakePayment(
|
||||
amount: controller.topUpAmountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.paypal.name) {
|
||||
controller.paypalPaymentSheet(
|
||||
controller.topUpAmountController.value.text,
|
||||
context,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.payStack.name) {
|
||||
controller.payStackPayment(
|
||||
controller.topUpAmountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.mercadoPago.name) {
|
||||
controller.mercadoPagoMakePayment(
|
||||
context: context,
|
||||
amount: controller.topUpAmountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.flutterWave.name) {
|
||||
controller.flutterWaveInitiatePayment(
|
||||
context: context,
|
||||
amount: controller.topUpAmountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.payFast.name) {
|
||||
controller.payFastPayment(
|
||||
context: context,
|
||||
amount: controller.topUpAmountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.midTrans.name) {
|
||||
controller.midtransMakePayment(
|
||||
context: context,
|
||||
amount: controller.topUpAmountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.orangeMoney.name) {
|
||||
controller.orangeMakePayment(
|
||||
context: context,
|
||||
amount: controller.topUpAmountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.xendit.name) {
|
||||
controller.xenditPayment(
|
||||
context,
|
||||
controller.topUpAmountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.razorpay.name) {
|
||||
RazorPayController()
|
||||
.createOrderRazorPay(
|
||||
amount: double.parse(
|
||||
controller.topUpAmountController.value.text,
|
||||
),
|
||||
razorpayModel: controller.razorPayModel.value,
|
||||
)
|
||||
.then((value) {
|
||||
if (value == null) {
|
||||
Get.back();
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin."
|
||||
.tr(),
|
||||
);
|
||||
} else {
|
||||
CreateRazorPayOrderModel result = value;
|
||||
controller.openCheckout(
|
||||
amount:
|
||||
controller
|
||||
.topUpAmountController
|
||||
.value
|
||||
.text,
|
||||
orderId: result.id,
|
||||
);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ShowToastDialog.showToast("Please select payment method".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"Please select payment method".tr(),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
ShowToastDialog.showToast("${'Please Enter minimum amount of'.tr()} ${Constant.amountShow(amount: Constant.minimumAmountToDeposit)}");
|
||||
ShowToastDialog.showToast(
|
||||
"${'Please Enter minimum amount of'.tr()} ${Constant.amountShow(amount: Constant.minimumAmountToDeposit)}",
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -141,7 +323,12 @@ class PaymentListScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Obx cardDecoration(WalletController controller, PaymentGateway value, isDark, String image) {
|
||||
Obx cardDecoration(
|
||||
WalletController controller,
|
||||
PaymentGateway value,
|
||||
isDark,
|
||||
String image,
|
||||
) {
|
||||
return Obx(
|
||||
() => Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
@@ -154,22 +341,35 @@ class PaymentListScreen extends StatelessWidget {
|
||||
Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: ShapeDecoration(shape: RoundedRectangleBorder(side: const BorderSide(width: 1, color: Color(0xFFE5E7EB)), borderRadius: BorderRadius.circular(8))),
|
||||
child: Padding(padding: EdgeInsets.all(value.name == "payFast" ? 0 : 8.0), child: Image.asset(image)),
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: const BorderSide(width: 1, color: Color(0xFFE5E7EB)),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(value.name == "payFast" ? 0 : 8.0),
|
||||
child: Image.asset(image),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
value.name.capitalizeString(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
),
|
||||
const Expanded(child: SizedBox()),
|
||||
Radio(
|
||||
value: value.name,
|
||||
groupValue: controller.selectedPaymentMethod.value,
|
||||
activeColor: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||
activeColor:
|
||||
isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||
onChanged: (value) {
|
||||
controller.selectedPaymentMethod.value = value.toString();
|
||||
},
|
||||
|
||||
@@ -23,7 +23,7 @@ import '../../rental_service/rental_order_details_screen.dart';
|
||||
import '../order_list_screen/order_details_screen.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
|
||||
class WalletScreen extends StatelessWidget {
|
||||
const WalletScreen({super.key});
|
||||
@@ -36,7 +36,8 @@ class WalletScreen extends StatelessWidget {
|
||||
init: WalletController(),
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
body:
|
||||
controller.isLoading.value
|
||||
? Constant.loader()
|
||||
@@ -49,12 +50,30 @@ class WalletScreen extends StatelessWidget {
|
||||
children: [
|
||||
Image.asset("assets/images/login.gif", height: 120),
|
||||
const SizedBox(height: 12),
|
||||
Text("Please Log In to Continue".tr(), style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 22, fontFamily: AppThemeData.semiBold)),
|
||||
Text(
|
||||
"Please Log In to Continue".tr(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey100
|
||||
: AppThemeData.grey800,
|
||||
fontSize: 22,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
"You’re not logged in. Please sign in to access your account and explore all features.".tr(),
|
||||
"You’re not logged in. Please sign in to access your account and explore all features."
|
||||
.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey500,
|
||||
fontSize: 16,
|
||||
fontFamily: AppThemeData.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
RoundedButtonFill(
|
||||
@@ -71,7 +90,9 @@ class WalletScreen extends StatelessWidget {
|
||||
),
|
||||
)
|
||||
: Padding(
|
||||
padding: EdgeInsets.only(top: MediaQuery.of(context).viewPadding.top),
|
||||
padding: EdgeInsets.only(
|
||||
top: MediaQuery.of(context).viewPadding.top,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
@@ -79,20 +100,39 @@ class WalletScreen extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"My Wallet".tr(),
|
||||
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"Keep track of your balance, transactions, and payment methods all in one place.".tr(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||
"Keep track of your balance, transactions, and payment methods all in one place."
|
||||
.tr(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -102,34 +142,66 @@ class WalletScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
),
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
image: DecorationImage(image: AssetImage("assets/images/wallet.png"), fit: BoxFit.fill),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(20),
|
||||
),
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
"assets/images/wallet.png",
|
||||
),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 20,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
"My Wallet".tr(),
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
color: isDark ? AppThemeData.primary100 : AppThemeData.primary100,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary100
|
||||
: AppThemeData.primary100,
|
||||
fontSize: 16,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontFamily: AppThemeData.regular,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Constant.amountShow(amount: controller.userModel.value.walletAmount.toString()),
|
||||
Constant.amountShow(
|
||||
amount:
|
||||
controller
|
||||
.userModel
|
||||
.value
|
||||
.walletAmount
|
||||
.toString(),
|
||||
),
|
||||
maxLines: 1,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontSize: 40, overflow: TextOverflow.ellipsis, fontFamily: AppThemeData.bold),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey50,
|
||||
fontSize: 40,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontFamily: AppThemeData.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 80),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 80,
|
||||
),
|
||||
child: RoundedButtonFill(
|
||||
title: "Top up".tr(),
|
||||
color: AppThemeData.warning300,
|
||||
@@ -149,15 +221,30 @@ class WalletScreen extends StatelessWidget {
|
||||
Expanded(
|
||||
child:
|
||||
controller.walletTransactionList.isEmpty
|
||||
? Constant.showEmptyView(message: "Transaction not found".tr())
|
||||
? Constant.showEmptyView(
|
||||
message: "Transaction not found".tr(),
|
||||
)
|
||||
: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.zero,
|
||||
itemCount: controller.walletTransactionList.length,
|
||||
itemCount:
|
||||
controller
|
||||
.walletTransactionList
|
||||
.length,
|
||||
itemBuilder: (context, index) {
|
||||
WalletTransactionModel walletTractionModel = controller.walletTransactionList[index];
|
||||
return transactionCard(controller, isDark, walletTractionModel);
|
||||
WalletTransactionModel
|
||||
walletTractionModel =
|
||||
controller
|
||||
.walletTransactionList[index];
|
||||
return transactionCard(
|
||||
controller,
|
||||
isDark,
|
||||
walletTractionModel,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -170,32 +257,54 @@ class WalletScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Column transactionCard(WalletController controller, isDark, WalletTransactionModel transactionModel) {
|
||||
Column transactionCard(
|
||||
WalletController controller,
|
||||
isDark,
|
||||
WalletTransactionModel transactionModel,
|
||||
) {
|
||||
return Column(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
final orderId = transactionModel.orderId.toString();
|
||||
final orderData = await FireStoreUtils.getOrderByIdFromAllCollections(orderId);
|
||||
final orderData =
|
||||
await FireStoreUtils.getOrderByIdFromAllCollections(orderId);
|
||||
|
||||
if (orderData != null) {
|
||||
final collection = orderData['collection_name'];
|
||||
|
||||
switch (collection) {
|
||||
case CollectionName.parcelOrders:
|
||||
Get.to(const ParcelOrderDetails(), arguments: ParcelOrderModel.fromJson(orderData));
|
||||
Get.to(
|
||||
const ParcelOrderDetails(),
|
||||
arguments: ParcelOrderModel.fromJson(orderData),
|
||||
);
|
||||
break;
|
||||
case CollectionName.providerOrders:
|
||||
Get.to(const OnDemandOrderDetailsScreen(), arguments: OnProviderOrderModel.fromJson(orderData));
|
||||
Get.to(
|
||||
const OnDemandOrderDetailsScreen(),
|
||||
arguments: OnProviderOrderModel.fromJson(orderData),
|
||||
);
|
||||
break;
|
||||
case CollectionName.rentalOrders:
|
||||
Get.to(() => RentalOrderDetailsScreen(), arguments: RentalOrderModel.fromJson(orderData));
|
||||
Get.to(
|
||||
() => RentalOrderDetailsScreen(),
|
||||
arguments: RentalOrderModel.fromJson(orderData),
|
||||
);
|
||||
break;
|
||||
case CollectionName.rides:
|
||||
Get.to(const CabOrderDetails(), arguments: {"cabOrderModel": CabOrderModel.fromJson(orderData)});
|
||||
Get.to(
|
||||
const CabOrderDetails(),
|
||||
arguments: {
|
||||
"cabOrderModel": CabOrderModel.fromJson(orderData),
|
||||
},
|
||||
);
|
||||
break;
|
||||
case CollectionName.vendorOrders:
|
||||
Get.to(const OrderDetailsScreen(), arguments: {"orderModel": OrderModel.fromJson(orderData)});
|
||||
Get.to(
|
||||
const OrderDetailsScreen(),
|
||||
arguments: {"orderModel": OrderModel.fromJson(orderData)},
|
||||
);
|
||||
break;
|
||||
default:
|
||||
ShowToastDialog.showToast("Order details not available".tr());
|
||||
@@ -220,14 +329,31 @@ class WalletScreen extends StatelessWidget {
|
||||
children: [
|
||||
Container(
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(side: BorderSide(width: 1, color: isDark ? AppThemeData.grey800 : AppThemeData.grey100), borderRadius: BorderRadius.circular(8)),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey800
|
||||
: AppThemeData.grey100,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child:
|
||||
transactionModel.isTopup == false
|
||||
? SvgPicture.asset("assets/icons/ic_debit.svg", height: 16, width: 16)
|
||||
: SvgPicture.asset("assets/icons/ic_credit.svg", height: 16, width: 16),
|
||||
? SvgPicture.asset(
|
||||
"assets/icons/ic_debit.svg",
|
||||
height: 16,
|
||||
width: 16,
|
||||
)
|
||||
: SvgPicture.asset(
|
||||
"assets/icons/ic_credit.svg",
|
||||
height: 16,
|
||||
width: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
@@ -240,19 +366,44 @@ class WalletScreen extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
transactionModel.note.toString(),
|
||||
style: TextStyle(fontSize: 16, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600, color: isDark ? AppThemeData.grey100 : AppThemeData.grey800),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey100
|
||||
: AppThemeData.grey800,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Constant.amountShow(amount: transactionModel.amount.toString()),
|
||||
style: TextStyle(fontSize: 16, fontFamily: AppThemeData.medium, color: transactionModel.isTopup == true ? AppThemeData.success400 : AppThemeData.danger300),
|
||||
Constant.amountShow(
|
||||
amount: transactionModel.amount.toString(),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontFamily: AppThemeData.medium,
|
||||
color:
|
||||
transactionModel.isTopup == true
|
||||
? AppThemeData.success400
|
||||
: AppThemeData.danger300,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
Constant.timestampToDateTime(transactionModel.date!),
|
||||
style: TextStyle(fontSize: 12, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500, color: isDark ? AppThemeData.grey200 : AppThemeData.grey700),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey200
|
||||
: AppThemeData.grey700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -261,10 +412,30 @@ class WalletScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(padding: const EdgeInsets.symmetric(vertical: 5), child: MySeparator(color: isDark ? AppThemeData.grey700 : AppThemeData.grey200)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5),
|
||||
child: MySeparator(
|
||||
color: isDark ? AppThemeData.grey700 : AppThemeData.grey200,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
enum PaymentGateway {payme, click, payFast, mercadoPago, paypal, stripe, flutterWave, payStack, razorpay, cod, wallet, midTrans, orangeMoney, xendit }
|
||||
enum PaymentGateway {
|
||||
payme,
|
||||
click,
|
||||
payFast,
|
||||
mercadoPago,
|
||||
paypal,
|
||||
stripe,
|
||||
flutterWave,
|
||||
payStack,
|
||||
razorpay,
|
||||
cod,
|
||||
wallet,
|
||||
midTrans,
|
||||
orangeMoney,
|
||||
xendit,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user