From 09740150df3cdc77536627c612b5a27492a2c2ee Mon Sep 17 00:00:00 2001 From: Jonatas Antunes Messias Date: Tue, 25 Jun 2024 09:25:26 -0300 Subject: [PATCH] some changes --- .../pushNotificationService.dart | 18 ++++++++++++++++-- lib/flutter_flow/nav/nav.dart | 10 +++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/lib/backend/push_notification/pushNotificationService.dart b/lib/backend/push_notification/pushNotificationService.dart index 1ef62371..aedc719f 100644 --- a/lib/backend/push_notification/pushNotificationService.dart +++ b/lib/backend/push_notification/pushNotificationService.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'dart:io'; import 'package:f_r_e_hub/app_state.dart'; import 'package:f_r_e_hub/backend/api_requests/api_calls.dart'; +import 'package:f_r_e_hub/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart'; import 'package:flutter/material.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; @@ -313,10 +314,9 @@ class NotificationHandler { break; case '': - debugPrint('visit_response'); break; case 'access': - debugPrint('access'); + _showAcessNotificationModal(message, context); break; case 'mensagem': debugPrint('mensagem'); @@ -332,6 +332,20 @@ class NotificationHandler { void _showAcessNotificationModal( Map message, BuildContext context) { debugPrint('Showing access notification dialog'); + showDialog( + context: context, + builder: (BuildContext context) { + return Dialog( + backgroundColor: Colors.transparent, + child: AccessNotificationModalTemplateComponentWidget( + datetime: message['ACE_DATAHORA'].toString(), + drive: message['ACI_DESCRICAO'].toString(), + id: message['PES_ID'].toString(), + name: message['PES_NOME'].toString(), + type: message['PES_TIPO'].toString(), + )); + }, + ); } void _showVisitRequestDialog( diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index 7a208a9a..5943a1d1 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -131,11 +131,11 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( path: '/peopleOnThePropertyPage', builder: (context, params) => const PeopleOnThePropertyPageWidget(), ), - // FFRoute( - // name: 'acessHistoryPage', - // path: '/acessHistoryPage', - // builder: (context, params) => const AcessHistoryPageWidget(), - // ), + FFRoute( + name: 'acessHistoryPage', + path: '/acessHistoryPage', + builder: (context, params) => const AcessHistoryPageWidget(), + ), // FFRoute( // name: 'liberationHistory', // path: '/liberationHistory',