chore: Refactor pushNotificationService.dart and home_page_widget.dart
This commit is contained in:
parent
ac1653fe5c
commit
20c8d9ab8f
|
@ -321,7 +321,7 @@ class NotificationHandler {
|
|||
case '':
|
||||
break;
|
||||
case 'access':
|
||||
_showAcessNotificationModal(message, context, extra);
|
||||
_showAcessNotificationModal(message, context);
|
||||
break;
|
||||
case 'mensagem':
|
||||
_showMessageNotificationDialog(message, context, extra);
|
||||
|
@ -349,7 +349,7 @@ class NotificationHandler {
|
|||
}
|
||||
|
||||
void _showAcessNotificationModal(
|
||||
Map<String, dynamic> message, BuildContext context, Map<String, dynamic> extra) {
|
||||
Map<String, dynamic> message, BuildContext context) {
|
||||
debugPrint('Showing access notification dialog');
|
||||
debugPrint('USR_TIPO: ${message['USR_TIPO']}');
|
||||
debugPrint('USR_ID: ${message['USR_ID']}');
|
||||
|
@ -382,6 +382,7 @@ class NotificationHandler {
|
|||
debugPrint('Showing message notification dialog');
|
||||
debugPrint('Notification "message": $message');
|
||||
showDialog(
|
||||
useSafeArea: true,
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return Dialog(
|
||||
|
@ -390,7 +391,7 @@ class NotificationHandler {
|
|||
id: message['local']['CLI_ID'].toString(),
|
||||
from: message['remetente'].toString(),
|
||||
to: message['destinatario'].toString() == 'O' ? 'Morador' : 'Visitante',
|
||||
message: extra['body'].toString(),
|
||||
message: extra['body'].toString().isEmpty ? 'Unknown' : extra['body'].toString(),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
|
|
@ -38,7 +38,7 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
|||
SchedulerBinding.instance.addPostFrameCallback((_) async {
|
||||
await PushNotificationService().initialize(context);
|
||||
|
||||
if (FFAppState().cliUUID == '') {
|
||||
if (FFAppState().cliUUID == null || FFAppState().cliUUID.isEmpty) {
|
||||
showModalBottomSheet(
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
|
|
Loading…
Reference in New Issue