12/3/1
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
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/auth/captin/history_captain.dart';
|
||||
import 'package:ride/views/home/Captin/history/history_details_page.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
import 'package:ride/views/widgets/mycircular.dart';
|
||||
|
||||
import '../../../../constant/colors.dart';
|
||||
import '../../../../constant/style.dart';
|
||||
import '../../../../controller/auth/captin/history_captain.dart';
|
||||
import '../../../widgets/elevated_btn.dart';
|
||||
import '../../../widgets/my_scafold.dart';
|
||||
import '../../../widgets/mycircular.dart';
|
||||
|
||||
class HistoryCaptain extends StatelessWidget {
|
||||
const HistoryCaptain({super.key});
|
||||
|
||||
@@ -41,7 +41,7 @@ class DrawerCaptain extends StatelessWidget {
|
||||
title: const Text('Wallet'),
|
||||
onTap: () {
|
||||
// Handle wallet item tap
|
||||
Get.to(() => const WaletCaptain(), transition: Transition.native);
|
||||
Get.to(() => WaletCaptain(), transition: Transition.native);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
@@ -76,7 +76,7 @@ class DrawerCaptain extends StatelessWidget {
|
||||
title: const Text('Helping Center'),
|
||||
onTap: () {
|
||||
// Handle helping center item tap
|
||||
Get.to(() => const HelpCaptain(), transition: Transition.size);
|
||||
Get.to(() => HelpCaptain(), transition: Transition.size);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
|
||||
@@ -1,15 +1,155 @@
|
||||
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/home/captin/help/help_controller.dart';
|
||||
import 'package:ride/views/home/Captin/home_captain/help_details_replay_page.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
|
||||
import '../../../widgets/elevated_btn.dart';
|
||||
import '../../../widgets/mycircular.dart';
|
||||
|
||||
class HelpCaptain extends StatelessWidget {
|
||||
const HelpCaptain({super.key});
|
||||
HelpCaptain({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(HelpController());
|
||||
return MyScafolld(
|
||||
title: 'Helping Page'.tr,
|
||||
body: [],
|
||||
body: [
|
||||
Positioned(
|
||||
top: Get.height * .025,
|
||||
right: 20,
|
||||
left: 20,
|
||||
child: Card(
|
||||
color: AppColor.yellowColor,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'If you need any help or have question this is right site to do that and your welcome'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: Get.height * .15,
|
||||
right: 20,
|
||||
left: 20,
|
||||
child: Card(
|
||||
elevation: 3,
|
||||
color: AppColor.secondaryColor,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: GetBuilder<HelpController>(
|
||||
builder: (helpController) => Form(
|
||||
key: helpController.formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
TextFormField(
|
||||
controller: helpController.helpQuestionController,
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
hintText: 'Enter your Question here',
|
||||
labelText: 'Question',
|
||||
),
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Please enter your Question.';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
helpController.isLoading
|
||||
? const MyCircularProgressIndicator()
|
||||
: MyElevatedButton(
|
||||
onPressed: () {
|
||||
if (helpController.formKey.currentState!
|
||||
.validate()) {
|
||||
helpController.addHelpQuestion();
|
||||
|
||||
// Clear the feedback form
|
||||
helpController.formKey.currentState!
|
||||
.reset();
|
||||
}
|
||||
},
|
||||
title: 'Submit Question'.tr,
|
||||
),
|
||||
],
|
||||
)),
|
||||
),
|
||||
)),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 3,
|
||||
right: 8,
|
||||
left: 8,
|
||||
child: GetBuilder<HelpController>(
|
||||
builder: (helpController) => Container(
|
||||
height: Get.height * .63,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: ListView.builder(
|
||||
itemCount:
|
||||
helpController.helpQuestionDate['message'].length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var list =
|
||||
helpController.helpQuestionDate['message'][index];
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(3),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: AppColor.greenColor,
|
||||
width: 3,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(11)),
|
||||
// elevation: 3,
|
||||
// color: AppColor.greenColor,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
print(list['id']);
|
||||
helpController.getindex(
|
||||
list['id'], list['helpQuestion']);
|
||||
helpController
|
||||
.getHelpRepley(list['id'].toString());
|
||||
Get.to(
|
||||
() => const HelpDetailsReplayPage(),
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(2),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .6,
|
||||
child: Text(
|
||||
list['helpQuestion'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .3,
|
||||
child: Text(
|
||||
list['datecreated'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)),
|
||||
)
|
||||
],
|
||||
isleading: true,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
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/views/widgets/mycircular.dart';
|
||||
|
||||
import '../../../../controller/home/captin/help/help_controller.dart';
|
||||
import '../../../widgets/my_scafold.dart';
|
||||
|
||||
class HelpDetailsReplayPage extends StatelessWidget {
|
||||
const HelpDetailsReplayPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.find<HelpController>();
|
||||
return GetBuilder<HelpController>(
|
||||
builder: (helpController) => MyScafolld(
|
||||
title: 'Help Details'.tr,
|
||||
body: [
|
||||
helpController.isLoading
|
||||
? const MyCircularProgressIndicator()
|
||||
: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Card(
|
||||
elevation: 3,
|
||||
child: Container(
|
||||
width: Get.width * .66,
|
||||
color: Colors.transparent,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
helpController.qustion,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Card(
|
||||
elevation: 3,
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
width: Get.width * .66,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: helpController.status ==
|
||||
'not yet' ||
|
||||
helpController
|
||||
.helpQuestionRepleyDate[
|
||||
'message']['replay']
|
||||
.toString() ==
|
||||
'not yet'
|
||||
? Text(
|
||||
'No Response yet.'.tr,
|
||||
style: AppStyle.title,
|
||||
)
|
||||
: Text(
|
||||
helpController
|
||||
.helpQuestionRepleyDate[
|
||||
'message']['replay']
|
||||
.toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
]),
|
||||
],
|
||||
)
|
||||
],
|
||||
isleading: true,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,6 @@ import '../../../../controller/home/captin/widget/connect.dart';
|
||||
import '../../../../controller/home/captin/widget/left_menu_map_captain.dart';
|
||||
import '../../../../main.dart';
|
||||
import '../../../widgets/circle_container.dart';
|
||||
import '../../../widgets/elevated_btn.dart';
|
||||
import '../text_scanner.dart';
|
||||
|
||||
class HomeCaptain extends StatelessWidget {
|
||||
HomeCaptain({super.key});
|
||||
|
||||
@@ -24,7 +24,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
? Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
bottom: 6,
|
||||
bottom: 50,
|
||||
left: 8,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
@@ -37,33 +37,35 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
DefaultTextStyle(
|
||||
style: AppStyle.title,
|
||||
child: AnimatedTextKit(
|
||||
animatedTexts: [
|
||||
ScaleAnimatedText(
|
||||
'Go to passenger Location now'.tr,
|
||||
),
|
||||
WavyAnimatedText(
|
||||
'Go to passenger Location now'.tr),
|
||||
FlickerAnimatedText(
|
||||
'Go to passenger Location now'.tr),
|
||||
WavyAnimatedText(
|
||||
'Go to passenger Location now'.tr),
|
||||
],
|
||||
isRepeatingAnimation: true,
|
||||
onTap: () {
|
||||
// print("Tap Event");
|
||||
},
|
||||
),
|
||||
),
|
||||
style: AppStyle.title,
|
||||
child: Text(
|
||||
'Go to passenger Location now'.tr,
|
||||
style: AppStyle.title
|
||||
.copyWith(color: AppColor.greenColor),
|
||||
)
|
||||
// AnimatedTextKit(
|
||||
// animatedTexts: [
|
||||
// ScaleAnimatedText(
|
||||
// 'Go to passenger Location now'.tr,
|
||||
// ),
|
||||
// WavyAnimatedText(
|
||||
// 'Go to passenger Location now'.tr),
|
||||
// FlickerAnimatedText(
|
||||
// 'Go to passenger Location now'.tr),
|
||||
// WavyAnimatedText(
|
||||
// 'Go to passenger Location now'.tr),
|
||||
// ],
|
||||
// isRepeatingAnimation: true,
|
||||
// onTap: () {
|
||||
// // print("Tap Event");
|
||||
// },
|
||||
// ),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text('Duration of the Ride is '.tr,
|
||||
style: AppStyle.title),
|
||||
Text(
|
||||
controller.duration.toString() +
|
||||
' ' +
|
||||
'Minute'.tr,
|
||||
Text('${controller.duration} ${'Minute'.tr}',
|
||||
style: AppStyle.title),
|
||||
],
|
||||
),
|
||||
@@ -72,7 +74,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
Text('Distance of the Ride is '.tr,
|
||||
style: AppStyle.title),
|
||||
Text(
|
||||
controller.distance.toString() + ' ' + 'KM'.tr,
|
||||
'${controller.distance} ${'KM'.tr}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
@@ -107,8 +109,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
launchCommunication(
|
||||
'whatsapp',
|
||||
controller.phone.toString(),
|
||||
'Hello this is Captain'.tr +
|
||||
' ${box.read(BoxName.nameDriver)}');
|
||||
'${'Hello this is Captain'.tr} ${box.read(BoxName.nameDriver)}');
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.whatshot,
|
||||
@@ -119,8 +120,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
launchCommunication(
|
||||
'sms',
|
||||
controller.phone.toString(),
|
||||
'Hello this is Captain'.tr +
|
||||
' ${box.read(BoxName.nameDriver)}');
|
||||
'${'Hello this is Captain'.tr} ${box.read(BoxName.nameDriver)}');
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.sms_rounded,
|
||||
@@ -131,8 +131,7 @@ class PassengerInfoWindow extends StatelessWidget {
|
||||
launchCommunication(
|
||||
'email',
|
||||
controller.phone.toString(),
|
||||
'Hello this is Captain'.tr +
|
||||
' ${box.read(BoxName.nameDriver)}');
|
||||
'${'Hello this is Captain'.tr} ${box.read(BoxName.nameDriver)}');
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.email,
|
||||
|
||||
@@ -204,7 +204,8 @@ class OrderRequestPage extends StatelessWidget {
|
||||
'driverId': myList[18].toString(),
|
||||
'durationOfRideValue': myList[19].toString(),
|
||||
'paymentAmount': myList[3].toString(),
|
||||
'paymentMethod': myList[13].toString(),
|
||||
'paymentMethod':
|
||||
myList[13].toString() == 'true' ? 'visa' : 'cash'
|
||||
});
|
||||
},
|
||||
),
|
||||
|
||||
@@ -39,7 +39,7 @@ class MapPagePassenger extends StatelessWidget {
|
||||
buttomSheetMapPage(),
|
||||
hexagonClipper(),
|
||||
const CancelRidePageShow(),
|
||||
const CashConfirmPageShown(),
|
||||
CashConfirmPageShown(),
|
||||
const PaymentMethodPage(),
|
||||
timerForCancelTripFromPassenger(),
|
||||
// const DriverTimeArrivePassengerPage(),
|
||||
|
||||
@@ -334,81 +334,82 @@ GetBuilder<MapPassengerController> buttomSheetMapPage() {
|
||||
width: Get.width * .95,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
MainAxisAlignment.center,
|
||||
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),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// 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 ==
|
||||
false
|
||||
? MyElevatedButton(
|
||||
|
||||
@@ -2,17 +2,20 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/box_name.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/views/home/my_wallet/passenger_wallet.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../../../controller/payment/payment_controller.dart';
|
||||
import '../../../main.dart';
|
||||
import '../../widgets/elevated_btn.dart';
|
||||
import '../my_wallet/passenger_wallet_dialoge.dart';
|
||||
|
||||
class CashConfirmPageShown extends StatelessWidget {
|
||||
const CashConfirmPageShown({
|
||||
CashConfirmPageShown({
|
||||
super.key,
|
||||
});
|
||||
|
||||
PaymentController paymentController = Get.put(PaymentController());
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MapPassengerController>(
|
||||
@@ -39,11 +42,11 @@ class CashConfirmPageShown extends StatelessWidget {
|
||||
'Payment Method'.tr,
|
||||
style: AppStyle.title.copyWith(fontSize: 22),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () =>
|
||||
controller.changeCashConfirmPageShown(),
|
||||
icon: const Icon(Icons.close),
|
||||
),
|
||||
// IconButton(
|
||||
// onPressed: () =>
|
||||
// controller.changeCashConfirmPageShown(),
|
||||
// icon: const Icon(Icons.close),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
GetBuilder<PaymentController>(
|
||||
@@ -123,16 +126,38 @@ class CashConfirmPageShown extends StatelessWidget {
|
||||
height: 2,
|
||||
indent: 1,
|
||||
),
|
||||
// controller.cardNumber == null ||
|
||||
// controller.cardNumber!.isEmpty
|
||||
// ? MyElevatedButton(
|
||||
// title: 'Add Payment Method'.tr,
|
||||
// onPressed: () {
|
||||
// controller.changePaymentMethodPageShown();
|
||||
// CreditCardController().openPayment();
|
||||
// },
|
||||
// )
|
||||
// : const SizedBox()
|
||||
// GetBuilder<PaymentController>(
|
||||
// builder: (paymentController) =>
|
||||
// (paymentController.isWalletChecked == false &&
|
||||
// paymentController.isCashChecked == true
|
||||
// ? MyElevatedButton(
|
||||
// title: 'Next'.tr,
|
||||
// onPressed: () {
|
||||
// controller.changeCashConfirmPageShown();
|
||||
// },
|
||||
// )
|
||||
// : const SizedBox())),
|
||||
GetBuilder<PaymentController>(
|
||||
builder: (paymentController) => (box
|
||||
.read(BoxName.passengerWalletTotal) ==
|
||||
null ||
|
||||
double.parse(box
|
||||
.read(BoxName.passengerWalletTotal)) <
|
||||
controller.totalPassenger)
|
||||
? MyElevatedButton(
|
||||
title: 'To use Wallet charge it'.tr,
|
||||
onPressed: () {
|
||||
Get.to(() => const PassengerWallet());
|
||||
},
|
||||
kolor: AppColor.redColor,
|
||||
)
|
||||
: MyElevatedButton(
|
||||
title: 'Next'.tr,
|
||||
onPressed: () {
|
||||
controller.changeCashConfirmPageShown();
|
||||
},
|
||||
), // Add a fallback widget if none of the conditions are met
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:get/get.dart';
|
||||
import 'package:ride/constant/box_name.dart';
|
||||
import 'package:ride/controller/functions/secure_storage.dart';
|
||||
import 'package:ride/controller/home/payment/credit_card_controller.dart';
|
||||
import 'package:ride/main.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
@@ -76,7 +77,7 @@ class PaymentMethodPage extends StatelessWidget {
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
const CreditCardWidget(),
|
||||
const MyCreditCardWidget(),
|
||||
const Spacer(),
|
||||
GetBuilder<CreditCardController>(
|
||||
builder: (controller) => Row(
|
||||
@@ -115,8 +116,8 @@ class PaymentMethodPage extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class CreditCardWidget extends StatelessWidget {
|
||||
const CreditCardWidget({
|
||||
class MyCreditCardWidget extends StatelessWidget {
|
||||
const MyCreditCardWidget({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@@ -125,11 +126,20 @@ class CreditCardWidget extends StatelessWidget {
|
||||
Get.put(CreditCardController());
|
||||
return GetBuilder<CreditCardController>(
|
||||
builder: (controller) => Container(
|
||||
height: Get.height * .3,
|
||||
height: Get.height * .35,
|
||||
width: Get.width * .9,
|
||||
decoration: const BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
borderRadius: BorderRadius.all(Radius.circular(15)),
|
||||
gradient: LinearGradient(colors: [
|
||||
AppColor.secondaryColor,
|
||||
// AppColor.blueColor,
|
||||
// AppColor.greenColor,
|
||||
AppColor.accentColor,
|
||||
// AppColor.primaryColor,
|
||||
// AppColor.redColor,
|
||||
// AppColor.yellowColor
|
||||
]),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
spreadRadius: 3,
|
||||
@@ -148,7 +158,7 @@ class CreditCardWidget extends StatelessWidget {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
child: Row(
|
||||
@@ -156,22 +166,33 @@ class CreditCardWidget extends StatelessWidget {
|
||||
getCardIcon(controller.cardNumberController
|
||||
.text), // Dynamic credit card icon
|
||||
SizedBox(
|
||||
width: Get.width * .1,
|
||||
width: Get.width * .03,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .6,
|
||||
width: Get.width * .25,
|
||||
child: Text(
|
||||
'Card Number',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .03,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .4,
|
||||
height: 70,
|
||||
child: TextFormField(
|
||||
maxLength: 16,
|
||||
keyboardType: TextInputType.number,
|
||||
controller: controller.cardNumberController,
|
||||
style: const TextStyle(
|
||||
color: AppColor.blueColor,
|
||||
fontFamily: 'digital-counter-7',
|
||||
fontWeight: FontWeight.bold),
|
||||
decoration: const InputDecoration(
|
||||
helperStyle: TextStyle(
|
||||
fontFamily: 'digital-counter-7'),
|
||||
labelText: 'Card Number',
|
||||
// labelText: 'Card Number',
|
||||
),
|
||||
inputFormatters: [DigitObscuringFormatter()],
|
||||
validator: (value) {
|
||||
@@ -190,19 +211,30 @@ class CreditCardWidget extends StatelessWidget {
|
||||
children: [
|
||||
const Icon(Icons.person),
|
||||
SizedBox(
|
||||
width: Get.width * .1,
|
||||
width: Get.width * .03,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .6,
|
||||
width: Get.width * .25,
|
||||
child: Text(
|
||||
'Holder Name',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .03,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .3,
|
||||
child: SizedBox(
|
||||
height: 50,
|
||||
// height: 50,
|
||||
child: TextFormField(
|
||||
style: AppStyle.title,
|
||||
keyboardType: TextInputType.text,
|
||||
// maxLength: 16,
|
||||
controller: controller.cardHolderNameController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Cardholder Name'),
|
||||
// labelText: 'Cardholder Name',
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please enter the cardholder name'
|
||||
@@ -224,28 +256,40 @@ class CreditCardWidget extends StatelessWidget {
|
||||
children: [
|
||||
const Icon(Icons.date_range_outlined),
|
||||
SizedBox(
|
||||
width: Get.width * .1,
|
||||
width: Get.width * .03,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .2,
|
||||
child: SizedBox(
|
||||
height: 60,
|
||||
child: TextFormField(
|
||||
keyboardType: TextInputType.datetime,
|
||||
controller:
|
||||
controller.expiryDateController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Expiry Date'),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please enter the expiry date'
|
||||
.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .2,
|
||||
child: Text(
|
||||
'Expiry Date',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
SizedBox(
|
||||
width: Get.width * .1,
|
||||
child: SizedBox(
|
||||
height: 60,
|
||||
child: TextFormField(
|
||||
maxLength: 4,
|
||||
keyboardType: TextInputType.datetime,
|
||||
controller:
|
||||
controller.expiryDateController,
|
||||
style: AppStyle.title,
|
||||
decoration: const InputDecoration(),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please enter the expiry date'
|
||||
.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -257,50 +301,76 @@ class CreditCardWidget extends StatelessWidget {
|
||||
SizedBox(
|
||||
width: Get.width * .021,
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .2,
|
||||
child: SizedBox(
|
||||
height: 60,
|
||||
child: TextFormField(
|
||||
obscureText: true,
|
||||
keyboardType: TextInputType.number,
|
||||
style: const TextStyle(
|
||||
fontFamily: 'digital-counter-7'),
|
||||
maxLength: 3,
|
||||
controller: controller.cvvCodeController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'CVV Code'),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty &&
|
||||
value.length != 3) {
|
||||
return 'Please enter the CVV code'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .2,
|
||||
child: Text(
|
||||
'CVV Code',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .2,
|
||||
child: SizedBox(
|
||||
height: 60,
|
||||
child: TextFormField(
|
||||
obscureText: true,
|
||||
keyboardType: TextInputType.number,
|
||||
style: const TextStyle(
|
||||
color: AppColor.primaryColor,
|
||||
fontFamily: 'digital-counter-7'),
|
||||
maxLength: 3,
|
||||
controller:
|
||||
controller.cvvCodeController,
|
||||
decoration: const InputDecoration(
|
||||
// labelText: 'CVV Code',
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty &&
|
||||
value.length != 3) {
|
||||
return 'Please enter the CVV code'
|
||||
.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// MyElevatedButton(
|
||||
// title: 'Save'.tr,
|
||||
// onPressed: () {
|
||||
// if (controller.formKey.currentState!.validate()) {
|
||||
// final creditCard = CreditCardModel(
|
||||
// cardNumber: controller.cardNumberController.text,
|
||||
// cardHolderName:
|
||||
// controller.cardHolderNameController.text,
|
||||
// expiryDate: controller.expiryDateController.text,
|
||||
// cvvCode: controller.cvvCodeController.text,
|
||||
// );
|
||||
// // Process the credit card details
|
||||
// // You can use GetX to handle the logic here
|
||||
// }
|
||||
// },
|
||||
// ),
|
||||
MyElevatedButton(
|
||||
title: 'Save'.tr,
|
||||
onPressed: () {
|
||||
if (controller.formKey.currentState!.validate()) {
|
||||
// final creditCard = CreditCardModel(
|
||||
// cardNumber: controller.cardNumberController.text,
|
||||
// cardHolderName:
|
||||
// controller.cardHolderNameController.text,
|
||||
// expiryDate: controller.expiryDateController.text,
|
||||
// cvvCode: controller.cvvCodeController.text,
|
||||
// );
|
||||
// Process the credit card details
|
||||
// You can use GetX to handle the logic here
|
||||
|
||||
if (controller.formKey.currentState!.validate()) {
|
||||
SecureStorage().saveData(BoxName.cardNumber,
|
||||
controller.cardNumberController.text);
|
||||
SecureStorage().saveData(BoxName.cardHolderName,
|
||||
controller.cardHolderNameController.text);
|
||||
SecureStorage().saveData(BoxName.cvvCode,
|
||||
controller.cvvCodeController.text);
|
||||
SecureStorage().saveData(BoxName.expiryDate,
|
||||
controller.expiryDateController.text);
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
))));
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ride/constant/links.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/controller/functions/crud.dart';
|
||||
import 'package:ride/controller/functions/toast.dart';
|
||||
import 'package:ride/controller/payment/payment_controller.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
import 'package:flutter_paypal/flutter_paypal.dart';
|
||||
import '../../../constant/box_name.dart';
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/info.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/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 {
|
||||
const PassengerWallet({super.key});
|
||||
@@ -62,14 +60,11 @@ class PassengerWallet extends StatelessWidget {
|
||||
child:
|
||||
box.read(BoxName.passengerWalletTotal) == null
|
||||
? Text(
|
||||
'You Dont Have Any amount in'.tr +
|
||||
' ${AppInformation.appName}' +
|
||||
'Wallet!'.tr,
|
||||
'${'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',
|
||||
'${'You Have'.tr} ${box.read(BoxName.passengerWalletTotal).toString()} JD in ${AppInformation.appName} Wallet',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
@@ -79,7 +74,7 @@ class PassengerWallet extends StatelessWidget {
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
const CreditCardWidget(),
|
||||
const MyCreditCardWidget(),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
@@ -202,158 +197,7 @@ class PassengerWallet extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
)),
|
||||
GetBuilder<PaymentController>(
|
||||
builder: (controller) => Positioned(
|
||||
top: Get.height * .2,
|
||||
right: Get.width * .15,
|
||||
left: Get.width * .15,
|
||||
bottom: Get.height * .2,
|
||||
child: controller.isPromoSheetDialogue
|
||||
? Container(
|
||||
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(6),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
controller.updateSelectedAmount(10);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Radio(
|
||||
value: 10,
|
||||
groupValue: controller.selectedAmount,
|
||||
onChanged: (value) {
|
||||
controller
|
||||
.updateSelectedAmount(value as int);
|
||||
},
|
||||
),
|
||||
Text(
|
||||
'10 and get 4% discount'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
controller.updateSelectedAmount(20);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Radio(
|
||||
value: 20,
|
||||
groupValue: controller.selectedAmount,
|
||||
onChanged: (value) {
|
||||
controller
|
||||
.updateSelectedAmount(value as int);
|
||||
},
|
||||
),
|
||||
Text(
|
||||
'20 and get 6% discount'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
)),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
controller.updateSelectedAmount(40);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Radio(
|
||||
value: 40,
|
||||
groupValue: controller.selectedAmount,
|
||||
onChanged: (value) {
|
||||
controller
|
||||
.updateSelectedAmount(value as int);
|
||||
},
|
||||
),
|
||||
Text(
|
||||
'40 and get 8% discount'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
)),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
controller.updateSelectedAmount(100);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Radio(
|
||||
value: 100,
|
||||
groupValue: controller.selectedAmount,
|
||||
onChanged: (value) {
|
||||
controller
|
||||
.updateSelectedAmount(value as int);
|
||||
},
|
||||
),
|
||||
Text(
|
||||
'100 and get 11% discount'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
)),
|
||||
const Spacer(),
|
||||
MyElevatedButton(
|
||||
title: 'Pay with Your PayPal'.tr,
|
||||
onPressed: () {
|
||||
if (controller.selectedAmount != 0) {
|
||||
controller.makePaymentPayPal(context);
|
||||
} else {
|
||||
Toast.show(
|
||||
context,
|
||||
'You will choose one of above !'.tr,
|
||||
AppColor.redColor);
|
||||
}
|
||||
},
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Pay with Credit Card'.tr,
|
||||
onPressed: () {
|
||||
if (controller.selectedAmount != 0) {
|
||||
controller.makePaymentStripe(
|
||||
controller.selectedAmount as int,
|
||||
'USD',
|
||||
() => Get.snackbar('Hi', ''));
|
||||
} else {
|
||||
Toast.show(
|
||||
context,
|
||||
'You will choose one of above !'.tr,
|
||||
AppColor.redColor);
|
||||
}
|
||||
}),
|
||||
MyElevatedButton(
|
||||
title: 'Cancel'.tr,
|
||||
kolor: AppColor.redColor,
|
||||
onPressed: () {
|
||||
controller.changePromoSheetDialogue();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
))
|
||||
: const SizedBox()),
|
||||
)
|
||||
PassengerWalletDialoge()
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
168
lib/views/home/my_wallet/passenger_wallet_dialoge.dart
Normal file
168
lib/views/home/my_wallet/passenger_wallet_dialoge.dart
Normal file
@@ -0,0 +1,168 @@
|
||||
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/functions/toast.dart';
|
||||
import 'package:ride/controller/payment/payment_controller.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
|
||||
class PassengerWalletDialoge extends StatelessWidget {
|
||||
const PassengerWalletDialoge({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<PaymentController>(
|
||||
builder: (controller) => Positioned(
|
||||
top: Get.height * .2,
|
||||
right: Get.width * .15,
|
||||
left: Get.width * .15,
|
||||
bottom: Get.height * .2,
|
||||
child: controller.isPromoSheetDialogue
|
||||
? Container(
|
||||
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(6),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
controller.updateSelectedAmount(10);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Radio(
|
||||
value: 10,
|
||||
groupValue: controller.selectedAmount,
|
||||
onChanged: (value) {
|
||||
controller.updateSelectedAmount(value as int);
|
||||
},
|
||||
),
|
||||
Text(
|
||||
'10 and get 4% discount'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
controller.updateSelectedAmount(20);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Radio(
|
||||
value: 20,
|
||||
groupValue: controller.selectedAmount,
|
||||
onChanged: (value) {
|
||||
controller
|
||||
.updateSelectedAmount(value as int);
|
||||
},
|
||||
),
|
||||
Text(
|
||||
'20 and get 6% discount'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
)),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
controller.updateSelectedAmount(40);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Radio(
|
||||
value: 40,
|
||||
groupValue: controller.selectedAmount,
|
||||
onChanged: (value) {
|
||||
controller
|
||||
.updateSelectedAmount(value as int);
|
||||
},
|
||||
),
|
||||
Text(
|
||||
'40 and get 8% discount'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
)),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
controller.updateSelectedAmount(100);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Radio(
|
||||
value: 100,
|
||||
groupValue: controller.selectedAmount,
|
||||
onChanged: (value) {
|
||||
controller
|
||||
.updateSelectedAmount(value as int);
|
||||
},
|
||||
),
|
||||
Text(
|
||||
'100 and get 11% discount'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
)),
|
||||
const Spacer(),
|
||||
MyElevatedButton(
|
||||
title: 'Pay with Your PayPal'.tr,
|
||||
onPressed: () {
|
||||
if (controller.selectedAmount != 0) {
|
||||
controller.makePaymentPayPal(context);
|
||||
} else {
|
||||
Toast.show(
|
||||
context,
|
||||
'You will choose one of above !'.tr,
|
||||
AppColor.redColor);
|
||||
}
|
||||
},
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Pay with Credit Card'.tr,
|
||||
onPressed: () {
|
||||
if (controller.selectedAmount != 0) {
|
||||
controller.makePaymentStripe(
|
||||
controller.selectedAmount as int,
|
||||
'USD',
|
||||
() => controller.addPassengerWallet());
|
||||
} else {
|
||||
Toast.show(
|
||||
context,
|
||||
'You will choose one of above !'.tr,
|
||||
AppColor.redColor);
|
||||
}
|
||||
}),
|
||||
MyElevatedButton(
|
||||
title: 'Cancel'.tr,
|
||||
kolor: AppColor.redColor,
|
||||
onPressed: () {
|
||||
controller.changePromoSheetDialogue();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
))
|
||||
: const SizedBox()),
|
||||
);
|
||||
}
|
||||
}
|
||||
58
lib/views/home/my_wallet/points_captain.dart
Normal file
58
lib/views/home/my_wallet/points_captain.dart
Normal file
@@ -0,0 +1,58 @@
|
||||
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/home/payment/captain_wallet_controller.dart';
|
||||
import 'package:ride/controller/payment/payment_controller.dart';
|
||||
|
||||
class PointsCaptain extends StatelessWidget {
|
||||
PaymentController paymentController = Get.put(PaymentController());
|
||||
CaptainWalletController captainWalletController =
|
||||
Get.put(CaptainWalletController());
|
||||
|
||||
PointsCaptain({
|
||||
super.key,
|
||||
required this.kolor,
|
||||
required this.countPoint,
|
||||
required this.pricePoint,
|
||||
});
|
||||
final Color kolor;
|
||||
final String countPoint;
|
||||
int pricePoint;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
await paymentController.makePaymentStripe(pricePoint, 'USD', () async {
|
||||
await captainWalletController.addDriverPayment('visa', pricePoint);
|
||||
await captainWalletController.addDriverWallet('visa', countPoint);
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
width: Get.width * .2,
|
||||
height: Get.width * .2,
|
||||
margin: const EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
color: kolor,
|
||||
border: Border.all(color: AppColor.accentColor),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
shape: BoxShape.rectangle,
|
||||
),
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'$countPoint Point',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
'$pricePoint\$',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,97 @@
|
||||
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/home/payment/captain_wallet_controller.dart';
|
||||
import 'package:ride/controller/home/payment/credit_card_controller.dart';
|
||||
import 'package:ride/views/home/map_widget.dart/payment_method.page.dart';
|
||||
import 'package:ride/views/widgets/mycircular.dart';
|
||||
|
||||
import '../../../controller/payment/payment_controller.dart';
|
||||
import '../../widgets/my_scafold.dart';
|
||||
import 'points_captain.dart';
|
||||
|
||||
class WaletCaptain extends StatelessWidget {
|
||||
const WaletCaptain({super.key});
|
||||
|
||||
WaletCaptain({super.key});
|
||||
CaptainWalletController captainWalletController =
|
||||
Get.put(CaptainWalletController());
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(CreditCardController());
|
||||
return MyScafolld(
|
||||
title: 'Wallet'.tr,
|
||||
body: [],
|
||||
title: 'Captain Wallet'.tr,
|
||||
body: [
|
||||
GetBuilder<CaptainWalletController>(
|
||||
builder: (captainWalletController) => captainWalletController
|
||||
.isLoading
|
||||
? const MyCircularProgressIndicator()
|
||||
: Padding(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Card(
|
||||
elevation: 4,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Text(
|
||||
'Total Points is ${captainWalletController.totalPoints} 💎',
|
||||
style: AppStyle.headtitle2,
|
||||
),
|
||||
),
|
||||
),
|
||||
Card(
|
||||
elevation: 4,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Text(
|
||||
'Total Budget from trips is ${captainWalletController.totalAmount}\$',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'You can buy Points to let you online\nby this list below'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const Divider(
|
||||
indent: 30,
|
||||
endIndent: 30,
|
||||
color: AppColor.accentColor,
|
||||
thickness: 3,
|
||||
),
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: Get.height * .120,
|
||||
child: Row(
|
||||
children: [
|
||||
PointsCaptain(
|
||||
kolor: AppColor.blueColor,
|
||||
pricePoint: 5,
|
||||
countPoint: '500',
|
||||
),
|
||||
PointsCaptain(
|
||||
kolor: Colors.green,
|
||||
pricePoint: 10,
|
||||
countPoint: '1040',
|
||||
),
|
||||
PointsCaptain(
|
||||
kolor: Colors.amberAccent,
|
||||
pricePoint: 20,
|
||||
countPoint: '2100',
|
||||
),
|
||||
PointsCaptain(
|
||||
kolor: AppColor.yellowColor,
|
||||
pricePoint: 50,
|
||||
countPoint: '50400',
|
||||
),
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
))
|
||||
],
|
||||
isleading: true,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,88 +1,151 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:path/path.dart';
|
||||
import 'package:ride/constant/box_name.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/controller/profile/captain_profile_controller.dart';
|
||||
import 'package:ride/env/env.dart';
|
||||
import 'package:ride/main.dart';
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import 'package:ride/views/widgets/my_scafold.dart';
|
||||
|
||||
import '../../widgets/my_textField.dart';
|
||||
|
||||
class ProfileCaptain extends StatelessWidget {
|
||||
const ProfileCaptain({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(CaptainProfileController());
|
||||
return MyScafolld(
|
||||
title: 'My Profile'.tr,
|
||||
body: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: SingleChildScrollView(
|
||||
child: Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: Get.width * 0.26,
|
||||
backgroundColor: Colors.white,
|
||||
backgroundImage: CachedNetworkImageProvider(
|
||||
"${Env.serverPHP}/card_image/${box.read(BoxName.driverID)}.jpg",
|
||||
),
|
||||
title: 'My Profile'.tr,
|
||||
body: [
|
||||
GetBuilder<CaptainProfileController>(
|
||||
builder: (controller) => Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: SingleChildScrollView(
|
||||
child: Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: Get.width * 0.26,
|
||||
backgroundColor: Colors.white,
|
||||
backgroundImage: CachedNetworkImageProvider(
|
||||
"${Env.serverPHP}/card_image/${box.read(BoxName.driverID)}.jpg",
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
box.read(BoxName.nameDriver) +
|
||||
' ' +
|
||||
box.read(BoxName.lastNameDriver).toString(),
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Email is :${box.read(BoxName.emailDriver)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Phone Number is :${box.read(BoxName.phoneDriver)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Date of Birth is :${box.read(BoxName.dobDriver)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Sex is :${box.read(BoxName.sexDriver)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
const Divider(
|
||||
// height: 2,
|
||||
endIndent: 1,
|
||||
indent: 2,
|
||||
thickness: 2,
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Car Details'.tr, style: AppStyle.headtitle2),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('VIN is :${box.read(BoxName.vin)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Color is :${box.read(BoxName.color)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Make is :${box.read(BoxName.make)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Model is :${box.read(BoxName.model)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Year is :${box.read(BoxName.year)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
'Expiration Date :${box.read(BoxName.expirationDate)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text(
|
||||
box.read(BoxName.nameDriver) +
|
||||
' ' +
|
||||
box.read(BoxName.lastNameDriver).toString(),
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Email is :${box.read(BoxName.emailDriver)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Phone Number is :${box.read(BoxName.phoneDriver)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Date of Birth is :${box.read(BoxName.dobDriver)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Sex is :${box.read(BoxName.sexDriver)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
const Divider(
|
||||
// height: 2,
|
||||
endIndent: 1,
|
||||
indent: 2,
|
||||
thickness: 2,
|
||||
),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Car Details'.tr, style: AppStyle.headtitle2),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('VIN is :${box.read(BoxName.vin)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Color is :${box.read(BoxName.color)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Make is :${box.read(BoxName.make)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Model is :${box.read(BoxName.model)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Year is :${box.read(BoxName.year)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
Text('Expiration Date :${box.read(BoxName.expirationDate)}',
|
||||
style: AppStyle.title),
|
||||
const SizedBox(height: 8.0),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
isleading: true,
|
||||
action: GetBuilder<CaptainProfileController>(
|
||||
builder: (controller) => IconButton(
|
||||
onPressed: () {
|
||||
Get.defaultDialog(
|
||||
title: 'Edit Your data',
|
||||
titleStyle: AppStyle.title,
|
||||
content: SizedBox(
|
||||
height: Get.height * .4,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
MyTextForm(
|
||||
controller: controller.vin,
|
||||
hint: 'write vin for your car',
|
||||
label: 'VIN',
|
||||
type: TextInputType.emailAddress,
|
||||
),
|
||||
MyTextForm(
|
||||
controller: controller.color,
|
||||
hint: 'write Color for your car',
|
||||
label: 'Color',
|
||||
type: TextInputType.emailAddress,
|
||||
),
|
||||
MyTextForm(
|
||||
controller: controller.make,
|
||||
hint: 'write Make for your car',
|
||||
label: 'Make',
|
||||
type: TextInputType.emailAddress,
|
||||
),
|
||||
MyTextForm(
|
||||
controller: controller.model,
|
||||
hint: 'write Model for your car',
|
||||
label: 'Model',
|
||||
type: TextInputType.emailAddress,
|
||||
),
|
||||
MyTextForm(
|
||||
controller: controller.year,
|
||||
hint: 'write Year for your car',
|
||||
label: 'Year',
|
||||
type: TextInputType.number,
|
||||
),
|
||||
MyTextForm(
|
||||
controller: controller.expirationDate,
|
||||
hint: 'write Expiration Date for your car',
|
||||
label: 'Expiration Date',
|
||||
type: TextInputType.datetime),
|
||||
MyElevatedButton(
|
||||
title: 'Update'.tr,
|
||||
onPressed: () => controller.updateFields())
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
},
|
||||
icon: const Icon(Icons.edit),
|
||||
),
|
||||
),
|
||||
],
|
||||
isleading: true,
|
||||
);
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user