7/17/2
This commit is contained in:
@@ -2,6 +2,7 @@ import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||
import 'package:SEFER/views/home/Captin/home_captain/widget/call_page.dart';
|
||||
import 'package:SEFER/views/widgets/mydialoug.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -18,6 +19,7 @@ import '../../views/home/Captin/home_captain/home_captin.dart';
|
||||
import '../../views/home/Captin/orderCaptin/order_speed_request.dart';
|
||||
import '../../views/home/Captin/orderCaptin/order_request_page.dart';
|
||||
import '../auth/google_sign.dart';
|
||||
import '../functions/face_detect.dart';
|
||||
import 'local_notification.dart';
|
||||
|
||||
class FirebaseMessagesController extends GetxController {
|
||||
@@ -90,7 +92,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
});
|
||||
}
|
||||
|
||||
void fireBaseTitles(RemoteMessage message) {
|
||||
Future<void> fireBaseTitles(RemoteMessage message) async {
|
||||
if (message.notification!.title! == 'Order'.tr) {
|
||||
if (Platform.isAndroid) {
|
||||
NotificationController().showNotification('Order'.tr, '', 'order');
|
||||
@@ -124,6 +126,32 @@ class FirebaseMessagesController extends GetxController {
|
||||
.showNotification('message From passenger', ''.tr, 'tone2');
|
||||
passengerDialog(message.notification!.body!);
|
||||
|
||||
update();
|
||||
} else if (message.notification!.title! == 'face detect') {
|
||||
NotificationController()
|
||||
.showNotification('face detect'.tr, ''.tr, 'tone2');
|
||||
String result0 = await faceDetector();
|
||||
// Handle the result here, e.g., show a dialog or update the UI
|
||||
var result = jsonDecode(result0);
|
||||
Get.defaultDialog(
|
||||
barrierDismissible: false,
|
||||
title: 'Face Detection Result'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: Text(
|
||||
result['similar'].toString() == 'true'
|
||||
? 'similar'.tr
|
||||
: 'not similar'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
backgroundColor: result['similar'].toString() == 'true'
|
||||
? AppColor.greenColor
|
||||
: AppColor.redColor,
|
||||
confirm: MyElevatedButton(
|
||||
title: 'OK'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
}));
|
||||
|
||||
update();
|
||||
} else if (message.notification!.title! == 'Hi ,I will go now') {
|
||||
// Get.snackbar('Hi ,I will go now', '',
|
||||
@@ -168,12 +196,18 @@ class FirebaseMessagesController extends GetxController {
|
||||
// // remoteID: driverList[2].toString(),
|
||||
// ));
|
||||
} catch (e) {}
|
||||
} else if (message.notification!.title! == "Criminal Document Required") {
|
||||
} else if (message.notification!.title! ==
|
||||
"Criminal Document Required".tr) {
|
||||
NotificationController().showNotification(
|
||||
"Criminal Document Required".tr,
|
||||
message.notification!.body!,
|
||||
'tone2',
|
||||
);
|
||||
MyDialog().getDialog(
|
||||
"Criminal Document Required".tr, 'You should have upload it .'.tr,
|
||||
() {
|
||||
Get.to(() => const CriminalDocumemtPage());
|
||||
});
|
||||
Get.to(() => const CriminalDocumemtPage());
|
||||
} else if (message.notification!.title! == 'Call End'.tr) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user