diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 87d8dd6f..1994e1c8 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -10,7 +10,7 @@
diff --git a/lib/app_state.dart b/lib/app_state.dart
index 0faaaeca..a0918b1c 100644
--- a/lib/app_state.dart
+++ b/lib/app_state.dart
@@ -1,6 +1,6 @@
import 'dart:ffi';
-import 'package:f_r_e_hub/flutter_flow/permissions_util.dart';
+import 'commons/widgets/permissions_util.dart';
import 'package:flutter/material.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:csv/csv.dart';
diff --git a/lib/backend/schema/structs/index.dart b/lib/backend/schema/structs/index.dart
deleted file mode 100644
index 4affa264..00000000
--- a/lib/backend/schema/structs/index.dart
+++ /dev/null
@@ -1,3 +0,0 @@
-export '/backend/schema/util/schema_util.dart';
-
-export 'device_struct.dart';
diff --git a/lib/actions/actions.dart b/lib/commons/actions/actions.dart
similarity index 77%
rename from lib/actions/actions.dart
rename to lib/commons/actions/actions.dart
index d25a5939..e63acea4 100644
--- a/lib/actions/actions.dart
+++ b/lib/commons/actions/actions.dart
@@ -1,20 +1,23 @@
import 'dart:convert';
+import 'dart:developer';
-import 'package:f_r_e_hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart';
-import 'package:f_r_e_hub/custom_code/actions/get_dev_u_u_i_d.dart';
-import 'package:f_r_e_hub/pages/home_page/home_page_widget.dart';
+// import 'package:hub/components/organisms/bottom_arrow_linked_locals/bottom_arrow_linked_locals_component_widget.dart';
+import 'package:hub/commons/components/templates/exception/widget.dart';
+import 'package:hub/modals/filters/selections/widget.dart';
+import 'package:hub/modals/selection/bottom_arrow_linked_locals/widget.dart';
+import 'package:hub/pages/home/model.dart';
+import 'package:hub/pages/home/widget.dart';
+import 'package:hub/commons/actions/get_dev_u_u_i_d.dart';
import 'package:flutter/material.dart';
import 'package:qr_flutter/qr_flutter.dart';
import 'package:sqflite/utils/utils.dart';
-import 'dart:developer';
-import '/actions/actions.dart' as action_blocks;
-import '/backend/api_requests/api_calls.dart';
-import '/components/molecular_components/throw_exception/throw_exception_widget.dart';
-import '/custom_code/actions/index.dart' as actions;
-import '/flutter_flow/flutter_flow_theme.dart';
-import '/flutter_flow/flutter_flow_util.dart';
-import '/flutter_flow/random_data_util.dart' as random_data;
+import '/commons/actions/actions.dart' as action_blocks;
+import '/commons/actions/api_calls.dart';
+import '/commons/actions/index.dart' as actions;
+import '/commons/widgets/flutter_flow_theme.dart';
+import '/commons/widgets/flutter_flow_util.dart';
+import '/commons/widgets/random_data_util.dart' as random_data;
Future repeatVisitScheduleAction(
BuildContext context, {
@@ -651,4 +654,140 @@ Widget buildQrCode(
// String escapeMECARD(String content) {
// // Implementação para escapar caracteres.
// return content.replaceAll(':', '\\:'); // Exemplo simplificado.
- // }
\ No newline at end of file
+ // }
+
+ /// menu
+
+ Future scheduleVisitOptAction(BuildContext context) async {
+ await showAdaptiveDialog(
+ context: context,
+ builder: (context) {
+ return Padding(
+ padding: MediaQuery.viewInsetsOf(context),
+ child: OptionSelectionModalWidget(
+ routesListStr: [
+ 'scheduleCompleteVisitPage',
+ 'scheduleProvisionalVisitPage',
+ 'fastPassPage',
+ ],
+ iconsListIcon: [
+ Icons.date_range_rounded,
+ Icons.date_range_rounded,
+ Icons.date_range_rounded,
+ ],
+ nameListStr: [
+ FFLocalizations.of(context).getVariableText(
+ ptText: 'Visita\nCompleta',
+ enText: 'Complete\nSchedule',
+ ),
+ FFLocalizations.of(context).getVariableText(
+ ptText: 'Visita\nProvisória',
+ enText: 'Provisional\nSchedule',
+ ),
+ FFLocalizations.of(context).getVariableText(
+ ptText: 'Visita\nRápida',
+ enText: 'Fast\nSchedule',
+ ),
+ ],
+ ),
+ );
+ },
+ );
+ }
+
+ Future registerVisitorOptAction(BuildContext context) async {
+ context.pushNamed(
+ 'registerVisitorPage',
+ extra: {
+ kTransitionInfoKey: const TransitionInfo(
+ hasTransition: true,
+ transitionType: PageTransitionType.scale,
+ alignment: Alignment.bottomCenter,
+ ),
+ },
+ );
+ }
+
+ Future peopleOnThePropertyAction(BuildContext context) async {
+ context.pushNamed(
+ 'peopleOnThePropertyPage',
+ extra: {
+ kTransitionInfoKey: const TransitionInfo(
+ hasTransition: true,
+ transitionType: PageTransitionType.fade,
+ ),
+ },
+ );
+ }
+
+ Future preferencesSettings(BuildContext context) async {
+ context.pushNamed(
+ 'preferencesSettings',
+ extra: {
+ kTransitionInfoKey: const TransitionInfo(
+ hasTransition: true,
+ transitionType: PageTransitionType.scale,
+ alignment: Alignment.bottomCenter,
+ ),
+ },
+ );
+ }
+
+ Future liberationHistoryOptAction(BuildContext context) async {
+ await showAdaptiveDialog(
+ // isScrollControlled: true,
+ // backgroundColor: Colors.transparent,
+ // enableDrag: false,
+ context: context,
+ builder: (context) {
+ return Padding(
+ padding: MediaQuery.viewInsetsOf(context),
+ child: OptionSelectionModalWidget(
+ routesListStr: [
+ 'liberationHistory',
+ 'acessHistoryPage',
+ 'scheduleCompleteVisitPage',
+ // 'messageHistoryPage',
+ ],
+ iconsListIcon: [
+ Icons.history_rounded,
+ Icons.history_rounded,
+ Icons.history_rounded,
+ // Icons.history_rounded,
+ ],
+ nameListStr: [
+ FFLocalizations.of(context).getVariableText(
+ ptText: 'Histórico\nde Liberação',
+ enText: 'Liberation\nHistory',
+ ),
+ FFLocalizations.of(context).getVariableText(
+ ptText: 'Histórico\nde Acesso',
+ enText: 'Access\nHistory',
+ ),
+ FFLocalizations.of(context).getVariableText(
+ ptText: 'Histórico\nde Visita',
+ enText: 'Visit\nHistory',
+ ),
+ // FFLocalizations.of(context).getVariableText(
+ // ptText: 'Histórico\nde Mensagens',
+ // enText: 'Message\nHistory',
+ // ),
+ ],
+ ),
+ );
+ },
+ );
+ }
+
+ Future accessQRCodeOptAction(BuildContext context) async {
+ context.pushNamed(
+ 'qrCodePage',
+ extra: {
+ kTransitionInfoKey: const TransitionInfo(
+ hasTransition: true,
+ transitionType: PageTransitionType.scale,
+ alignment: Alignment.bottomCenter,
+ ),
+ },
+ );
+ }
diff --git a/lib/backend/api_requests/api_calls.dart b/lib/commons/actions/api_calls.dart
similarity index 99%
rename from lib/backend/api_requests/api_calls.dart
rename to lib/commons/actions/api_calls.dart
index 15850cd4..67ec207f 100644
--- a/lib/backend/api_requests/api_calls.dart
+++ b/lib/commons/actions/api_calls.dart
@@ -4,7 +4,7 @@ import 'dart:developer';
import 'package:flutter/foundation.dart';
-import '/flutter_flow/flutter_flow_util.dart';
+import '/commons/widgets/flutter_flow_util.dart';
import 'api_manager.dart';
export 'api_manager.dart' show ApiCallResponse;
diff --git a/lib/backend/api_requests/api_manager.dart b/lib/commons/actions/api_manager.dart
similarity index 99%
rename from lib/backend/api_requests/api_manager.dart
rename to lib/commons/actions/api_manager.dart
index 1bb57424..dcb91c8a 100644
--- a/lib/backend/api_requests/api_manager.dart
+++ b/lib/commons/actions/api_manager.dart
@@ -11,7 +11,7 @@ import 'package:equatable/equatable.dart';
import 'package:http_parser/http_parser.dart';
import 'package:mime_type/mime_type.dart';
-import '/flutter_flow/uploaded_file.dart';
+import '/commons/widgets/uploaded_file.dart';
import 'get_streamed_response.dart';
diff --git a/lib/custom_code/actions/convert_image_file_to_base64.dart b/lib/commons/actions/convert_image_file_to_base64.dart
similarity index 51%
rename from lib/custom_code/actions/convert_image_file_to_base64.dart
rename to lib/commons/actions/convert_image_file_to_base64.dart
index 595a0468..19ff6095 100644
--- a/lib/custom_code/actions/convert_image_file_to_base64.dart
+++ b/lib/commons/actions/convert_image_file_to_base64.dart
@@ -1,15 +1,12 @@
// Automatic FlutterFlow imports
-import '/backend/schema/structs/index.dart';
-import '/backend/schema/enums/enums.dart';
-import '/actions/actions.dart' as action_blocks;
-import '/flutter_flow/flutter_flow_theme.dart';
-import '/flutter_flow/flutter_flow_util.dart';
+import '/commons/schema/structs/index.dart';
+import '/commons/schema/enums/enums.dart';
+import '/commons/actions/actions.dart' as action_blocks;
+import '/commons/widgets/flutter_flow_theme.dart';
+import '/commons/widgets/flutter_flow_util.dart';
import 'index.dart'; // Imports other custom actions
-import '/flutter_flow/custom_functions.dart'; // Imports custom functions
+import '/commons/widgets/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
-// Begin custom action code
-// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
-
import 'dart:convert';
import 'dart:typed_data';
diff --git a/lib/custom_code/actions/convert_to_upload_file.dart b/lib/commons/actions/convert_to_upload_file.dart
similarity index 73%
rename from lib/custom_code/actions/convert_to_upload_file.dart
rename to lib/commons/actions/convert_to_upload_file.dart
index da9e3dae..2ddde316 100644
--- a/lib/custom_code/actions/convert_to_upload_file.dart
+++ b/lib/commons/actions/convert_to_upload_file.dart
@@ -1,11 +1,11 @@
// Automatic FlutterFlow imports
-import '/backend/schema/structs/index.dart';
-import '/backend/schema/enums/enums.dart';
-import '/actions/actions.dart' as action_blocks;
-import '/flutter_flow/flutter_flow_theme.dart';
-import '/flutter_flow/flutter_flow_util.dart';
+import '/commons/schema/structs/index.dart';
+import '/commons/schema/enums/enums.dart';
+import '/commons/actions/actions.dart' as action_blocks;
+import '/commons/widgets/flutter_flow_theme.dart';
+import '/commons/widgets/flutter_flow_util.dart';
import 'index.dart'; // Imports other custom actions
-import '/flutter_flow/custom_functions.dart'; // Imports custom functions
+import '/commons/widgets/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom action code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
diff --git a/lib/custom_code/actions/get_dev_u_u_i_d.dart b/lib/commons/actions/get_dev_u_u_i_d.dart
similarity index 91%
rename from lib/custom_code/actions/get_dev_u_u_i_d.dart
rename to lib/commons/actions/get_dev_u_u_i_d.dart
index 7fb469f1..b9226900 100644
--- a/lib/custom_code/actions/get_dev_u_u_i_d.dart
+++ b/lib/commons/actions/get_dev_u_u_i_d.dart
@@ -1,13 +1,13 @@
-import '/backend/schema/structs/index.dart';
+import '/commons/schema/structs/index.dart';
import 'dart:developer';
-import '/backend/schema/enums/enums.dart';
-import '/actions/actions.dart' as action_blocks;
-import '/flutter_flow/flutter_flow_theme.dart';
-import '/flutter_flow/flutter_flow_util.dart';
+import '/commons/schema/enums/enums.dart';
+import '/commons/actions/actions.dart' as action_blocks;
+import '/commons/widgets/flutter_flow_theme.dart';
+import '/commons/widgets/flutter_flow_util.dart';
import 'index.dart'; // Imports other custom actions
-import '/flutter_flow/custom_functions.dart'; // Imports custom functions
+import '/commons/widgets/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
import 'dart:io';
import 'package:device_info_plus/device_info_plus.dart';
diff --git a/lib/backend/api_requests/get_streamed_response.dart b/lib/commons/actions/get_streamed_response.dart
similarity index 100%
rename from lib/backend/api_requests/get_streamed_response.dart
rename to lib/commons/actions/get_streamed_response.dart
diff --git a/lib/custom_code/actions/index.dart b/lib/commons/actions/index.dart
similarity index 60%
rename from lib/custom_code/actions/index.dart
rename to lib/commons/actions/index.dart
index 2110f043..0a097ef0 100644
--- a/lib/custom_code/actions/index.dart
+++ b/lib/commons/actions/index.dart
@@ -1,3 +1,6 @@
export 'convert_image_file_to_base64.dart' show convertImageFileToBase64;
export 'convert_to_upload_file.dart' show convertToUploadFile;
export 'get_dev_u_u_i_d.dart' show getDevUUID;
+export 'actions.dart' show Actions;
+export 'api_calls.dart' show ApiCalls;
+export 'api_manager.dart' show ApiManager;
diff --git a/lib/flutter_flow/nav/nav.dart b/lib/commons/actions/nav.dart
similarity index 89%
rename from lib/flutter_flow/nav/nav.dart
rename to lib/commons/actions/nav.dart
index 6eed8f03..955e4cce 100644
--- a/lib/flutter_flow/nav/nav.dart
+++ b/lib/commons/actions/nav.dart
@@ -1,15 +1,32 @@
import 'dart:async';
-import 'package:f_r_e_hub/pages/fast_pass_page/fast_pass_page_widget.dart';
-import 'package:f_r_e_hub/pages/message_history_page/message_history_page_widget.dart';
-import 'package:f_r_e_hub/pages/preferences_settings_page/preferences_settings_widget.dart';
-import 'package:flutter/material.dart';
-import 'package:provider/provider.dart';
+// import 'package:hub/pages/consult/access/acess_history_page_widget.dart';
+// import 'package:hub/pages/schedule/visit/fastpass/fast_pass_page_widget.dart';
+// import 'package:hub/pages/consult/message/message_history_page_widget.dart';
+// import 'package:hub/pages/settings/preferences_settings_widget.dart';
+// import 'package:hub/pages/consult/visit/visit_history_page_widget.dart';
-import '/backend/schema/structs/index.dart';
-import '/flutter_flow/flutter_flow_util.dart';
+import 'package:flutter/material.dart';
+import 'package:hub/pages/consults/access/widget.dart';
+import 'package:hub/pages/consults/liberation/widget.dart';
+import 'package:hub/pages/consults/message/widget.dart';
+import 'package:hub/pages/consults/poeple/widget.dart';
+import 'package:hub/pages/consults/qrcode/widget.dart';
+import 'package:hub/pages/consults/visit/widget.dart';
+import 'package:hub/pages/home/widget.dart';
+import 'package:hub/pages/onboarding/signin/widget.dart';
+import 'package:hub/pages/onboarding/signup/widget.dart';
+import 'package:hub/pages/onboarding/welcome/widget.dart';
+import 'package:hub/pages/registers/visitor/widget.dart';
+import 'package:hub/pages/schedules/visit/complete/widget.dart';
+import 'package:hub/pages/schedules/visit/fastpass/widget.dart';
+import 'package:hub/pages/schedules/visit/provisional/widget.dart';
+import 'package:hub/pages/settings/widget.dart';
+import 'package:provider/provider.dart';
+import '/commons/schema/structs/index.dart';
+import '/commons/widgets/flutter_flow_util.dart';
import '/index.dart';
-import '../../pages/visit_history_page/visit_history_page_widget.dart';
+// import '../../pages//visit_history_page_widget.dart';
export 'package:go_router/go_router.dart';
diff --git a/lib/backend/push_notification/pushNotificationService.dart b/lib/commons/actions/pushNotificationService.dart
similarity index 72%
rename from lib/backend/push_notification/pushNotificationService.dart
rename to lib/commons/actions/pushNotificationService.dart
index 8ec899a1..c8dfa7f5 100644
--- a/lib/backend/push_notification/pushNotificationService.dart
+++ b/lib/commons/actions/pushNotificationService.dart
@@ -4,18 +4,16 @@ import 'dart:developer';
import 'dart:io';
import 'dart:math' as math;
-import 'package:f_r_e_hub/actions/actions.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/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart';
-import 'package:f_r_e_hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart';
-import 'package:f_r_e_hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart';
-import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart';
-import 'package:f_r_e_hub/flutter_flow/flutter_flow_util.dart';
+import 'package:hub/commons/actions/api_calls.dart';
+import 'package:hub/commons/actions/actions.dart';
+import 'package:hub/app_state.dart';
+import 'package:hub/commons/actions/api_manager.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
-import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
+import 'package:hub/modals/notifications/access_notification/widget.dart';
+import 'package:hub/modals/notifications/message_notificaion/widget.dart';
+import 'package:hub/modals/notifications/visit_request/widget.dart';
import 'package:rxdart/rxdart.dart';
class PushNotificationService {
@@ -108,17 +106,17 @@ class PushNotificationService {
await Future.delayed(Duration(milliseconds: 100));
}
- const initializationSettingsAndroid = AndroidInitializationSettings('mipmap/ic_fre_black');
- const initializationSettingsIOS = DarwinInitializationSettings(
+ var initializationSettingsAndroid =
+ AndroidInitializationSettings('mipmap/ic_fre_black');
+ var initializationSettingsIOS = DarwinInitializationSettings(
requestAlertPermission: true,
requestBadgePermission: true,
requestSoundPermission: true,
);
- const initializationSettings = InitializationSettings(
+ var initializationSettings = InitializationSettings(
android: initializationSettingsAndroid,
iOS: initializationSettingsIOS,
);
-
_flutterLocalNotificationsPlugin.initialize(
initializationSettings,
onDidReceiveNotificationResponse: (NotificationResponse response) async {
@@ -187,17 +185,7 @@ class PushNotificationService {
_onMessage.add(message);
log('Extra: ${message.notification?.body}');
- Map extra = {};
- log('Message: ${message.data}');
-
- if (message.data['click_action'] == 'mensagem') {
- extra['body'] = message.notification?.body;
- }
-
- log('New Extra: $extra');
-
- NotificationHandler().handleMessage(message.data, context, extra: extra);
- });
+ NotificationHandler().handleMessage(message.data, context); });
}
void configureTokenRefresh() {
@@ -273,11 +261,8 @@ class PushNotificationService {
}
void _showNotification(RemoteMessage message) async {
- Map messageParsed = message.toMap();
- Map data = messageParsed['data'];
- Map notification = messageParsed['notification'];
-
- String channelId = _getChannelIdBasedOnClickAction(data['click_action']);
+ String channelId =
+ _getChannelIdBasedOnClickAction(message.data['click_action']);
var androidDetails = AndroidNotificationDetails(
channelId,
@@ -286,33 +271,19 @@ class PushNotificationService {
importance: Importance.max,
priority: Priority.high,
);
- var iOSDetails = const DarwinNotificationDetails(
- categoryIdentifier: 'plainCategory',
- sound: 'slow_spring_board.aiff',
- presentList: true,
- interruptionLevel: InterruptionLevel.critical,
- );
-
- var generalNotificationDetails = NotificationDetails(android: androidDetails, iOS: iOSDetails);
+ var iOSDetails = DarwinNotificationDetails();
+ var generalNotificationDetails =
+ NotificationDetails(android: androidDetails, iOS: iOSDetails);
log('Showing notification: ${message.messageId.hashCode}');
- log('Message Title: ${notification['title'].toString()}');
- log('Message Body: ${notification['body'].toString()}');
- log('Message Payload: ${data.toString()}');
-
await _flutterLocalNotificationsPlugin.show(
- DateTime.now().microsecond,
- notification['title'].toString(),
- notification['body'].toString(),
+ // DateTime.now().millisecondsSinceEpoch % (1 << 31),
+ math.Random().nextInt(1 << 30),
+ message.notification?.title,
+ message.notification?.body,
generalNotificationDetails,
- payload: data.toString(),
- ).catchError((err, stack) {
- log('Error: $err');
- log('Stack: $stack');
- });
-
-
-
+ payload: message.data.toString(),
+ );
}
_handleNotificationClick(Map payload, {Map extra = const {}}) {
@@ -347,15 +318,15 @@ class NotificationHandler {
switch (message['click_action']) {
case 'visit_request':
_showVisitRequestDialog(message, context);
+
break;
- case 'cancel_request':
- _showVisitRequestResolvedDialog(message, context);
+ case '':
break;
case 'access':
_showAcessNotificationModal(message, context);
break;
case 'mensagem':
- _showMessageNotificationDialog(message, context, extra);
+ _showMessageNotificationDialog(message, context, extra);
break;
case 'enroll_cond':
log('enroll_cond');
@@ -382,7 +353,6 @@ class NotificationHandler {
void _showAcessNotificationModal(
Map message, BuildContext context) {
log('Showing access notification dialog');
- log('Message: ${message}');
log('USR_TIPO: ${message['USR_TIPO']}');
log('USR_ID: ${message['USR_ID']}');
log('USR_DOCUMENTO: ${message['USR_DOCUMENTO']}');
@@ -390,27 +360,21 @@ class NotificationHandler {
context: context,
builder: (BuildContext context) {
String id = _getIdBasedOnUserType(message);
-
- return GestureDetector(
- onTap: () {
- Navigator.pop(context);
- },
- child: Dialog(
- backgroundColor: Colors.transparent,
- child: AccessNotificationModalTemplateComponentWidget(
- datetime: message['ACE_DATAHORA'].toString(),
- drive: message['SET_DESCRICAO'].toString(),
- id: message['USR_TIPO'].toString() == 'O'
- ? message['USR_ID'].toString() == ''
- ? '0'
- : message['USR_ID'].toString()
- : message['USR_DOCUMENTO'].toString() == ''
- ? '0'
- : message['USR_DOCUMENTO'].toString(),
- name: message['PES_NOME'].toString(),
- type: message['USR_TIPO'],
- )),
- );
+ return Dialog(
+ backgroundColor: Colors.transparent,
+ child: AccessNotificationModalTemplateComponentWidget(
+ datetime: message['ACE_DATAHORA'].toString(),
+ drive: message['ACI_DESCRICAO'].toString(),
+ id: message['USR_TIPO'].toString() == 'O'
+ ? message['USR_ID'].toString() == ''
+ ? '0'
+ : message['USR_ID'].toString()
+ : message['USR_DOCUMENTO'].toString() == ''
+ ? '0'
+ : message['USR_DOCUMENTO'].toString(),
+ name: message['PES_NOME'].toString(),
+ type: message['USR_TIPO'],
+ ));
},
);
}
@@ -419,31 +383,17 @@ class NotificationHandler {
Map message, BuildContext context, Map extra) {
log('Showing message notification dialog');
log('Notification "message": $message');
- log('Extra: $extra');
- Map local = {};
-
- try {
- local = jsonDecode(message['local']);
- } catch (err) {
- local = message['local'];
- }
-
showDialog(
useSafeArea: true,
context: context,
builder: (BuildContext context) {
- return GestureDetector(
- onTap: () {
- Navigator.pop(context);
- },
- child: Dialog(
- backgroundColor: Colors.transparent,
- child: MessageNotificationModalTemplateComponentWidget(
- id: local['CLI_ID'].toString(),
- from: message['remetente'].toString(),
- to: message['destinatario'].toString() == 'O' ? 'Morador' : 'Visitante',
- message: extra['body'].toString().isEmpty ? 'Unknown' : extra['body'].toString(),
- ),
+ return Dialog(
+ backgroundColor: Colors.transparent,
+ child: MessageNotificationModalTemplateComponentWidget(
+ id: message['local']['CLI_ID'].toString(),
+ from: message['remetente'].toString(),
+ to: message['destinatario'].toString() == 'O' ? 'Morador' : 'Visitante',
+ message: extra['body'].toString().isEmpty ? 'Unknown' : extra['body'].toString(),
),
);
},
@@ -474,35 +424,6 @@ class NotificationHandler {
},
);
}
-
- void _showVisitRequestResolvedDialog(
- Map message, BuildContext context) {
- log('Showing visit request notification dialog');
-
- showDialog(
- context: context,
- builder: (BuildContext context) {
-
- return GestureDetector(
- onTap: () {
- Navigator.pop(context);
- },
- child: Dialog(
- backgroundColor: Colors.transparent,
- child: VisitRequestTemplateComponentWidget(
- vteName: message['nomevisita'].toString(),
- vteReason: message['motivo'].toString(),
- vteMsg: message['resposta'].toString(),
- vteDocument: message['documento'].toString(),
- vteUUID: message['codvisita'].toString(),
- vawRef: message['referencia'].toString(),
- vawStatus: message['status'].toString(),
- ),
- ),
- );
- },
- );
- }
}
class PushNotificationManager {
diff --git a/lib/flutter_flow/nav/serialization_util.dart b/lib/commons/actions/serialization_util.dart
similarity index 96%
rename from lib/flutter_flow/nav/serialization_util.dart
rename to lib/commons/actions/serialization_util.dart
index f9665c41..6b04b1b2 100644
--- a/lib/flutter_flow/nav/serialization_util.dart
+++ b/lib/commons/actions/serialization_util.dart
@@ -3,12 +3,12 @@ import 'dart:developer';
import 'package:flutter/material.dart';
-import '/backend/schema/structs/index.dart';
-import '/backend/schema/enums/enums.dart';
+import '/commons/schema/structs/index.dart';
+import '/commons/schema/enums/enums.dart';
-import '../../flutter_flow/lat_lng.dart';
-import '../../flutter_flow/place.dart';
-import '../../flutter_flow/uploaded_file.dart';
+import '/commons/widgets/lat_lng.dart';
+import '/commons/widgets/place.dart';
+import '/commons/widgets/uploaded_file.dart';
/// SERIALIZATION HELPERS
diff --git a/lib/backend/push_notification/tapNotifcationActivity.dart b/lib/commons/actions/tapNotifcationActivity.dart
similarity index 95%
rename from lib/backend/push_notification/tapNotifcationActivity.dart
rename to lib/commons/actions/tapNotifcationActivity.dart
index 1ee22050..064ee82b 100644
--- a/lib/backend/push_notification/tapNotifcationActivity.dart
+++ b/lib/commons/actions/tapNotifcationActivity.dart
@@ -1,4 +1,4 @@
-// import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart';
+// import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart';
// import 'package:firebase_messaging/firebase_messaging.dart';
// import 'package:flutter/material.dart';
// import 'package:rxdart/rxdart.dart';
diff --git a/lib/commons/components/atoms/index.dart b/lib/commons/components/atoms/index.dart
new file mode 100644
index 00000000..e69de29b
diff --git a/lib/commons/components/atoms/local_header/index.dart b/lib/commons/components/atoms/local_header/index.dart
new file mode 100644
index 00000000..e69de29b
diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_model.dart b/lib/commons/components/atoms/local_header/model.dart
similarity index 63%
rename from lib/components/organism_components/local_profile_component/local_profile_component_model.dart
rename to lib/commons/components/atoms/local_header/model.dart
index 25442482..befb297d 100644
--- a/lib/components/organism_components/local_profile_component/local_profile_component_model.dart
+++ b/lib/commons/components/atoms/local_header/model.dart
@@ -1,5 +1,6 @@
-import '/flutter_flow/flutter_flow_util.dart';
-import 'local_profile_component_widget.dart' show LocalProfileComponentWidget;
+import 'package:hub/commons/components/atoms/local_header/widget.dart';
+
+import '/commons/widgets/flutter_flow_util.dart';
import 'package:flutter/material.dart';
class LocalProfileComponentModel
diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart b/lib/commons/components/atoms/local_header/widget.dart
similarity index 91%
rename from lib/components/organism_components/local_profile_component/local_profile_component_widget.dart
rename to lib/commons/components/atoms/local_header/widget.dart
index d8b1aff4..047ae944 100644
--- a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart
+++ b/lib/commons/components/atoms/local_header/widget.dart
@@ -1,15 +1,16 @@
-import 'package:f_r_e_hub/actions/actions.dart';
-import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart';
-import '/flutter_flow/flutter_flow_theme.dart';
-import '/flutter_flow/flutter_flow_util.dart';
-import '/flutter_flow/custom_functions.dart' as functions;
-import '/flutter_flow/random_data_util.dart' as random_data;
+
+import 'package:hub/commons/components/atoms/local_header/model.dart';
+import 'package:hub/modals/selection/bottom_arrow_linked_locals/widget.dart';
+
+import '/commons/widgets/flutter_flow_theme.dart';
+import '/commons/widgets/flutter_flow_util.dart';
+import '/commons/widgets/custom_functions.dart' as functions;
+import '/commons/widgets/random_data_util.dart' as random_data;
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';
-import 'local_profile_component_model.dart';
-export 'local_profile_component_model.dart';
+export 'model.dart';
class LocalProfileComponentWidget extends StatefulWidget {
const LocalProfileComponentWidget({
diff --git a/lib/commons/components/atoms/menu_button_item/index.dart b/lib/commons/components/atoms/menu_button_item/index.dart
new file mode 100644
index 00000000..e69de29b
diff --git a/lib/commons/components/atoms/menu_button_item/widget.dart b/lib/commons/components/atoms/menu_button_item/widget.dart
new file mode 100644
index 00000000..83388793
--- /dev/null
+++ b/lib/commons/components/atoms/menu_button_item/widget.dart
@@ -0,0 +1,147 @@
+import 'package:flutter/material.dart';
+import 'package:google_fonts/google_fonts.dart';
+import 'package:hub/commons/components/molecules/menu_item/widget.dart';
+import 'package:hub/commons/widgets/custom_icons.dart';
+import 'package:hub/commons/widgets/flutter_flow_theme.dart';
+import 'package:hub/commons/widgets/flutter_flow_util.dart';
+import 'package:hub/commons/widgets/internationalization.dart';
+
+
+
+
+class MenuButtonWidget extends MenuEntry {
+ const MenuButtonWidget({
+ Key? key,
+ this.action,
+ this.title,
+ this.icon,
+ }) : super(key: key);
+
+ final Function()? action;
+ final String? title;
+ final IconData? icon;
+
+ @override
+ _MenuButtonWidgetState createState() => _MenuButtonWidgetState();
+}
+
+class _MenuButtonWidgetState extends State {
+ @override
+ Widget build(BuildContext context) {
+ return InkWell(
+ splashColor: Colors.transparent,
+ focusColor: Colors.transparent,
+ hoverColor: Colors.transparent,
+ highlightColor: Colors.transparent,
+ onTap: () async {
+ await widget.action?.call();
+ },
+ child: Container(
+ width: 100.0,
+ height: 100.0,
+ decoration: BoxDecoration(
+ color:
+ FlutterFlowTheme.of(context).primaryBackground,
+ boxShadow: [
+ BoxShadow(
+ blurRadius: 4.0,
+ color:
+ FlutterFlowTheme.of(context).customColor5,
+ offset: const Offset(
+ 0.0,
+ 2.0,
+ ),
+ )
+ ],
+ borderRadius: BorderRadius.circular(24.0),
+ shape: BoxShape.rectangle,
+ border: Border.all(
+ color: FlutterFlowTheme.of(context).alternate,
+ width: 0.5,
+ ),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(4.0),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Align(
+ alignment:
+ const AlignmentDirectional(0.0, 0.0),
+ child: Row(
+ mainAxisSize: MainAxisSize.max,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Expanded(
+ child: Align(
+ alignment: const AlignmentDirectional(
+ -1.0, 0.0),
+ child: Padding(
+ padding: const EdgeInsetsDirectional
+ .fromSTEB(8.0, 0.0, 0.0, 0.0),
+ child: Container(
+ width: 30.0,
+ height: 30.0,
+ decoration: BoxDecoration(
+ color:
+ FlutterFlowTheme.of(context)
+ .primaryBackground,
+ shape: BoxShape.circle,
+ ),
+ alignment:
+ const AlignmentDirectional(
+ 0.0, 0.0),
+ child: Icon(
+ widget.icon,
+ color:
+ FlutterFlowTheme.of(context)
+ .accent1,
+ size: 24.0,
+ ),
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ Align(
+ alignment:
+ const AlignmentDirectional(0.0, 0.0),
+ child: Row(
+ mainAxisSize: MainAxisSize.min,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Align(
+ alignment: const AlignmentDirectional(
+ 0.0, 0.0),
+ child: Text(
+ widget.title ?? '',
+ style: FlutterFlowTheme.of(context)
+ .titleLarge
+ .override(
+ fontFamily: 'Nunito',
+ color:
+ FlutterFlowTheme.of(context)
+ .primaryText,
+ fontSize: 14.0,
+ letterSpacing: 0.0,
+ fontWeight: FontWeight.w500,
+ useGoogleFonts:
+ GoogleFonts.asMap()
+ .containsKey('Nunito'),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ].divide(const SizedBox(height: 0.0)),
+ ),
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/commons/components/atoms/menu_card_item/index.dart b/lib/commons/components/atoms/menu_card_item/index.dart
new file mode 100644
index 00000000..e69de29b
diff --git a/lib/commons/components/atoms/menu_card_item/widget.dart b/lib/commons/components/atoms/menu_card_item/widget.dart
new file mode 100644
index 00000000..5204dea7
--- /dev/null
+++ b/lib/commons/components/atoms/menu_card_item/widget.dart
@@ -0,0 +1,109 @@
+import 'package:flutter/material.dart';
+import 'package:google_fonts/google_fonts.dart';
+import 'package:hub/commons/components/molecules/menu_item/widget.dart';
+import 'package:hub/commons/widgets/custom_icons.dart';
+import 'package:hub/commons/widgets/flutter_flow_theme.dart';
+import 'package:hub/commons/widgets/flutter_flow_util.dart';
+
+
+
+
+class MenuButtonWidget extends MenuEntry {
+ const MenuButtonWidget({
+ Key? key,
+ this.action,
+ this.title,
+ this.icon,
+ }) : super(key: key);
+
+ final Function()? action;
+ final String? title;
+ final IconData? icon;
+
+ @override
+ _MenuButtonWidgetState createState() => _MenuButtonWidgetState();
+}
+
+class _MenuButtonWidgetState extends State {
+ @override
+ Widget build(BuildContext context) {
+ return InkWell(
+ splashColor: Colors.transparent,
+ focusColor: Colors.transparent,
+ hoverColor: Colors.transparent,
+ highlightColor: Colors.transparent,
+ onTap: () async {
+ await widget.action?.call();
+ },
+ child: Padding(
+ padding: const EdgeInsetsDirectional.fromSTEB(
+ 0.0, 0.0, 0.0, 1.0),
+ child: Container(
+ width: double.infinity,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(24.0),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(4.0),
+ child: Row(
+ mainAxisSize: MainAxisSize.max,
+ mainAxisAlignment:
+ MainAxisAlignment.spaceBetween,
+ children: [
+ Container(
+ width: 40.0,
+ height: 40.0,
+ decoration: const BoxDecoration(
+ shape: BoxShape.circle,
+ ),
+ child: Icon(
+ FFIcons.kfast,
+ color:
+ FlutterFlowTheme.of(context)
+ .primary,
+ size: 20.0,
+ ),
+ ),
+ Expanded(
+ child: Padding(
+ padding:
+ const EdgeInsetsDirectional
+ .fromSTEB(
+ 10.0, 0.0, 0.0, 0.0),
+ child: Text(
+ widget.title ?? 'Menu Item',
+ style: FlutterFlowTheme.of(
+ context)
+ .titleLarge
+ .override(
+ fontFamily: 'Nunito',
+ color:
+ FlutterFlowTheme.of(
+ context)
+ .primaryText,
+ fontSize: 15.0,
+ letterSpacing: 0.0,
+ fontWeight:
+ FontWeight.w500,
+ useGoogleFonts:
+ GoogleFonts.asMap()
+ .containsKey(
+ 'Nunito'),
+ ),
+ ),
+ ),
+ ),
+ Icon(
+ widget.icon,
+ color: FlutterFlowTheme.of(context)
+ .customColor1,
+ size: 24.0,
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/lib/commons/components/index.dart b/lib/commons/components/index.dart
new file mode 100644
index 00000000..e69de29b
diff --git a/lib/commons/components/molecules/card/index.dart b/lib/commons/components/molecules/card/index.dart
new file mode 100644
index 00000000..e69de29b
diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart b/lib/commons/components/molecules/card/model.dart
similarity index 62%
rename from lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart
rename to lib/commons/components/molecules/card/model.dart
index 3f35acf9..43508738 100644
--- a/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart
+++ b/lib/commons/components/molecules/card/model.dart
@@ -1,8 +1,8 @@
-import '/flutter_flow/flutter_flow_util.dart';
-import 'card_item_template_component_widget.dart'
- show CardItemTemplateComponentWidget;
+import '/commons/widgets/flutter_flow_util.dart';
import 'package:flutter/material.dart';
+import 'widget.dart';
+
class CardItemTemplateComponentModel
extends FlutterFlowModel {
@override
diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart b/lib/commons/components/molecules/card/widget.dart
similarity index 79%
rename from lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart
rename to lib/commons/components/molecules/card/widget.dart
index 41c28eee..47f1a027 100644
--- a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart
+++ b/lib/commons/components/molecules/card/widget.dart
@@ -1,14 +1,15 @@
import 'dart:collection';
import 'dart:developer';
-import '/flutter_flow/flutter_flow_theme.dart';
-import '/flutter_flow/flutter_flow_util.dart';
+import '/commons/widgets/flutter_flow_theme.dart';
+import '/commons/widgets/flutter_flow_util.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';
-import 'card_item_template_component_model.dart';
-export 'card_item_template_component_model.dart';
+
+import 'model.dart';
+export 'model.dart';
class CardItemTemplateComponentWidget extends StatefulWidget {
const CardItemTemplateComponentWidget({
@@ -20,8 +21,8 @@ class CardItemTemplateComponentWidget extends StatefulWidget {
});
final Map? labelsHashMap;
- final Map? statusHashMap;
- final Map imageHashMap; //document/vteID and type
+ final List