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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return GetBuilder<MapPassengerController>(builder: (controller) {
mainAxisAlignment: MainAxisAlignment.spaceBetween, return Column(
children: [ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// Text( children: [
// '${'Your fee is '.tr}${Get.find<MapPassengerController>().totalPassenger.toStringAsFixed(2)}'), // Text(
Text( // '${'Your fee is '.tr}${Get.find<MapPassengerController>().totalPassenger.toStringAsFixed(2)}'),
'Do you want to pay Tips for this Driver'.tr, Text(
textAlign: TextAlign.center, 'Do you want to pay Tips for this Driver'.tr,
), textAlign: TextAlign.center,
Row( ),
mainAxisAlignment: MainAxisAlignment.spaceAround, Row(
children: [ mainAxisAlignment: MainAxisAlignment.spaceAround,
InkWell( children: [
onTap: () { InkWell(
box.write(BoxName.tipPercentage, '0.05'); onTap: () {
box.write(BoxName.tipPercentage, '0.05');
Toast.show( Toast.show(
context, context,
'${'Tip is '.tr}${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}', '${'Tip is '.tr}${(controller.totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
AppColor.blueColor); AppColor.blueColor);
}, },
child: Container( child: Container(
decoration: BoxDecoration(border: Border.all()), decoration: BoxDecoration(border: Border.all()),
child: const Padding( child: const Padding(
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
child: Center( child: Center(
child: Text('5%'), child: Text('5%'),
),
), ),
), ),
), ),
), InkWell(
InkWell( onTap: () {
onTap: () { box.write(BoxName.tipPercentage, '0.10');
box.write(BoxName.tipPercentage, '0.10'); Toast.show(
Toast.show( context,
context, '${'Tip is'.tr} ${(controller.totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
'${'Tip is'.tr} ${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}', AppColor.blueColor);
AppColor.blueColor); },
}, child: Container(
child: Container( decoration: BoxDecoration(border: Border.all()),
decoration: BoxDecoration(border: Border.all()), child: const Center(
child: const Center( child: Padding(
child: Padding( padding: EdgeInsets.all(5),
padding: EdgeInsets.all(5), child: Text('10%'),
child: Text('10%'), ),
), ),
), ),
), ),
), InkWell(
InkWell( onTap: () {
onTap: () { box.write(BoxName.tipPercentage, '0.15');
box.write(BoxName.tipPercentage, '0.15'); Toast.show(
Toast.show( context,
context, '${'Tip is'.tr} ${(controller.totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
'${'Tip is'.tr} ${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}', AppColor.blueColor);
AppColor.blueColor); },
}, child: Container(
child: Container( decoration: BoxDecoration(border: Border.all()),
decoration: BoxDecoration(border: Border.all()), child: const Center(
child: const Center( child: Padding(
child: Padding( padding: EdgeInsets.all(5),
padding: EdgeInsets.all(5), child: Text('15%'),
child: Text('15%'), ),
), ),
), ),
), ),
), InkWell(
InkWell( onTap: () {
onTap: () { box.write(BoxName.tipPercentage, '0.20');
box.write(BoxName.tipPercentage, '0.20'); Toast.show(
Toast.show( context,
context, '${'Tip is'.tr} ${(controller.totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
'${'Tip is'.tr} ${(Get.find<MapPassengerController>().totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}', AppColor.blueColor);
AppColor.blueColor); },
}, child: Container(
child: Container( decoration: BoxDecoration(border: Border.all()),
decoration: BoxDecoration(border: Border.all()), child: const Center(
child: const Center( child: Padding(
child: Padding( padding: EdgeInsets.all(5),
padding: EdgeInsets.all(5), child: Text('20%'),
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) true)
? const DriverTipWidget() ? const DriverTipWidget()
: const SizedBox(), : 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,
),
),
),
],
);
})
], ],
), ),
)), )),