some changes

This commit is contained in:
Jonatas Antunes Messias 2024-06-25 09:25:26 -03:00
parent e524bdad7a
commit 09740150df
2 changed files with 21 additions and 7 deletions

View File

@ -3,6 +3,7 @@ import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:f_r_e_hub/app_state.dart'; 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/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:flutter/material.dart';
import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart';
@ -313,10 +314,9 @@ class NotificationHandler {
break; break;
case '': case '':
debugPrint('visit_response');
break; break;
case 'access': case 'access':
debugPrint('access'); _showAcessNotificationModal(message, context);
break; break;
case 'mensagem': case 'mensagem':
debugPrint('mensagem'); debugPrint('mensagem');
@ -332,6 +332,20 @@ class NotificationHandler {
void _showAcessNotificationModal( void _showAcessNotificationModal(
Map<String, dynamic> message, BuildContext context) { Map<String, dynamic> message, BuildContext context) {
debugPrint('Showing access notification dialog'); 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( void _showVisitRequestDialog(

View File

@ -131,11 +131,11 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter(
path: '/peopleOnThePropertyPage', path: '/peopleOnThePropertyPage',
builder: (context, params) => const PeopleOnThePropertyPageWidget(), builder: (context, params) => const PeopleOnThePropertyPageWidget(),
), ),
// FFRoute( FFRoute(
// name: 'acessHistoryPage', name: 'acessHistoryPage',
// path: '/acessHistoryPage', path: '/acessHistoryPage',
// builder: (context, params) => const AcessHistoryPageWidget(), builder: (context, params) => const AcessHistoryPageWidget(),
// ), ),
// FFRoute( // FFRoute(
// name: 'liberationHistory', // name: 'liberationHistory',
// path: '/liberationHistory', // path: '/liberationHistory',