This commit is contained in:
Hamza Aleghwairyeen
2024-04-24 01:56:38 +03:00
parent 037fa65a55
commit c78f49e968
2 changed files with 101 additions and 106 deletions

View File

@@ -669,94 +669,119 @@ class DriverTipWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// Text(
// '${'Your fee is '.tr}${Get.find<MapPassengerController>().totalPassenger.toStringAsFixed(2)}'),
Text(
'Do you want to pay Tips for this Driver'.tr,
textAlign: TextAlign.center,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
InkWell(
onTap: () {
box.write(BoxName.tipPercentage, '0.05');
return GetBuilder<MapPassengerController>(builder: (controller) {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
// Text(
// '${'Your fee is '.tr}${Get.find<MapPassengerController>().totalPassenger.toStringAsFixed(2)}'),
Text(
'Do you want to pay Tips for this Driver'.tr,
textAlign: TextAlign.center,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
InkWell(
onTap: () {
box.write(BoxName.tipPercentage, '0.05');
Toast.show(
context,
'${'Tip is '.tr}${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
AppColor.blueColor);
},
child: Container(
decoration: BoxDecoration(border: Border.all()),
child: const Padding(
padding: EdgeInsets.all(4),
child: Center(
child: Text('5%'),
Toast.show(
context,
'${'Tip is '.tr}${(controller.totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
AppColor.blueColor);
},
child: Container(
decoration: BoxDecoration(border: Border.all()),
child: const Padding(
padding: EdgeInsets.all(4),
child: Center(
child: Text('5%'),
),
),
),
),
),
InkWell(
onTap: () {
box.write(BoxName.tipPercentage, '0.10');
Toast.show(
context,
'${'Tip is'.tr} ${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
AppColor.blueColor);
},
child: Container(
decoration: BoxDecoration(border: Border.all()),
child: const Center(
child: Padding(
padding: EdgeInsets.all(5),
child: Text('10%'),
InkWell(
onTap: () {
box.write(BoxName.tipPercentage, '0.10');
Toast.show(
context,
'${'Tip is'.tr} ${(controller.totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
AppColor.blueColor);
},
child: Container(
decoration: BoxDecoration(border: Border.all()),
child: const Center(
child: Padding(
padding: EdgeInsets.all(5),
child: Text('10%'),
),
),
),
),
),
InkWell(
onTap: () {
box.write(BoxName.tipPercentage, '0.15');
Toast.show(
context,
'${'Tip is'.tr} ${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
AppColor.blueColor);
},
child: Container(
decoration: BoxDecoration(border: Border.all()),
child: const Center(
child: Padding(
padding: EdgeInsets.all(5),
child: Text('15%'),
InkWell(
onTap: () {
box.write(BoxName.tipPercentage, '0.15');
Toast.show(
context,
'${'Tip is'.tr} ${(controller.totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
AppColor.blueColor);
},
child: Container(
decoration: BoxDecoration(border: Border.all()),
child: const Center(
child: Padding(
padding: EdgeInsets.all(5),
child: Text('15%'),
),
),
),
),
),
InkWell(
onTap: () {
box.write(BoxName.tipPercentage, '0.20');
Toast.show(
context,
'${'Tip is'.tr} ${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
AppColor.blueColor);
},
child: Container(
decoration: BoxDecoration(border: Border.all()),
child: const Center(
child: Padding(
padding: EdgeInsets.all(5),
child: Text('20%'),
InkWell(
onTap: () {
box.write(BoxName.tipPercentage, '0.20');
Toast.show(
context,
'${'Tip is'.tr} ${(controller.totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
AppColor.blueColor);
},
child: Container(
decoration: BoxDecoration(border: Border.all()),
child: const Center(
child: Padding(
padding: EdgeInsets.all(5),
child: Text('20%'),
),
),
),
),
),
],
)
],
);
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
MyElevatedButton(
kolor: AppColor.redColor,
title: 'No i want'.tr,
onPressed: () {
box.write(BoxName.tipPercentage, '0');
}),
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(6),
child: Text(
(controller.totalPassenger *
double.parse(box.read(BoxName.tipPercentage)))
.toString(),
style: AppStyle.title,
),
),
),
],
)
],
);
});
}
}

View File

@@ -115,36 +115,6 @@ class RateDriverFromPassenger extends StatelessWidget {
true)
? const DriverTipWidget()
: const SizedBox(),
GetBuilder<MapPassengerController>(
builder: (mapPassengerController) {
return Row(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
children: [
MyElevatedButton(
kolor: AppColor.redColor,
title: 'No i want'.tr,
onPressed: () {
box.write(
BoxName.tipPercentage, '0');
}),
Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(6),
child: Text(
(mapPassengerController
.totalPassenger *
double.parse(box.read(
BoxName.tipPercentage)))
.toString(),
style: AppStyle.title,
),
),
),
],
);
})
],
),
)),