1/25/2
This commit is contained in:
@@ -20,6 +20,8 @@ class AppLink {
|
|||||||
"$wallet/getAllPassengerTransaction.php";
|
"$wallet/getAllPassengerTransaction.php";
|
||||||
static String getWalletByPassenger = "$wallet/getWalletByPassenger.php";
|
static String getWalletByPassenger = "$wallet/getWalletByPassenger.php";
|
||||||
static String getPassengersWallet = "$wallet/get.php";
|
static String getPassengersWallet = "$wallet/get.php";
|
||||||
|
static String getPassengerWalletArchive =
|
||||||
|
"$wallet/getPassengerWalletArchive.php";
|
||||||
static String addPassengersWallet = "$wallet/add.php";
|
static String addPassengersWallet = "$wallet/add.php";
|
||||||
static String deletePassengersWallet = "$wallet/delete.php";
|
static String deletePassengersWallet = "$wallet/delete.php";
|
||||||
static String updatePassengersWallet = "$wallet/update.php";
|
static String updatePassengersWallet = "$wallet/update.php";
|
||||||
|
|||||||
@@ -1439,6 +1439,7 @@ class MapPassengerController extends GetxController {
|
|||||||
|
|
||||||
// getDistanceFromText(data[0]['distance']['text']);
|
// getDistanceFromText(data[0]['distance']['text']);
|
||||||
double distanceOfTrip = (data[0]['distance']['value']) / 1000;
|
double distanceOfTrip = (data[0]['distance']['value']) / 1000;
|
||||||
|
distance = distanceOfTrip;
|
||||||
print('distance is $distanceOfTrip');
|
print('distance is $distanceOfTrip');
|
||||||
// Animate the camera to the adjusted bounds
|
// Animate the camera to the adjusted bounds
|
||||||
if (distanceOfTrip <= 5) {
|
if (distanceOfTrip <= 5) {
|
||||||
@@ -1616,12 +1617,6 @@ class MapPassengerController extends GetxController {
|
|||||||
|
|
||||||
Future bottomSheet() async {
|
Future bottomSheet() async {
|
||||||
if (data.isNotEmpty) {
|
if (data.isNotEmpty) {
|
||||||
String distanceText = await data[0]['distance']['text'];
|
|
||||||
// String durationText = await data[0]['duration']['text'];
|
|
||||||
print(data[0]['duration']['text']);
|
|
||||||
print('=================================');
|
|
||||||
// distance = getDistanceFromText(distanceText);
|
|
||||||
// duration = getDistanceFromText(durationText);
|
|
||||||
durationToAdd = Duration(seconds: durationToRide);
|
durationToAdd = Duration(seconds: durationToRide);
|
||||||
print('durationToRide----- $durationToRide');
|
print('durationToRide----- $durationToRide');
|
||||||
hours = durationToAdd.inHours;
|
hours = durationToAdd.inHours;
|
||||||
@@ -1637,61 +1632,37 @@ class MapPassengerController extends GetxController {
|
|||||||
totalME = totalPassenger - tax;
|
totalME = totalPassenger - tax;
|
||||||
update();
|
update();
|
||||||
if (currentTime.hour >= 22) {
|
if (currentTime.hour >= 22) {
|
||||||
if (distanceText.contains('km')) {
|
|
||||||
cost = distance * 0.23;
|
cost = distance * 0.23;
|
||||||
update();
|
update();
|
||||||
} else {
|
|
||||||
cost = distance * 0.23 / 1000;
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
} else if (currentTime.hour < 5) {
|
} else if (currentTime.hour < 5) {
|
||||||
if (distanceText.contains('km')) {
|
|
||||||
cost = distance * 0.25;
|
cost = distance * 0.25;
|
||||||
update();
|
update();
|
||||||
} else {
|
|
||||||
cost = distance * 0.25 / 1000;
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
} else if (currentTime.hour >= 13 && currentTime.hour <= 16) {
|
} else if (currentTime.hour >= 13 && currentTime.hour <= 16) {
|
||||||
if (averageDuration > 2.5) {
|
if (averageDuration > 2.5) {
|
||||||
if (distanceText.contains('km')) {
|
|
||||||
cost = distance * 0.25;
|
cost = distance * 0.25;
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
cost = distance * 0.25 / 1000;
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (distanceText.contains('km')) {
|
|
||||||
cost = distance * 0.21;
|
cost = distance * 0.21;
|
||||||
update();
|
update();
|
||||||
} else {
|
|
||||||
cost = distance * 0.21 / 1000;
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (distanceText.contains('km')) {
|
|
||||||
cost = distance * 0.21;
|
cost = distance * 0.21;
|
||||||
update();
|
update();
|
||||||
} else {
|
|
||||||
cost = distance * 0.21 / 1000;
|
|
||||||
update();
|
|
||||||
}
|
}
|
||||||
}
|
print('cost $cost');
|
||||||
|
|
||||||
if (totalPassenger < 1) {
|
if (totalPassenger < 1) {
|
||||||
totalPassenger = 1;
|
totalPassenger = 1;
|
||||||
|
totalDriver = 1;
|
||||||
update();
|
update();
|
||||||
if (totalDriver < .5) {
|
// if (totalDriver < .5) {
|
||||||
totalDriver = .75;
|
// totalDriver = .75;
|
||||||
totalME = .21;
|
// totalME = .21;
|
||||||
update();
|
// update();
|
||||||
} else {
|
// } else {
|
||||||
totalDriver = .90;
|
// totalDriver = .90;
|
||||||
totalME = .06;
|
// totalME = .06;
|
||||||
update();
|
// update();
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// buttomSheetMapPage();
|
// buttomSheetMapPage();
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/constant/box_name.dart';
|
||||||
|
import 'package:ride/constant/links.dart';
|
||||||
|
import 'package:ride/controller/functions/crud.dart';
|
||||||
|
import 'package:ride/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)});
|
||||||
|
|
||||||
|
archive = jsonDecode(res)['message'];
|
||||||
|
print(archive);
|
||||||
|
isLoading = false;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
getArchivePayment();
|
||||||
|
super.onInit();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,7 +23,7 @@ class PaymentController extends GetxController {
|
|||||||
bool isPromoSheetDialogue = false;
|
bool isPromoSheetDialogue = false;
|
||||||
final formKey = GlobalKey<FormState>();
|
final formKey = GlobalKey<FormState>();
|
||||||
final promo = TextEditingController();
|
final promo = TextEditingController();
|
||||||
double totalPassenger = MapPassengerController().totalPassenger;
|
double totalPassenger = Get.find<MapPassengerController>().totalPassenger;
|
||||||
int? selectedAmount = 0;
|
int? selectedAmount = 0;
|
||||||
List<dynamic> totalPassengerWalletDetails = [];
|
List<dynamic> totalPassengerWalletDetails = [];
|
||||||
String passengerTotalWalletAmount = '';
|
String passengerTotalWalletAmount = '';
|
||||||
|
|||||||
@@ -5,26 +5,12 @@ import '../../constant/colors.dart';
|
|||||||
|
|
||||||
ThemeData themeEnglish = ThemeData(
|
ThemeData themeEnglish = ThemeData(
|
||||||
fontFamily: "PlayfairDisplay",
|
fontFamily: "PlayfairDisplay",
|
||||||
textTheme: const TextTheme(
|
textTheme: TextTheme(
|
||||||
displaySmall: TextStyle(
|
displaySmall: AppStyle.title,
|
||||||
fontWeight: FontWeight.bold,
|
displayLarge: AppStyle.title,
|
||||||
fontSize: 24,
|
displayMedium: AppStyle.title,
|
||||||
color: AppColor.primaryColor),
|
bodyLarge: AppStyle.headTitle,
|
||||||
displayLarge: TextStyle(
|
bodyMedium: AppStyle.headTitle2),
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 22,
|
|
||||||
color: AppColor.primaryColor),
|
|
||||||
displayMedium: TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 26,
|
|
||||||
color: AppColor.primaryColor),
|
|
||||||
bodyLarge: TextStyle(
|
|
||||||
height: 2,
|
|
||||||
color: AppColor.accentColor,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 14),
|
|
||||||
bodyMedium:
|
|
||||||
TextStyle(height: 2, color: AppColor.accentColor, fontSize: 14)),
|
|
||||||
primarySwatch: Colors.blue,
|
primarySwatch: Colors.blue,
|
||||||
dialogTheme: DialogTheme(
|
dialogTheme: DialogTheme(
|
||||||
backgroundColor: AppColor.secondaryColor,
|
backgroundColor: AppColor.secondaryColor,
|
||||||
|
|||||||
@@ -76,10 +76,10 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
: '${'Your Ride Duration is '.tr} ${controller.minutes} m',
|
: '${'Your Ride Duration is '.tr} ${controller.minutes} m',
|
||||||
style: AppStyle.subtitle,
|
style: AppStyle.subtitle,
|
||||||
),
|
),
|
||||||
Text(
|
// Text(
|
||||||
'${'You will be thier in'.tr} ${DateFormat('h:mm a').format(controller.newTime)}',
|
// '${'You will be thier in'.tr} ${DateFormat('h:mm a').format(controller.newTime)}',
|
||||||
style: AppStyle.subtitle,
|
// style: AppStyle.subtitle,
|
||||||
),
|
// ),
|
||||||
Text(
|
Text(
|
||||||
'${'Your trip distance is'.tr} ${controller.distance.toStringAsFixed(2)} KM',
|
'${'Your trip distance is'.tr} ${controller.distance.toStringAsFixed(2)} KM',
|
||||||
style: AppStyle.subtitle,
|
style: AppStyle.subtitle,
|
||||||
@@ -96,10 +96,22 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
crossAxisAlignment:
|
crossAxisAlignment:
|
||||||
CrossAxisAlignment.center,
|
CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Container(
|
||||||
|
width: Get.width * .14,
|
||||||
|
height: Get.height * .06,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.secondaryColor,
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
border: Border.all(
|
||||||
|
width: 2,
|
||||||
|
color: AppColor.greenColor)),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
'${'Fee is'.tr} \n${controller.totalPassenger.toStringAsFixed(2)}',
|
'${'Fee is'.tr} \n${controller.totalPassenger.toStringAsFixed(2)}',
|
||||||
style: AppStyle.subtitle,
|
style: AppStyle.subtitle,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
controller.promoTaken
|
controller.promoTaken
|
||||||
? const Icon(
|
? const Icon(
|
||||||
Icons.filter_vintage_rounded,
|
Icons.filter_vintage_rounded,
|
||||||
@@ -205,7 +217,8 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
onTap: () async {
|
onTap: () async {
|
||||||
controller
|
controller
|
||||||
.changeCashConfirmPageShown();
|
.changeCashConfirmPageShown();
|
||||||
PaymentController()
|
Get.find<
|
||||||
|
PaymentController>()
|
||||||
.getPassengerWallet();
|
.getPassengerWallet();
|
||||||
},
|
},
|
||||||
child: GetBuilder<
|
child: GetBuilder<
|
||||||
@@ -337,80 +350,6 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
|||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.center,
|
MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
// TextButton(
|
|
||||||
// onPressed: () {
|
|
||||||
// Get.defaultDialog(
|
|
||||||
// barrierDismissible: false,
|
|
||||||
// title:
|
|
||||||
// 'How Many Passengers?'.tr,
|
|
||||||
// titleStyle: AppStyle.title,
|
|
||||||
// content: Column(
|
|
||||||
// children: [
|
|
||||||
// Text(
|
|
||||||
// 'Allowed up to 4 Passengers.'
|
|
||||||
// .tr,
|
|
||||||
// style: AppStyle.title,
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height:
|
|
||||||
// 200, // Set the desired height here
|
|
||||||
// child: CupertinoPicker(
|
|
||||||
// itemExtent: 32,
|
|
||||||
// onSelectedItemChanged:
|
|
||||||
// (index) {
|
|
||||||
// controller
|
|
||||||
// .onChangedPassengerCount(
|
|
||||||
// index + 1);
|
|
||||||
// },
|
|
||||||
// children: [
|
|
||||||
// Text(
|
|
||||||
// '1 Passenger'.tr),
|
|
||||||
// Text('2 Passengers'
|
|
||||||
// .tr),
|
|
||||||
// Text('3 Passengers'
|
|
||||||
// .tr),
|
|
||||||
// Text('4 Passengers'
|
|
||||||
// .tr),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// MyElevatedButton(
|
|
||||||
// title: 'Back',
|
|
||||||
// onPressed: () =>
|
|
||||||
// Get.back(),
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// child: Row(
|
|
||||||
// mainAxisAlignment:
|
|
||||||
// MainAxisAlignment
|
|
||||||
// .spaceBetween,
|
|
||||||
// children: [
|
|
||||||
// Text('How Many Passengers?'.tr,
|
|
||||||
// style: AppStyle.title),
|
|
||||||
// const SizedBox(
|
|
||||||
// width: 10,
|
|
||||||
// ),
|
|
||||||
// Container(
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// border: Border.all()),
|
|
||||||
// child: Padding(
|
|
||||||
// padding:
|
|
||||||
// const EdgeInsets.all(
|
|
||||||
// 3.0),
|
|
||||||
// child: Text(
|
|
||||||
// controller
|
|
||||||
// .selectedPassengerCount
|
|
||||||
// .toString(),
|
|
||||||
// style: AppStyle.title),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
|
|
||||||
controller.isCashSelectedBeforeConfirmRide ==
|
controller.isCashSelectedBeforeConfirmRide ==
|
||||||
false
|
false
|
||||||
? MyElevatedButton(
|
? MyElevatedButton(
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import '../../../controller/home/map_passenger_controller.dart';
|
|||||||
import '../../../controller/payment/payment_controller.dart';
|
import '../../../controller/payment/payment_controller.dart';
|
||||||
import '../../../main.dart';
|
import '../../../main.dart';
|
||||||
import '../../widgets/elevated_btn.dart';
|
import '../../widgets/elevated_btn.dart';
|
||||||
import '../my_wallet/passenger_wallet_dialoge.dart';
|
|
||||||
|
|
||||||
class CashConfirmPageShown extends StatelessWidget {
|
class CashConfirmPageShown extends StatelessWidget {
|
||||||
CashConfirmPageShown({
|
CashConfirmPageShown({
|
||||||
@@ -70,7 +69,7 @@ class CashConfirmPageShown extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
// '${'Your Wallet balance is '.tr}JD ',
|
// '${'Your Wallet balance is '.tr}JD ',
|
||||||
'${'Your Wallet balance is '.tr} ${box.read(BoxName.passengerWalletTotal).toString()} JD',
|
'${'Your Wallet balance is '.tr} ${box.read(BoxName.passengerWalletTotal).toString()} \$',
|
||||||
style: AppStyle.subtitle,
|
style: AppStyle.subtitle,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -144,12 +143,23 @@ class CashConfirmPageShown extends StatelessWidget {
|
|||||||
double.parse(box
|
double.parse(box
|
||||||
.read(BoxName.passengerWalletTotal)) <
|
.read(BoxName.passengerWalletTotal)) <
|
||||||
controller.totalPassenger)
|
controller.totalPassenger)
|
||||||
? MyElevatedButton(
|
? Column(
|
||||||
|
children: [
|
||||||
|
MyElevatedButton(
|
||||||
title: 'To use Wallet charge it'.tr,
|
title: 'To use Wallet charge it'.tr,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.to(() => const PassengerWallet());
|
Get.to(() => const PassengerWallet());
|
||||||
},
|
},
|
||||||
kolor: AppColor.redColor,
|
kolor: AppColor.redColor,
|
||||||
|
),
|
||||||
|
MyElevatedButton(
|
||||||
|
title: 'Next'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
paymentController.isCashChecked = true;
|
||||||
|
controller.changeCashConfirmPageShown();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
)
|
)
|
||||||
: MyElevatedButton(
|
: MyElevatedButton(
|
||||||
title: 'Next'.tr,
|
title: 'Next'.tr,
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/views/home/my_wallet/payment_history_passenger_page.dart';
|
||||||
import '../../../constant/box_name.dart';
|
import '../../../constant/box_name.dart';
|
||||||
import '../../../constant/colors.dart';
|
import '../../../constant/colors.dart';
|
||||||
import '../../../constant/info.dart';
|
import '../../../constant/info.dart';
|
||||||
import '../../../constant/style.dart';
|
import '../../../constant/style.dart';
|
||||||
import '../../../controller/functions/secure_storage.dart';
|
|
||||||
import '../../../controller/functions/toast.dart';
|
|
||||||
import '../../../controller/home/payment/credit_card_controller.dart';
|
import '../../../controller/home/payment/credit_card_controller.dart';
|
||||||
import '../../../controller/payment/payment_controller.dart';
|
import '../../../controller/payment/payment_controller.dart';
|
||||||
import '../../../main.dart';
|
import '../../../main.dart';
|
||||||
@@ -28,154 +27,28 @@ class PassengerWallet extends StatelessWidget {
|
|||||||
body: [
|
body: [
|
||||||
GetBuilder<PaymentController>(
|
GetBuilder<PaymentController>(
|
||||||
builder: (controller) => Column(
|
builder: (controller) => Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Column(
|
const CardSeferWallet(),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||||
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Column(
|
MyElevatedButton(
|
||||||
children: [
|
kolor: AppColor.blueColor,
|
||||||
Row(
|
title: 'Payment History'.tr,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
onPressed: () {
|
||||||
children: [
|
Get.to(() => const PaymentHistoryPassengerPage(),
|
||||||
Container(
|
transition: Transition.size);
|
||||||
decoration: const BoxDecoration(
|
},
|
||||||
borderRadius:
|
),
|
||||||
BorderRadius.all(Radius.circular(12)),
|
],
|
||||||
color: AppColor.secondaryColor,
|
),
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: AppColor.accentColor,
|
|
||||||
offset: Offset(-1, -1),
|
|
||||||
blurRadius: 0,
|
|
||||||
spreadRadius: 0,
|
|
||||||
blurStyle: BlurStyle.normal),
|
|
||||||
BoxShadow(
|
|
||||||
color: AppColor.accentColor,
|
|
||||||
offset: Offset(3, 3),
|
|
||||||
blurRadius: 1,
|
|
||||||
spreadRadius: 0,
|
|
||||||
blurStyle: BlurStyle.normal)
|
|
||||||
]),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(10),
|
|
||||||
child:
|
|
||||||
box.read(BoxName.passengerWalletTotal) == null
|
|
||||||
? Text(
|
|
||||||
'${'You Dont Have Any amount in'.tr} ${AppInformation.appName}${'Wallet!'.tr}',
|
|
||||||
style: AppStyle.title,
|
|
||||||
)
|
)
|
||||||
: Text(
|
|
||||||
'${'You Have'.tr} ${box.read(BoxName.passengerWalletTotal).toString()} JD in ${AppInformation.appName} Wallet',
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 30,
|
|
||||||
),
|
|
||||||
const MyCreditCardWidget(),
|
|
||||||
const SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
// GetBuilder<CreditCardController>(
|
|
||||||
// builder: (creditCardController) => Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
// children: [
|
|
||||||
// MyElevatedButton(
|
|
||||||
// title: 'Save Credit Card'.tr,
|
|
||||||
// onPressed: () async {
|
|
||||||
// if (controller.formKey.currentState!
|
|
||||||
// .validate()) {
|
|
||||||
// SecureStorage().saveData(
|
|
||||||
// BoxName.cardNumber,
|
|
||||||
// creditCardController
|
|
||||||
// .cardNumberController.text);
|
|
||||||
// SecureStorage().saveData(
|
|
||||||
// BoxName.cardHolderName,
|
|
||||||
// creditCardController
|
|
||||||
// .cardHolderNameController.text);
|
|
||||||
// SecureStorage().saveData(
|
|
||||||
// BoxName.cvvCode,
|
|
||||||
// creditCardController
|
|
||||||
// .cvvCodeController.text);
|
|
||||||
// SecureStorage().saveData(
|
|
||||||
// BoxName.expiryDate,
|
|
||||||
// creditCardController
|
|
||||||
// .expiryDateController.text);
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// )),
|
|
||||||
// // MyElevatedButton(
|
|
||||||
// title: 'Charge your Wallet',
|
|
||||||
// onPressed: () {
|
|
||||||
// Get.defaultDialog(
|
|
||||||
// title: 'Choose amount you will Charge?'.tr,
|
|
||||||
// content: Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Radio(
|
|
||||||
// value: 10,
|
|
||||||
// groupValue: controller.selectedAmount,
|
|
||||||
// onChanged: (value) {
|
|
||||||
// controller.selectedAmount =
|
|
||||||
// value as String?;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// Text('10 and get 4% discount'.tr),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Radio(
|
|
||||||
// value: 20,
|
|
||||||
// groupValue: controller.selectedAmount,
|
|
||||||
// onChanged: (value) {
|
|
||||||
// controller.selectedAmount =
|
|
||||||
// value as String?;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// Text('20 and get 6% discount'.tr),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Radio(
|
|
||||||
// value: 40,
|
|
||||||
// groupValue: controller.selectedAmount,
|
|
||||||
// onChanged: (value) {
|
|
||||||
// controller.selectedAmount =
|
|
||||||
// value as String?;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// Text('40 and get 8% discount'.tr),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Radio(
|
|
||||||
// value: 100,
|
|
||||||
// groupValue: controller.selectedAmount,
|
|
||||||
// onChanged: (value) {
|
|
||||||
// controller.selectedAmount =
|
|
||||||
// value as String?;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// Text('100 and get 11% discount'.tr),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ));
|
|
||||||
// },
|
|
||||||
// )
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -187,11 +60,11 @@ class PassengerWallet extends StatelessWidget {
|
|||||||
: const SizedBox()),
|
: const SizedBox()),
|
||||||
GetBuilder<PaymentController>(
|
GetBuilder<PaymentController>(
|
||||||
builder: (controller) => Positioned(
|
builder: (controller) => Positioned(
|
||||||
bottom: Get.height * .3,
|
bottom: Get.height * .2,
|
||||||
left: Get.width * .3,
|
left: Get.width * .2,
|
||||||
right: Get.width * .3,
|
right: Get.width * .2,
|
||||||
child: MyElevatedButton(
|
child: MyElevatedButton(
|
||||||
title: 'Show Promos'.tr,
|
title: 'Show Promos to Charge'.tr,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
controller.changePromoSheetDialogue();
|
controller.changePromoSheetDialogue();
|
||||||
},
|
},
|
||||||
@@ -202,3 +75,60 @@ class PassengerWallet extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class CardSeferWallet extends StatelessWidget {
|
||||||
|
const CardSeferWallet({
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: Get.width * .85,
|
||||||
|
height: Get.height * .3,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.deepPurpleAccent,
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||||
|
gradient: const LinearGradient(
|
||||||
|
colors: [AppColor.blueColor, AppColor.primaryColor]),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'${AppInformation.appName} Wallet',
|
||||||
|
style: AppStyle.headTitle
|
||||||
|
.copyWith(color: AppColor.primaryColor),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'${box.read(BoxName.passengerWalletTotal)} \$' ?? '0.0 \$',
|
||||||
|
style: AppStyle.headTitle2,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
box.read(BoxName.name),
|
||||||
|
style: AppStyle.title,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ class PassengerWalletDialoge extends StatelessWidget {
|
|||||||
)),
|
)),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
MyElevatedButton(
|
MyElevatedButton(
|
||||||
|
kolor: AppColor.blueColor,
|
||||||
title: 'Pay with Your PayPal'.tr,
|
title: 'Pay with Your PayPal'.tr,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (controller.selectedAmount != 0) {
|
if (controller.selectedAmount != 0) {
|
||||||
|
|||||||
53
lib/views/home/my_wallet/payment_history_passenger_page.dart
Normal file
53
lib/views/home/my_wallet/payment_history_passenger_page.dart
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/constant/colors.dart';
|
||||||
|
import 'package:ride/constant/style.dart';
|
||||||
|
import 'package:ride/controller/payment/passenger_wallet_history_controller.dart';
|
||||||
|
import 'package:ride/views/widgets/my_scafold.dart';
|
||||||
|
import 'package:ride/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()
|
||||||
|
: 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user