6/19/1
This commit is contained in:
@@ -212,6 +212,8 @@ class CaptainWalletController extends GetxController {
|
|||||||
amountToNewDriverMap[0]['token'].toString(),
|
amountToNewDriverMap[0]['token'].toString(),
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
await addSeferWallet('payout fee', '5');
|
||||||
|
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
title: 'transfer Successful'.tr,
|
title: 'transfer Successful'.tr,
|
||||||
middleText: '',
|
middleText: '',
|
||||||
@@ -221,15 +223,7 @@ class CaptainWalletController extends GetxController {
|
|||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
Get.back();
|
Get.back();
|
||||||
Get.back();
|
Get.back();
|
||||||
var seferToken = await Get.find<CaptainWalletController>()
|
|
||||||
.generateToken('5');
|
|
||||||
await CRUD().post(link: AppLink.addSeferWallet, payload: {
|
|
||||||
'amount': '5',
|
|
||||||
'paymentMethod': 'payout fee',
|
|
||||||
'passengerId': 'driver',
|
|
||||||
'token': seferToken,
|
|
||||||
'driverId': box.read(BoxName.driverID).toString(),
|
|
||||||
});
|
|
||||||
await refreshCaptainWallet();
|
await refreshCaptainWallet();
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,15 +78,9 @@ class PaymobPayout extends GetxController {
|
|||||||
'token': paymentToken,
|
'token': paymentToken,
|
||||||
'driverID': box.read(BoxName.driverID).toString(),
|
'driverID': box.read(BoxName.driverID).toString(),
|
||||||
});
|
});
|
||||||
var seferToken = await Get.find<CaptainWalletController>()
|
await Get.find<CaptainWalletController>()
|
||||||
.generateToken(payOutFee.toString());
|
.addSeferWallet('payout fee myself', payOutFee.toString());
|
||||||
await CRUD().post(link: AppLink.addSeferWallet, payload: {
|
|
||||||
'amount': ((-1) * (double.parse(dec['amount']))).toStringAsFixed(0),
|
|
||||||
'paymentMethod': 'payout fee',
|
|
||||||
'passengerId': 'driver',
|
|
||||||
'token': seferToken,
|
|
||||||
'driverId': box.read(BoxName.driverID).toString(),
|
|
||||||
});
|
|
||||||
Get.snackbar('Transaction successful'.tr,
|
Get.snackbar('Transaction successful'.tr,
|
||||||
'${'Transaction successful'.tr} ${dec['amount']}',
|
'${'Transaction successful'.tr} ${dec['amount']}',
|
||||||
backgroundColor: AppColor.greenColor);
|
backgroundColor: AppColor.greenColor);
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import 'package:SEFER/main.dart';
|
|||||||
import 'package:SEFER/views/home/Captin/home_captain/home_captin.dart';
|
import 'package:SEFER/views/home/Captin/home_captain/home_captin.dart';
|
||||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
|
import '../home/payment/captain_wallet_controller.dart';
|
||||||
|
|
||||||
// import '../home/captin/home_captain_controller.dart';
|
// import '../home/captin/home_captain_controller.dart';
|
||||||
|
|
||||||
class RateController extends GetxController {
|
class RateController extends GetxController {
|
||||||
@@ -54,29 +56,34 @@ class RateController extends GetxController {
|
|||||||
if (value != 'failure') {
|
if (value != 'failure') {
|
||||||
Get.snackbar('Wallet Added'.tr, '',
|
Get.snackbar('Wallet Added'.tr, '',
|
||||||
backgroundColor: AppColor.greenColor);
|
backgroundColor: AppColor.greenColor);
|
||||||
var paymentToken3 = await Get.find<MapDriverController>()
|
if (double.parse(
|
||||||
.generateTokenPassenger(remainingFee.toString());
|
Get.find<CaptainWalletController>().totalAmountVisa) >
|
||||||
await CRUD().post(link: AppLink.addDrivePayment, payload: {
|
remainingFee) {
|
||||||
'rideId': 'remain$rideId',
|
var paymentToken3 = await Get.find<MapDriverController>()
|
||||||
'amount': remainingFee.toString(),
|
.generateTokenDriver((-1 * remainingFee).toString());
|
||||||
'payment_method': 'Remainder',
|
|
||||||
'passengerID': passengerId,
|
|
||||||
'token': paymentToken3,
|
|
||||||
'driverID': box.read(BoxName.driverID).toString(),
|
|
||||||
});
|
|
||||||
|
|
||||||
double pointsSubtraction = 0;
|
await CRUD().post(link: AppLink.addDrivePayment, payload: {
|
||||||
pointsSubtraction = remainingFee * (-1); // for egypt /100
|
'rideId': 'remain$rideId',
|
||||||
var paymentToken4 = await Get.find<MapDriverController>()
|
'amount': (-1 * remainingFee).toString(),
|
||||||
.generateTokenPassenger((pointsSubtraction).toStringAsFixed(0));
|
'payment_method': 'Remainder',
|
||||||
var res = await CRUD()
|
'passengerID': passengerId,
|
||||||
.post(link: AppLink.addDriversWalletPoints, payload: {
|
'token': paymentToken3,
|
||||||
'paymentID': 'rideId$rideId',
|
'driverID': box.read(BoxName.driverID).toString(),
|
||||||
'amount': (pointsSubtraction).toStringAsFixed(0),
|
});
|
||||||
'paymentMethod': 'Remainder',
|
} else {
|
||||||
'token': paymentToken4,
|
double pointsSubtraction = 0;
|
||||||
'driverID': box.read(BoxName.driverID).toString(),
|
pointsSubtraction = remainingFee * (-1); // for egypt /100
|
||||||
});
|
var paymentToken4 = await Get.find<MapDriverController>()
|
||||||
|
.generateTokenDriver((pointsSubtraction).toStringAsFixed(0));
|
||||||
|
var res = await CRUD()
|
||||||
|
.post(link: AppLink.addDriversWalletPoints, payload: {
|
||||||
|
'paymentID': 'rideId$rideId',
|
||||||
|
'amount': (pointsSubtraction).toStringAsFixed(0),
|
||||||
|
'paymentMethod': 'Remainder',
|
||||||
|
'token': paymentToken4,
|
||||||
|
'driverID': box.read(BoxName.driverID).toString(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
FirebaseMessagesController().sendNotificationToAnyWithoutData(
|
||||||
'Wallet Added',
|
'Wallet Added',
|
||||||
|
|||||||
@@ -23,67 +23,66 @@ WHERE
|
|||||||
c.complaint_type = 'Passenger' AND c.passenger_id = '100393163265770158312';
|
c.complaint_type = 'Passenger' AND c.passenger_id = '100393163265770158312';
|
||||||
|
|
||||||
-- Admin panel dashboard
|
-- Admin panel dashboard
|
||||||
|
SELECT
|
||||||
SELECT
|
COALESCE((
|
||||||
(
|
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(`email`)
|
COUNT(`email`)
|
||||||
FROM
|
FROM
|
||||||
`passengers`
|
`passengers`
|
||||||
) AS countPassengers,
|
), 0) AS countPassengers,
|
||||||
(
|
COALESCE((
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(`email`)
|
COUNT(`email`)
|
||||||
FROM
|
FROM
|
||||||
`driver`
|
`driver`
|
||||||
) AS countDriver,
|
), 0) AS countDriver,
|
||||||
(
|
COALESCE((
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(`id`)
|
COUNT(`id`)
|
||||||
FROM
|
FROM
|
||||||
`ride`
|
`ride`
|
||||||
) AS countRide,
|
), 0) AS countRide,
|
||||||
(
|
COALESCE((
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(`id`)
|
COUNT(`id`)
|
||||||
FROM
|
FROM
|
||||||
`passengers`
|
`passengers`
|
||||||
WHERE
|
WHERE
|
||||||
`passengers`.`created_at` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-01') AND LAST_DAY(CURRENT_DATE)
|
`passengers`.`created_at` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-01') AND LAST_DAY(CURRENT_DATE)
|
||||||
) AS countPassengersThisMonth,
|
), 0) AS countPassengersThisMonth,
|
||||||
(
|
COALESCE((
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(`id`)
|
COUNT(`id`)
|
||||||
FROM
|
FROM
|
||||||
`ride`
|
`ride`
|
||||||
WHERE
|
WHERE
|
||||||
`ride`.`created_at` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-01') AND LAST_DAY(CURRENT_DATE)
|
`ride`.`created_at` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-01') AND LAST_DAY(CURRENT_DATE)
|
||||||
) AS countRideThisMonth,
|
), 0) AS countRideThisMonth,
|
||||||
(
|
COALESCE((
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(`id`)
|
COUNT(`id`)
|
||||||
FROM
|
FROM
|
||||||
`driver`
|
`driver`
|
||||||
WHERE
|
WHERE
|
||||||
`driver`.`created_at` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-01') AND LAST_DAY(CURRENT_DATE)
|
`driver`.`created_at` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-01') AND LAST_DAY(CURRENT_DATE)
|
||||||
) AS countDriverThisMonth,
|
), 0) AS countDriverThisMonth,
|
||||||
(
|
COALESCE((
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(`id`)
|
COUNT(`id`)
|
||||||
FROM
|
FROM
|
||||||
`CarRegistration`
|
`CarRegistration`
|
||||||
WHERE
|
WHERE
|
||||||
`CarRegistration`.`created_at` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-01') AND LAST_DAY(CURRENT_DATE)
|
`CarRegistration`.`created_at` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-01') AND LAST_DAY(CURRENT_DATE)
|
||||||
) AS countCarRegistrationThisMonth,
|
), 0) AS countCarRegistrationThisMonth,
|
||||||
(
|
COALESCE((
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(`id`)
|
COUNT(`id`)
|
||||||
FROM
|
FROM
|
||||||
`complaint`
|
`complaint`
|
||||||
WHERE
|
WHERE
|
||||||
`complaint`.`date_filed` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-01') AND LAST_DAY(CURRENT_DATE)
|
`complaint`.`date_filed` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-01') AND LAST_DAY(CURRENT_DATE)
|
||||||
) AS countComplaintThisMonth,
|
), 0) AS countComplaintThisMonth,
|
||||||
(
|
COALESCE((
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(`id`)
|
COUNT(`id`)
|
||||||
FROM
|
FROM
|
||||||
@@ -105,30 +104,26 @@ WHERE
|
|||||||
),
|
),
|
||||||
'%Y-%m-%d'
|
'%Y-%m-%d'
|
||||||
)
|
)
|
||||||
) AS countComplaintThisWeek,
|
), 0) AS countComplaintThisWeek,
|
||||||
(
|
COALESCE((
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(`id`)
|
COUNT(`id`)
|
||||||
FROM
|
FROM
|
||||||
`complaint`
|
`complaint`
|
||||||
WHERE
|
WHERE
|
||||||
`complaint`.`date_filed` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-%d') AND DATE_FORMAT(CURRENT_DATE, '%Y-%m-%d')
|
`complaint`.`date_filed` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-%d') AND DATE_FORMAT(CURRENT_DATE, '%Y-%m-%d')
|
||||||
) AS countComplaintToday,
|
), 0) AS countComplaintToday,
|
||||||
(
|
COALESCE((
|
||||||
SELECT
|
SELECT
|
||||||
SUM(`payments`.`amount`)
|
SUM(`payments`.`amount`)
|
||||||
FROM
|
FROM
|
||||||
`payments` WHERE
|
`payments`
|
||||||
|
WHERE
|
||||||
`payments`.`created_at` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-01') AND LAST_DAY(CURRENT_DATE)
|
`payments`.`created_at` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-01') AND LAST_DAY(CURRENT_DATE)
|
||||||
AND
|
AND
|
||||||
`payments`.`payment_method` IN('visa-in',
|
`payments`.`payment_method` IN('visa-in', 'visa', 'visaRide', 'TransferFrom', 'payout', 'TransferTo')
|
||||||
'visa',
|
), 0) AS payments,
|
||||||
'visaRide',
|
COALESCE((
|
||||||
'TransferFrom',
|
|
||||||
'payout',
|
|
||||||
'TransferTo')
|
|
||||||
) AS payments,
|
|
||||||
(
|
|
||||||
SELECT
|
SELECT
|
||||||
SUM(`driverWallet`.`amount`)
|
SUM(`driverWallet`.`amount`)
|
||||||
FROM
|
FROM
|
||||||
@@ -137,15 +132,23 @@ WHERE
|
|||||||
`driverWallet`.`dateCreated` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-01') AND LAST_DAY(CURRENT_DATE)
|
`driverWallet`.`dateCreated` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-01') AND LAST_DAY(CURRENT_DATE)
|
||||||
AND
|
AND
|
||||||
`driverWallet`.`paymentMethod` IN('visa', '')
|
`driverWallet`.`paymentMethod` IN('visa', '')
|
||||||
) AS driverWallet,
|
), 0) AS driverWallet,
|
||||||
(
|
COALESCE((
|
||||||
SELECT
|
SELECT
|
||||||
SUM(`passengerWallet`.`balance`)
|
SUM(`passengerWallet`.`balance`)
|
||||||
FROM
|
FROM
|
||||||
`passengerWallet`
|
`passengerWallet`
|
||||||
WHERE
|
WHERE
|
||||||
`passengerWallet`.`created_at` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-01') AND LAST_DAY(CURRENT_DATE)
|
`passengerWallet`.`created_at` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-01') AND LAST_DAY(CURRENT_DATE)
|
||||||
) AS passengerWallet
|
), 0) AS passengerWallet,
|
||||||
FROM
|
COALESCE((
|
||||||
`passengers`
|
SELECT
|
||||||
LIMIT 1
|
SUM(`seferWallet`.`amount`)
|
||||||
|
FROM
|
||||||
|
`seferWallet`
|
||||||
|
WHERE
|
||||||
|
`seferWallet`.`createdAt` BETWEEN DATE_FORMAT(CURRENT_DATE, '%Y-%m-01') AND LAST_DAY(CURRENT_DATE)
|
||||||
|
), 0) AS seferWallet
|
||||||
|
FROM
|
||||||
|
`passengers`
|
||||||
|
LIMIT 1;
|
||||||
@@ -21,233 +21,234 @@ class RatePassenger extends StatelessWidget {
|
|||||||
return MyScafolld(
|
return MyScafolld(
|
||||||
title: 'Rate Passenger'.tr,
|
title: 'Rate Passenger'.tr,
|
||||||
body: [
|
body: [
|
||||||
Positioned(
|
GetBuilder<RateController>(builder: (controller) {
|
||||||
top: 40,
|
return Positioned(
|
||||||
left: Get.width * .1,
|
top: 40,
|
||||||
right: Get.width * .1,
|
left: Get.width * .1,
|
||||||
child: Container(
|
right: Get.width * .1,
|
||||||
decoration: AppStyle.boxDecoration,
|
child: Container(
|
||||||
child: Column(
|
decoration: AppStyle.boxDecoration,
|
||||||
children: [
|
child: Column(
|
||||||
Padding(
|
children: [
|
||||||
padding: const EdgeInsets.all(4),
|
Padding(
|
||||||
child: Container(
|
padding: const EdgeInsets.all(4),
|
||||||
height: Get.height * .25,
|
child: Container(
|
||||||
decoration: AppStyle.boxDecoration1,
|
height: Get.height * .25,
|
||||||
child: Column(
|
decoration: AppStyle.boxDecoration1,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
child: Column(
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
Text(
|
children: [
|
||||||
'${'Total price from '.tr}${Get.find<MapDriverController>().passengerName}',
|
Text(
|
||||||
style: AppStyle.title,
|
'${'Total price from '.tr}${Get.find<MapDriverController>().passengerName}',
|
||||||
),
|
style: AppStyle.title,
|
||||||
Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(
|
|
||||||
width: 2,
|
|
||||||
color: AppColor.redColor,
|
|
||||||
)),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(4),
|
|
||||||
child: Text(
|
|
||||||
(double.parse(controller.price.toString()) *
|
|
||||||
.12 +
|
|
||||||
double.parse(
|
|
||||||
controller.price.toString()))
|
|
||||||
.toStringAsFixed(2),
|
|
||||||
style: AppStyle.number.copyWith(
|
|
||||||
color: AppColor.redColor,
|
|
||||||
textBaseline: TextBaseline.ideographic,
|
|
||||||
decoration: TextDecoration.lineThrough,
|
|
||||||
decorationColor: AppColor.redColor),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
Container(
|
||||||
const SizedBox(
|
decoration: BoxDecoration(
|
||||||
height: 10,
|
border: Border.all(
|
||||||
),
|
width: 2,
|
||||||
Container(
|
color: AppColor.redColor,
|
||||||
decoration: BoxDecoration(
|
)),
|
||||||
border: Border.all(
|
child: Padding(
|
||||||
width: 2,
|
padding: const EdgeInsets.all(4),
|
||||||
color: AppColor.greenColor,
|
child: Text(
|
||||||
)),
|
(double.parse(controller.price.toString()) *
|
||||||
child: Padding(
|
.12 +
|
||||||
padding: const EdgeInsets.all(4),
|
double.parse(
|
||||||
child: Text(
|
controller.price.toString()))
|
||||||
Get.find<MapDriverController>().paymentAmount,
|
.toStringAsFixed(2),
|
||||||
style: AppStyle.number,
|
style: AppStyle.number.copyWith(
|
||||||
),
|
color: AppColor.redColor,
|
||||||
),
|
textBaseline: TextBaseline.ideographic,
|
||||||
),
|
decoration: TextDecoration.lineThrough,
|
||||||
const SizedBox(
|
decorationColor: AppColor.redColor),
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'Exclusive offers and discounts always with the Sefer app'
|
|
||||||
.tr,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: AppStyle.title
|
|
||||||
.copyWith(color: AppColor.redColor),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
controller.walletChecked != 'true'
|
|
||||||
? GetBuilder<RateController>(builder: (controller) {
|
|
||||||
return controller.ispassengerWantWalletFromDriver
|
|
||||||
? Container(
|
|
||||||
decoration: AppStyle.boxDecoration1,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"How much Passenger pay?".tr,
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
Form(
|
|
||||||
key: controller.formKey,
|
|
||||||
child: MyTextForm(
|
|
||||||
controller:
|
|
||||||
controller.passengerPayAmount,
|
|
||||||
label:
|
|
||||||
"passenger amount to me".tr,
|
|
||||||
hint: "passenger amount to me".tr,
|
|
||||||
type: const TextInputType
|
|
||||||
.numberWithOptions(
|
|
||||||
decimal: true)),
|
|
||||||
),
|
|
||||||
MyElevatedButton(
|
|
||||||
title: "Press here".tr,
|
|
||||||
onPressed: () {
|
|
||||||
controller.addPassengerWallet();
|
|
||||||
})
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
: Container(
|
),
|
||||||
width: Get.width * .73,
|
const SizedBox(
|
||||||
decoration: AppStyle.boxDecoration1,
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
width: 2,
|
||||||
|
color: AppColor.greenColor,
|
||||||
|
)),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(4),
|
||||||
|
child: Text(
|
||||||
|
Get.find<MapDriverController>()
|
||||||
|
.paymentAmount,
|
||||||
|
style: AppStyle.number,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Exclusive offers and discounts always with the Sefer app'
|
||||||
|
.tr,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppStyle.title
|
||||||
|
.copyWith(color: AppColor.redColor),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
controller.walletChecked != 'true'
|
||||||
|
? controller.ispassengerWantWalletFromDriver
|
||||||
|
? Container(
|
||||||
|
decoration: AppStyle.boxDecoration1,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Would the passenger like to settle the remaining fare using their wallet?"
|
"How much Passenger pay?".tr,
|
||||||
.tr,
|
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
textAlign: TextAlign.center,
|
),
|
||||||
|
Form(
|
||||||
|
key: controller.formKey,
|
||||||
|
child: MyTextForm(
|
||||||
|
controller:
|
||||||
|
controller.passengerPayAmount,
|
||||||
|
label: "passenger amount to me".tr,
|
||||||
|
hint: "passenger amount to me".tr,
|
||||||
|
type: const TextInputType
|
||||||
|
.numberWithOptions(
|
||||||
|
decimal: true)),
|
||||||
),
|
),
|
||||||
MyElevatedButton(
|
MyElevatedButton(
|
||||||
title: "Press here".tr,
|
title: "Press here".tr,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
controller.passengerWantPay();
|
controller.addPassengerWallet();
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
})
|
)
|
||||||
: const SizedBox(),
|
: Container(
|
||||||
const SizedBox(
|
width: Get.width * .73,
|
||||||
height: 20,
|
decoration: AppStyle.boxDecoration1,
|
||||||
),
|
child: Column(
|
||||||
Center(
|
children: [
|
||||||
child: RatingBar.builder(
|
Text(
|
||||||
initialRating: 0,
|
"Would the passenger like to settle the remaining fare using their wallet?"
|
||||||
itemCount: 5,
|
.tr,
|
||||||
itemSize: 50,
|
style: AppStyle.title,
|
||||||
itemPadding: const EdgeInsets.symmetric(horizontal: 2),
|
textAlign: TextAlign.center,
|
||||||
itemBuilder: (context, index) {
|
),
|
||||||
switch (index) {
|
MyElevatedButton(
|
||||||
case 0:
|
title: "Press here".tr,
|
||||||
return const Icon(
|
onPressed: () {
|
||||||
Icons.sentiment_very_dissatisfied,
|
controller.passengerWantPay();
|
||||||
color: Colors.red,
|
})
|
||||||
);
|
],
|
||||||
case 1:
|
),
|
||||||
return const Icon(
|
)
|
||||||
Icons.sentiment_dissatisfied,
|
: const SizedBox(),
|
||||||
color: Colors.redAccent,
|
const SizedBox(
|
||||||
);
|
height: 20,
|
||||||
case 2:
|
|
||||||
return const Icon(
|
|
||||||
Icons.sentiment_neutral,
|
|
||||||
color: Colors.amber,
|
|
||||||
);
|
|
||||||
case 3:
|
|
||||||
return const Icon(
|
|
||||||
Icons.sentiment_satisfied,
|
|
||||||
color: Colors.lightGreen,
|
|
||||||
);
|
|
||||||
case 4:
|
|
||||||
return const Icon(
|
|
||||||
Icons.sentiment_very_satisfied,
|
|
||||||
color: Colors.green,
|
|
||||||
);
|
|
||||||
default:
|
|
||||||
return const Icon(
|
|
||||||
Icons.sentiment_neutral,
|
|
||||||
color: Colors.amber,
|
|
||||||
);
|
|
||||||
} //
|
|
||||||
},
|
|
||||||
onRatingUpdate: (rating) {
|
|
||||||
controller.selectRateItem(rating);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
Center(
|
||||||
const SizedBox(
|
child: RatingBar.builder(
|
||||||
height: 20,
|
initialRating: 0,
|
||||||
),
|
itemCount: 5,
|
||||||
SizedBox(
|
itemSize: 50,
|
||||||
width: Get.width * .75,
|
itemPadding: const EdgeInsets.symmetric(horizontal: 2),
|
||||||
child: TextFormField(
|
itemBuilder: (context, index) {
|
||||||
maxLines: 4,
|
switch (index) {
|
||||||
minLines: 1,
|
case 0:
|
||||||
keyboardType: TextInputType.multiline,
|
return const Icon(
|
||||||
controller: controller.comment,
|
Icons.sentiment_very_dissatisfied,
|
||||||
decoration: InputDecoration(
|
color: Colors.red,
|
||||||
labelText: 'Enter your Note'.tr,
|
);
|
||||||
hintText: 'Type something...',
|
case 1:
|
||||||
prefixIcon: const Icon(
|
return const Icon(
|
||||||
Icons.rate_review), // Add an icon as a prefix
|
Icons.sentiment_dissatisfied,
|
||||||
suffixIcon: IconButton(
|
color: Colors.redAccent,
|
||||||
icon: const Icon(
|
);
|
||||||
Icons.clear,
|
case 2:
|
||||||
color: AppColor.redColor,
|
return const Icon(
|
||||||
), // Add an icon as a suffix
|
Icons.sentiment_neutral,
|
||||||
onPressed: () {
|
color: Colors.amber,
|
||||||
controller.comment.clear();
|
);
|
||||||
},
|
case 3:
|
||||||
),
|
return const Icon(
|
||||||
border:
|
Icons.sentiment_satisfied,
|
||||||
const OutlineInputBorder(), // Add a border around the input field
|
color: Colors.lightGreen,
|
||||||
enabledBorder: const OutlineInputBorder(
|
);
|
||||||
borderSide: BorderSide(
|
case 4:
|
||||||
color: Colors.blue), // Customize the border color
|
return const Icon(
|
||||||
),
|
Icons.sentiment_very_satisfied,
|
||||||
focusedBorder: const OutlineInputBorder(
|
color: Colors.green,
|
||||||
borderSide: BorderSide(
|
);
|
||||||
color: Colors
|
default:
|
||||||
.green), // Customize the border color when focused
|
return const Icon(
|
||||||
),
|
Icons.sentiment_neutral,
|
||||||
errorBorder: const OutlineInputBorder(
|
color: Colors.amber,
|
||||||
borderSide: BorderSide(
|
);
|
||||||
color: Colors
|
} //
|
||||||
.red), // Customize the border color when there's an error
|
},
|
||||||
|
onRatingUpdate: (rating) {
|
||||||
|
controller.selectRateItem(rating);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: Get.width * .75,
|
||||||
|
child: TextFormField(
|
||||||
|
maxLines: 4,
|
||||||
|
minLines: 1,
|
||||||
|
keyboardType: TextInputType.multiline,
|
||||||
|
controller: controller.comment,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: 'Enter your Note'.tr,
|
||||||
|
hintText: 'Type something...',
|
||||||
|
prefixIcon: const Icon(
|
||||||
|
Icons.rate_review), // Add an icon as a prefix
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.clear,
|
||||||
|
color: AppColor.redColor,
|
||||||
|
), // Add an icon as a suffix
|
||||||
|
onPressed: () {
|
||||||
|
controller.comment.clear();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
border:
|
||||||
|
const OutlineInputBorder(), // Add a border around the input field
|
||||||
|
enabledBorder: const OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color:
|
||||||
|
Colors.blue), // Customize the border color
|
||||||
|
),
|
||||||
|
focusedBorder: const OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Colors
|
||||||
|
.green), // Customize the border color when focused
|
||||||
|
),
|
||||||
|
errorBorder: const OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Colors
|
||||||
|
.red), // Customize the border color when there's an error
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(
|
||||||
const SizedBox(
|
height: 20,
|
||||||
height: 20,
|
),
|
||||||
),
|
MyElevatedButton(
|
||||||
MyElevatedButton(
|
title: 'Submit rating'.tr,
|
||||||
title: 'Submit rating'.tr,
|
onPressed: () => controller.addRateToPassenger())
|
||||||
onPressed: () => controller.addRateToPassenger())
|
],
|
||||||
],
|
),
|
||||||
),
|
));
|
||||||
)),
|
}),
|
||||||
],
|
],
|
||||||
isleading: false,
|
isleading: false,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ class PointsCaptain extends StatelessWidget {
|
|||||||
box.read(BoxName.countryCode) == 'Egypt'
|
box.read(BoxName.countryCode) == 'Egypt'
|
||||||
? 'EGP'
|
? 'EGP'
|
||||||
: 'JOD', () async {
|
: 'JOD', () async {
|
||||||
// await captainWalletController.addDriverPaymentPoints(
|
await captainWalletController.addDriverPaymentPoints(
|
||||||
// 'visa-in', pricePoint);
|
'visa-in', pricePoint);
|
||||||
await captainWalletController.addDriverWallet(
|
await captainWalletController.addDriverWallet(
|
||||||
'visa-in', countPoint);
|
'visa-in', countPoint);
|
||||||
await captainWalletController.addSeferWallet(
|
await captainWalletController.addSeferWallet(
|
||||||
@@ -75,6 +75,8 @@ class PointsCaptain extends StatelessWidget {
|
|||||||
'visa-in', pricePoint);
|
'visa-in', pricePoint);
|
||||||
await captainWalletController.addDriverWallet(
|
await captainWalletController.addDriverWallet(
|
||||||
'visa-in', countPoint);
|
'visa-in', countPoint);
|
||||||
|
await captainWalletController.addSeferWallet(
|
||||||
|
'visa-in', pricePoint);
|
||||||
await captainWalletController
|
await captainWalletController
|
||||||
.getCaptainWalletFromBuyPoints();
|
.getCaptainWalletFromBuyPoints();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user