1/23/1
This commit is contained in:
@@ -2,8 +2,10 @@ import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../constant/api_key.dart';
|
||||
import '../../constant/box_name.dart';
|
||||
@@ -11,6 +13,7 @@ import '../../constant/colors.dart';
|
||||
import '../../constant/links.dart';
|
||||
import '../../constant/style.dart';
|
||||
import '../../main.dart';
|
||||
import '../../views/home/Captin/home_captain/home_captin.dart';
|
||||
import '../../views/home/profile/promos_passenger_page.dart';
|
||||
import '../../views/home/Captin/orderCaptin/order_request_page.dart';
|
||||
|
||||
@@ -160,6 +163,15 @@ class FirebaseMessagesController extends GetxController {
|
||||
);
|
||||
} else if (message.notification!.title!.contains('Promo')) {
|
||||
Get.to(const PromosPassengerPage());
|
||||
} else if (message.notification!.title == 'Cancel Trip') {
|
||||
Get.defaultDialog(
|
||||
title: 'Passenger Cancel Trip'.tr,
|
||||
middleText: '',
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Ok'.tr,
|
||||
onPressed: () {
|
||||
Get.offAll(HomeCaptain());
|
||||
}));
|
||||
} else if (message.notification!.title!
|
||||
.contains('DriverIsGoingToPassenger')) {
|
||||
Get.snackbar('Driver is Going To Passenger', '',
|
||||
@@ -201,7 +213,9 @@ class FirebaseMessagesController extends GetxController {
|
||||
'notification': <String, dynamic>{
|
||||
'title': title,
|
||||
'body': body,
|
||||
'sound': 'assets/notify.mp3'
|
||||
'sound': Platform.isAndroid
|
||||
? 'android/app/src/main/res/raw/tone1.mp3'
|
||||
: 'tone2.wav'
|
||||
},
|
||||
'priority': 'high',
|
||||
'data': <String, dynamic>{
|
||||
@@ -259,7 +273,9 @@ class FirebaseMessagesController extends GetxController {
|
||||
'notification': <String, dynamic>{
|
||||
'title': title,
|
||||
'body': body,
|
||||
'sound': 'assets/notify.mp3'
|
||||
'sound': Platform.isAndroid
|
||||
? 'android/app/src/main/res/raw/tone1.mp3'
|
||||
: 'tone2.wav'
|
||||
},
|
||||
'data': {
|
||||
'passengerList': map,
|
||||
@@ -296,7 +312,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
'notification': <String, dynamic>{
|
||||
'title': title,
|
||||
'body': body,
|
||||
'sound': 'assets/notify.mp3'
|
||||
'sound': Platform.isAndroid ? 'tone2' : 'tone2.wav'
|
||||
},
|
||||
'data': <String, dynamic>{
|
||||
'click_action': 'FLUTTER_NOTIFICATION_CLICK',
|
||||
@@ -335,7 +351,10 @@ class FirebaseMessagesController extends GetxController {
|
||||
'notification': <String, dynamic>{
|
||||
'title': title,
|
||||
'body': body,
|
||||
'sound': 'assets/notify.mp3'
|
||||
// 'sound': 'tone2.wav',
|
||||
'sound': Platform.isAndroid
|
||||
? 'android/app/src/main/res/raw/tone1.mp3'
|
||||
: 'tone2.wav'
|
||||
},
|
||||
'data': {
|
||||
'DriverList': data,
|
||||
|
||||
Reference in New Issue
Block a user