4/22/2
This commit is contained in:
@@ -227,6 +227,26 @@ class FirebaseMessagesController extends GetxController {
|
||||
} catch (e) {
|
||||
print('Error navigating to PassengerCallPage: $e');
|
||||
}
|
||||
} else if (message.notification!.title! == 'Call Income from Passenger') {
|
||||
try {
|
||||
var myListString = message.data['passengerList'];
|
||||
var driverList = jsonDecode(myListString) as List<dynamic>;
|
||||
// if (Platform.isAndroid) {
|
||||
NotificationController().showNotification(
|
||||
'Call Income'.tr,
|
||||
message.notification!.body!,
|
||||
'iphone_ringtone',
|
||||
);
|
||||
// }
|
||||
// Assuming GetMaterialApp is initialized and context is valid for navigation
|
||||
Get.to(() => CallPage(
|
||||
// channelName: driverList[1].toString(),
|
||||
// token: driverList[0].toString(),
|
||||
// remoteID: driverList[2].toString(),
|
||||
));
|
||||
} catch (e) {
|
||||
print('Error navigating to PassengerCallPage: $e');
|
||||
}
|
||||
} else if (message.notification!.title! == 'Call End') {
|
||||
try {
|
||||
var myListString = message.data['passengerList'];
|
||||
@@ -652,15 +672,19 @@ class DriverTipWidget extends StatelessWidget {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
// Text(
|
||||
// '${'Your fee is '.tr}${Get.find<MapPassengerController>().totalPassenger.toStringAsFixed(2)}'),
|
||||
Text(
|
||||
'${'Your fee is '.tr}${Get.find<MapPassengerController>().totalPassenger.toStringAsFixed(2)}'),
|
||||
Text('Do you want to pay Tips for this Driver'.tr),
|
||||
'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())))}',
|
||||
|
||||
Reference in New Issue
Block a user