diff --git a/assets/images/dark/login.svg b/assets/images/dark/login.svg new file mode 100644 index 00000000..6da3ef72 --- /dev/null +++ b/assets/images/dark/login.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/dark/login.svg:Zone.Identifier b/assets/images/dark/login.svg:Zone.Identifier new file mode 100644 index 00000000..1bf0b28e --- /dev/null +++ b/assets/images/dark/login.svg:Zone.Identifier @@ -0,0 +1,3 @@ +[ZoneTransfer] +ZoneId=3 +HostUrl=https://github.com/ diff --git a/assets/images/dark/welcome.svg b/assets/images/dark/welcome.svg new file mode 100644 index 00000000..c9043f96 --- /dev/null +++ b/assets/images/dark/welcome.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/dark/welcome.svg:Zone.Identifier b/assets/images/dark/welcome.svg:Zone.Identifier new file mode 100644 index 00000000..1bf0b28e --- /dev/null +++ b/assets/images/dark/welcome.svg:Zone.Identifier @@ -0,0 +1,3 @@ +[ZoneTransfer] +ZoneId=3 +HostUrl=https://github.com/ diff --git a/assets/images/light/login.svg b/assets/images/light/login.svg new file mode 100644 index 00000000..f6890b23 --- /dev/null +++ b/assets/images/light/login.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/light/login.svg:Zone.Identifier b/assets/images/light/login.svg:Zone.Identifier new file mode 100644 index 00000000..1bf0b28e --- /dev/null +++ b/assets/images/light/login.svg:Zone.Identifier @@ -0,0 +1,3 @@ +[ZoneTransfer] +ZoneId=3 +HostUrl=https://github.com/ diff --git a/assets/images/light/welcome.svg b/assets/images/light/welcome.svg new file mode 100644 index 00000000..8983fac0 --- /dev/null +++ b/assets/images/light/welcome.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/light/welcome.svg:Zone.Identifier b/assets/images/light/welcome.svg:Zone.Identifier new file mode 100644 index 00000000..1bf0b28e --- /dev/null +++ b/assets/images/light/welcome.svg:Zone.Identifier @@ -0,0 +1,3 @@ +[ZoneTransfer] +ZoneId=3 +HostUrl=https://github.com/ diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index d25a5939..5d80d184 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -1,20 +1,33 @@ -import 'dart:convert'; - -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: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 'package:hub/components/organisms/bottom_arrow_linked_locals/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/custom_code/actions/get_dev_u_u_i_d.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + +import 'package:flutter/material.dart'; +import 'package:hub/flutter_flow/random_data_util.dart'; +import 'package:hub/pages/home_page/home_page_model.dart'; +import 'package:qr_flutter/qr_flutter.dart'; + + + + +import 'package:url_launcher/url_launcher.dart'; + +Future openTermsOfUse(BuildContext context) async { + log('openTermsOfUse'); + final Uri url = Uri.parse('https://freaccess.com.br/pp/'); + if (!await launchUrl(url)) { + throw Exception('Could not launch $url'); + } +} Future repeatVisitScheduleAction( BuildContext context, { @@ -107,14 +120,14 @@ Future singInLoginAction( }), ]); if ((FFAppState().email != '') && (FFAppState().passwd != '')) { - devUUID = await actions.getDevUUID(); + devUUID = await getDevUUID(); FFAppState().devUUID = devUUID!; loginCall = await PhpGroup.loginCall.call( email: FFAppState().email, password: FFAppState().passwd, uuid: FFAppState().devUUID, type: FFAppState().device, - description: random_data.randomString( + description: randomString( 10, 10, true, @@ -148,7 +161,7 @@ Future singInLoginAction( )!; FFAppState().serialNumber = await getSerialNumber() ?? ''; FFAppState().isLogged = true; - await action_blocks.toggleHomePage(context); + await toggleHomePage(context); return; } else { await showModalBottomSheet( @@ -199,14 +212,14 @@ Future signUpRegisterAction( name: name, password: passwd, email: email, - token: random_data.randomString( + token: randomString( 36, 36, false, false, true, ), - uuid: random_data.randomString( + uuid: randomString( 36, 36, false, @@ -214,7 +227,7 @@ Future signUpRegisterAction( true, ), tipo: device, - descricao: random_data.randomString( + descricao: randomString( 36, 36, true, @@ -234,8 +247,8 @@ Future signUpRegisterAction( context: context, builder: (alertDialogContext) { return AlertDialog( - title: const Text('ERROR2'), - content: const Text('ERROR2'), + title: const Text('Error'), + content: Text('${registerCall?.jsonBody}'), actions: [ TextButton( onPressed: () => Navigator.pop(alertDialogContext), @@ -251,12 +264,21 @@ Future signUpRegisterAction( context: context, builder: (alertDialogContext) { return AlertDialog( - title: const Text('ERROR1'), - content: const Text('ERROR1'), + title: Text(FFLocalizations.of(context).getVariableText( + enText: 'Error', + ptText: 'Erro', + )), + content: Text(FFLocalizations.of(context).getVariableText( + enText: 'Please fill in all fields', + ptText: 'Por favor, preencha todos os campos', + )), actions: [ TextButton( onPressed: () => Navigator.pop(alertDialogContext), - child: const Text('ERROR1 '), + child: Text(FFLocalizations.of(context).getVariableText( + ptText: 'Fechar', + enText: 'Close', + )), ), ], ); @@ -311,6 +333,7 @@ Future toggleSignInPage(BuildContext context) async { } Future toggleSignUpPage(BuildContext context) async { + context.pushNamed( 'signUpPage', extra: { @@ -651,4 +674,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, + ), + }, + ); + } \ No newline at end of file diff --git a/lib/app_state.dart b/lib/app_state.dart index 0faaaeca..917fb812 100644 --- a/lib/app_state.dart +++ b/lib/app_state.dart @@ -1,11 +1,9 @@ -import 'dart:ffi'; +// import 'dart:ffi'; -import 'package:f_r_e_hub/flutter_flow/permissions_util.dart'; import 'package:flutter/material.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:csv/csv.dart'; import 'package:local_auth/local_auth.dart'; -import 'package:permission_handler/permission_handler.dart'; import 'package:synchronized/synchronized.dart'; class FFAppState extends ChangeNotifier { @@ -488,4 +486,4 @@ extension FlutterSecureStorageExtensions on FlutterSecureStorage { Future setStringList(String key, List value) async => await writeSync( key: key, value: const ListToCsvConverter().convert([value])); -} +} \ No newline at end of file diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index 15850cd4..2a8838ec 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -11,6 +11,7 @@ export 'api_manager.dart' show ApiCallResponse; const _kPrivateApiFunctionName = 'ffPrivateApiCall'; + /// Start PHP Group Code class PhpGroup { @@ -2432,4 +2433,4 @@ String _serializeJson(dynamic jsonVar, [bool isList = false]) { } return isList ? '[]' : '{}'; } -} +} \ No newline at end of file diff --git a/lib/backend/api_requests/api_manager.dart b/lib/backend/api_requests/api_manager.dart index 1bb57424..53340d4f 100644 --- a/lib/backend/api_requests/api_manager.dart +++ b/lib/backend/api_requests/api_manager.dart @@ -15,6 +15,9 @@ import '/flutter_flow/uploaded_file.dart'; import 'get_streamed_response.dart'; + + + enum ApiCallType { GET, POST, @@ -512,4 +515,4 @@ class ApiManager { return result; } -} +} \ No newline at end of file diff --git a/lib/backend/api_requests/get_streamed_response.dart b/lib/backend/api_requests/get_streamed_response.dart index 1a53aab0..303a19e5 100644 --- a/lib/backend/api_requests/get_streamed_response.dart +++ b/lib/backend/api_requests/get_streamed_response.dart @@ -1,4 +1,4 @@ import 'package:http/http.dart'; Future getStreamedResponse(Request request) => - Client().send(request); + Client().send(request); \ No newline at end of file diff --git a/lib/backend/push_notification/pushNotificationService.dart b/lib/backend/push_notification/pushNotificationService.dart index 8ec899a1..883a9338 100644 --- a/lib/backend/push_notification/pushNotificationService.dart +++ b/lib/backend/push_notification/pushNotificationService.dart @@ -4,20 +4,24 @@ 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: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/actions/actions.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart'; +import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart'; +import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; import 'package:rxdart/rxdart.dart'; +// + + class PushNotificationService { final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin = @@ -108,17 +112,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 { @@ -130,7 +134,7 @@ class PushNotificationService { log('Notification payload: $message'); var data = _notificationDetails; // Assuming getOnMessage() now returns the latest RemoteMessage log('Extra: ${data.value}'); - _handleNotificationClick(message, extra: data.value ?? {'extra': 'extra'}); + _handleNotificationClick(message, extra: data.value); } catch (e) { log('Error decoding notification payload: $e'); } @@ -187,17 +191,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 +267,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 +277,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 +324,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,35 +359,28 @@ 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']}'); showDialog( 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'], - )), - ); + _getIdBasedOnUserType(message); + 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 +389,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(), ), ); }, @@ -457,7 +413,7 @@ class NotificationHandler { showDialog( context: context, builder: (BuildContext context) { - String id = _getIdBasedOnUserType(message); + _getIdBasedOnUserType(message); return Dialog( backgroundColor: Colors.transparent, child: VisitRequestTemplateComponentWidget( @@ -465,8 +421,8 @@ class NotificationHandler { vteReason: message['motivo'] ?? 'Unknown', vteMsg: message['mensagem'] ?? 'Unknown', vteDocument: message['documento'] ?? '', - vteUUID: message['idVisitante'].toString() ?? '0', - vawRef: message['referencia'].toString() ?? '0', + vteUUID: message['idVisitante'].toString(), + vawRef: message['referencia'].toString(), vawStatus: 'S', changeStatusAction: changeStatusAction, ), @@ -474,35 +430,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 { @@ -523,4 +450,4 @@ class PushNotificationManager { } -} +} \ No newline at end of file diff --git a/lib/backend/schema/enums/enums.dart b/lib/backend/schema/enums/enums.dart index cfef83fe..64351084 100644 --- a/lib/backend/schema/enums/enums.dart +++ b/lib/backend/schema/enums/enums.dart @@ -5,6 +5,17 @@ enum AppHeaderComponent { home, } +enum MenuView { + list_grid, + list, + grid, +} + +enum MenuItem { + button, + card +} + extension FFEnumExtensions on T { String serialize() => name; } @@ -21,4 +32,4 @@ T? deserializeEnum(String? value) { default: return null; } -} +} \ No newline at end of file diff --git a/lib/backend/schema/structs/device_struct.dart b/lib/backend/schema/structs/device_struct.dart index bf1d6bf9..174afa98 100644 --- a/lib/backend/schema/structs/device_struct.dart +++ b/lib/backend/schema/structs/device_struct.dart @@ -1,9 +1,10 @@ // ignore_for_file: unnecessary_getters_setters -import '/backend/schema/util/schema_util.dart'; + +import 'package:hub/flutter_flow/nav/nav.dart'; import 'index.dart'; -import '/flutter_flow/flutter_flow_util.dart'; + class DeviceStruct extends BaseStruct { DeviceStruct({ @@ -110,4 +111,4 @@ DeviceStruct createDeviceStruct({ devUUID: devUUID, version: version, description: description, - ); + ); \ No newline at end of file diff --git a/lib/backend/schema/util/schema_util.dart b/lib/backend/schema/util/schema_util.dart index f1ad8a3f..80a9f7a4 100644 --- a/lib/backend/schema/util/schema_util.dart +++ b/lib/backend/schema/util/schema_util.dart @@ -2,9 +2,11 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:from_css_color/from_css_color.dart'; +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/serialization_util.dart'; + -import '/backend/schema/enums/enums.dart'; -import '/flutter_flow/flutter_flow_util.dart'; export 'package:collection/collection.dart' show ListEquality; export 'package:flutter/material.dart' show Color, Colors; @@ -77,4 +79,4 @@ List? getColorsList(dynamic value) => value is! List ? null : value.map(getSchemaColor).withoutNulls; List? getDataList(dynamic value) => - value is! List ? null : value.map((e) => castToType(e)!).toList(); + value is! List ? null : value.map((e) => castToType(e)!).toList(); \ No newline at end of file diff --git a/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart new file mode 100644 index 00000000..b0ee89d4 --- /dev/null +++ b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart @@ -0,0 +1,145 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/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: 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/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart b/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart new file mode 100644 index 00000000..f2173bfd --- /dev/null +++ b/lib/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart @@ -0,0 +1,199 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/preferences_settings_page/preferences_settings_model.dart'; +import 'package:provider/provider.dart'; + + +class PreferencesPageWidget extends StatelessWidget { + const PreferencesPageWidget({super.key}); + + @override + Widget build(BuildContext context) { + return ChangeNotifierProvider( + create: (_) => PreferencesPageModel(), + child: Consumer( + builder: (context, model, child) => GestureDetector( + onTap: () => model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Scaffold( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: AppBar( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + automaticallyImplyLeading: false, + forceMaterialTransparency: true, + leading: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: FlutterFlowTheme.of(context).primaryText, + size: 30.0, + ), + onPressed: () async { + context.pop(); + }, + ), + title: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Preferences', + ptText: 'Preferências', + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 17.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + centerTitle: true, + elevation: 0.0, + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Container(), + Expanded( + flex: 2, + child: ListView.builder( + // gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + // crossAxisCount: 3, + // crossAxisSpacing: 12.0, + // mainAxisSpacing: 12.0, + // childAspectRatio: 1.0, + // mainAxisExtent: 100.0, + // ), + itemCount: 6, // Assuming 4 items for simplicity + padding: const EdgeInsets.symmetric(horizontal: 20.0), + physics: const AlwaysScrollableScrollPhysics(), + itemBuilder: (BuildContext context, int index) { + return _buildIconButton(context, index, model); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } + + Widget _buildIconButton(BuildContext context, int index, PreferencesPageModel model) { + IconData icon; + Function() onPressed =() => {}; + bool isEnabled; + String content; + + switch (index) { + case 0: + icon = Icons.fingerprint; + onPressed = () => model.toggleFingerprint(context); // Disable if fingerprint is false + isEnabled = FFAppState().fingerprint; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative a autenticação por impressão digital para login seguro.', + enText: 'Enable fingerprint authentication for secure login.', + ); + break; + case 1: + icon = Icons.person; + onPressed = () => model.enablePerson(context); + isEnabled = FFAppState().person; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Exibir código de identificação remota', + enText: 'Display remote identification code', + ); + break; + case 2: + icon = Icons.notifications; + onPressed = model.toggleNotify; + isEnabled = FFAppState().notify; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para receber sua notificação de acesso', + enText: 'Enable to receive your access notification', + ); + break; + case 3: + icon = Icons.lock_clock_sharp; + // onLongPress = model.togglePass(context, model); + isEnabled = FFAppState().pass; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para inserir uma credencial de acesso para o QRCode', + enText: 'Enable to enter an access credential for the QRCode', + ); + break; + case 4: + icon = Icons.landscape; + onPressed = model.localLogout; + isEnabled = false; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para se desvincular do local selecionado', + enText: 'Enable to unlink from the selected location', + ); + break; + case 5: + icon = Icons.delete; + onPressed = () => model.deleteAccount(context); + isEnabled = false; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Delete sua conta e todos os dados associados permanentemente.', + enText: 'Delete your account and all associated data permanently.', + ); + break; + default: + throw Exception('Invalid index: $index'); + } + + return Container( + height: 100, + child: GestureDetector( + onTap: index != 3 ? onPressed : () {model.togglePass(context);}, + child: Row( + children: [ + CircleAvatar( + backgroundColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, + child: Icon( + icon, + color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, + // icon: Icon(icon, color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, size: 40.0), + // onPressed: index != 3 ? onPressed : () {model.togglePass(context);}, + // borderRadius: 20.0, + // borderWidth: 1.0, + // buttonSize: 40.0, + // fillColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, + // disabledColor: FlutterFlowTheme.of(context).alternate, + // disabledIconColor: FlutterFlowTheme.of(context).primary, + ), + ), + SizedBox(width: 8.0), + Expanded( + child: Text( + content, + style: FlutterFlowTheme.of(context).bodySmall.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + ), + overflow: TextOverflow.clip, + ), + ), + ], + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/components/atomic_components/text_field_component/text_field_component_model.dart b/lib/components/atomic_components/text_field_component/text_field_component_model.dart index 30f54431..a74572ce 100644 --- a/lib/components/atomic_components/text_field_component/text_field_component_model.dart +++ b/lib/components/atomic_components/text_field_component/text_field_component_model.dart @@ -2,6 +2,7 @@ import '/flutter_flow/flutter_flow_util.dart'; import 'text_field_component_widget.dart' show TextFieldComponentWidget; import 'package:flutter/material.dart'; + class TextFieldComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. @@ -19,4 +20,4 @@ class TextFieldComponentModel textFieldFocusNode?.dispose(); textController?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/atomic_components/text_field_component/text_field_component_widget.dart b/lib/components/atomic_components/text_field_component/text_field_component_widget.dart index e9ab116f..90a63614 100644 --- a/lib/components/atomic_components/text_field_component/text_field_component_widget.dart +++ b/lib/components/atomic_components/text_field_component/text_field_component_widget.dart @@ -5,6 +5,9 @@ import 'package:google_fonts/google_fonts.dart'; import 'text_field_component_model.dart'; export 'text_field_component_model.dart'; +//// + + class TextFieldComponentWidget extends StatefulWidget { const TextFieldComponentWidget({ super.key, @@ -114,4 +117,4 @@ class _TextFieldComponentWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/menu_item/menu_item.dart b/lib/components/molecular_components/menu_item/menu_item.dart new file mode 100644 index 00000000..1d2926b5 --- /dev/null +++ b/lib/components/molecular_components/menu_item/menu_item.dart @@ -0,0 +1,12 @@ + + +import 'package:flutter/material.dart'; + +abstract class MenuEntry extends StatefulWidget { + const MenuEntry({ + Key? key, + }) : super(key: key); + + + +} \ No newline at end of file diff --git a/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart b/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart index 51674c2a..0963fec9 100644 --- a/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart +++ b/lib/components/molecular_components/message_opt_modal/opt_modal_model.dart @@ -3,6 +3,7 @@ import '/flutter_flow/form_field_controller.dart'; import 'opt_modal_widget.dart' show OptModalWidget; import 'package:flutter/material.dart'; + class OptModalModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. @@ -28,4 +29,4 @@ class OptModalModel extends FlutterFlowModel { textFieldFocusNode?.dispose(); textController?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart index 551004ef..6b2df897 100644 --- a/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart +++ b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart @@ -1,8 +1,12 @@ -import 'package:f_r_e_hub/components/molecular_components/opt_modal/opt_modal_model.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_util.dart'; + import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; + class OptModalWidget extends StatefulWidget { final String defaultPersonType; @@ -61,9 +65,9 @@ class _OptModalWidgetState extends State { Map filterResult = { 'personType': '', 'accessType': '', - 'search': _model.textController.text == '' + 'search': _model.textController?.text == '' ? '.*' - : _model.textController.text.toLowerCase(), + : _model.textController!.text.toLowerCase(), }; if (selected['personType']!.isEmpty) { @@ -327,4 +331,4 @@ class _OptModalWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/opt_modal/opt_modal_model.dart b/lib/components/molecular_components/opt_modal/opt_modal_model.dart index 51674c2a..66133fb1 100644 --- a/lib/components/molecular_components/opt_modal/opt_modal_model.dart +++ b/lib/components/molecular_components/opt_modal/opt_modal_model.dart @@ -3,6 +3,8 @@ import '/flutter_flow/form_field_controller.dart'; import 'opt_modal_widget.dart' show OptModalWidget; import 'package:flutter/material.dart'; + + class OptModalModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. @@ -28,4 +30,4 @@ class OptModalModel extends FlutterFlowModel { textFieldFocusNode?.dispose(); textController?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/opt_modal/opt_modal_widget.dart b/lib/components/molecular_components/opt_modal/opt_modal_widget.dart index 551004ef..b2394f52 100644 --- a/lib/components/molecular_components/opt_modal/opt_modal_widget.dart +++ b/lib/components/molecular_components/opt_modal/opt_modal_widget.dart @@ -1,8 +1,10 @@ -import 'package:f_r_e_hub/components/molecular_components/opt_modal/opt_modal_model.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_util.dart'; + import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; class OptModalWidget extends StatefulWidget { final String defaultPersonType; @@ -61,9 +63,9 @@ class _OptModalWidgetState extends State { Map filterResult = { 'personType': '', 'accessType': '', - 'search': _model.textController.text == '' + 'search': _model.textController?.text == '' ? '.*' - : _model.textController.text.toLowerCase(), + : _model.textController!.text.toLowerCase(), }; if (selected['personType']!.isEmpty) { @@ -327,4 +329,4 @@ class _OptModalWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart b/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart index d9448232..38613124 100644 --- a/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart +++ b/lib/components/molecular_components/option_selection_modal/option_selection_modal_model.dart @@ -1,5 +1,7 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'option_selection_modal_widget.dart' show OptionSelectionModalWidget; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; class OptionSelectionModalModel @@ -9,4 +11,4 @@ class OptionSelectionModalModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart b/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart index ef4993fe..83093a34 100644 --- a/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart +++ b/lib/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart @@ -1,14 +1,14 @@ -// import 'package:f_r_e_hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; +// import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; +import 'package:go_router/go_router.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_animations.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_animations.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'option_selection_modal_model.dart'; -export 'option_selection_modal_model.dart'; class OptionSelectionModalWidget extends StatefulWidget { const OptionSelectionModalWidget({ @@ -217,4 +217,4 @@ class _OptionSelectionModalWidgetState extends State ), ); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/throw_exception/throw_exception_model.dart b/lib/components/molecular_components/throw_exception/throw_exception_model.dart index 31b6cee7..69ec5ec4 100644 --- a/lib/components/molecular_components/throw_exception/throw_exception_model.dart +++ b/lib/components/molecular_components/throw_exception/throw_exception_model.dart @@ -2,10 +2,12 @@ import '/flutter_flow/flutter_flow_util.dart'; import 'throw_exception_widget.dart' show ThrowExceptionWidget; import 'package:flutter/material.dart'; + + class ThrowExceptionModel extends FlutterFlowModel { @override void initState(BuildContext context) {} @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart index a4c60fa7..95333ddd 100644 --- a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart +++ b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart @@ -7,6 +7,8 @@ import 'package:google_fonts/google_fonts.dart'; import 'throw_exception_model.dart'; export 'throw_exception_model.dart'; +/// + class ThrowExceptionWidget extends StatefulWidget { const ThrowExceptionWidget({ super.key, @@ -160,4 +162,4 @@ class _ThrowExceptionWidgetState extends State ], ); } -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart index f89f479d..6827c26d 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart @@ -1,6 +1,7 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'visitor_not_found_component_widget.dart' - show VisitorNotFoundComponentWidget; +import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; class VisitorNotFoundComponentModel @@ -10,4 +11,4 @@ class VisitorNotFoundComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart index 115a6304..421d595f 100644 --- a/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart +++ b/lib/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart @@ -1,12 +1,15 @@ -import '/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; + +import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_model.dart'; +import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; + + import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'visitor_not_found_component_model.dart'; -export 'visitor_not_found_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; + class VisitorNotFoundComponentWidget extends StatefulWidget { const VisitorNotFoundComponentWidget({super.key}); @@ -174,4 +177,4 @@ class _VisitorNotFoundComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart index a63f3b06..ebbcaea4 100644 --- a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart +++ b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart @@ -1,6 +1,7 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'arrow_linked_locals_component_widget.dart' - show ArrowLinkedLocalsComponentWidget; +import 'package:hub/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart'; + +import '../../../flutter_flow/flutter_flow_model.dart'; + import 'package:flutter/material.dart'; class ArrowLinkedLocalsComponentModel @@ -10,4 +11,4 @@ class ArrowLinkedLocalsComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart index 0738f46c..d0a00a4f 100644 --- a/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart +++ b/lib/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_widget.dart @@ -1,7 +1,7 @@ -import '/flutter_flow/flutter_flow_util.dart'; import 'package:flutter/material.dart'; -import 'arrow_linked_locals_component_model.dart'; -export 'arrow_linked_locals_component_model.dart'; +import 'package:hub/components/organism_components/arrow_linked_locals_component/arrow_linked_locals_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + class ArrowLinkedLocalsComponentWidget extends StatefulWidget { const ArrowLinkedLocalsComponentWidget({super.key}); @@ -38,4 +38,4 @@ class _ArrowLinkedLocalsComponentWidgetState Widget build(BuildContext context) { return Container(); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart index f0b590e3..3ff8aba1 100644 --- a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart +++ b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart @@ -1,6 +1,7 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'bottom_arrow_linked_locals_component_widget.dart' - show BottomArrowLinkedLocalsComponentWidget; +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; class BottomArrowLinkedLocalsComponentModel @@ -10,4 +11,4 @@ class BottomArrowLinkedLocalsComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart index 40c14a58..267634c5 100644 --- a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart +++ b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart @@ -1,14 +1,19 @@ import 'dart:developer'; -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; + import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:provider/provider.dart'; -import 'bottom_arrow_linked_locals_component_model.dart'; -export 'bottom_arrow_linked_locals_component_model.dart'; + class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget { const BottomArrowLinkedLocalsComponentWidget({super.key}); @@ -194,10 +199,10 @@ class _BottomArrowLinkedLocalsComponentWidgetState topRight: Radius.circular(25.0), ), child: Image.network( - 'https://freaccess.com.br/freaccess/Images/Clients/${getJsonField( + "https://freaccess.com.br/freaccess/Images/Clients/${getJsonField( localItem, r'''$.CLI_ID''', - ).toString()}.png', + ).toString()}.png", width: double.infinity, height: double.infinity, fit: BoxFit.fill, @@ -253,4 +258,4 @@ class _BottomArrowLinkedLocalsComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_model.dart b/lib/components/organism_components/local_profile_component/local_profile_component_model.dart index 25442482..12c50d2f 100644 --- a/lib/components/organism_components/local_profile_component/local_profile_component_model.dart +++ b/lib/components/organism_components/local_profile_component/local_profile_component_model.dart @@ -2,6 +2,8 @@ import '/flutter_flow/flutter_flow_util.dart'; import 'local_profile_component_widget.dart' show LocalProfileComponentWidget; import 'package:flutter/material.dart'; +/// + class LocalProfileComponentModel extends FlutterFlowModel { @override @@ -9,4 +11,4 @@ class LocalProfileComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart index d8b1aff4..ab338b78 100644 --- a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart +++ b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart @@ -1,16 +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: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'; +//// + class LocalProfileComponentWidget extends StatefulWidget { const LocalProfileComponentWidget({ required bool localStatus, @@ -148,4 +148,4 @@ class _LocalProfileComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_component/menu_component_model.dart b/lib/components/organism_components/menu_component/menu_component_model.dart index b6aa80df..b2842e56 100644 --- a/lib/components/organism_components/menu_component/menu_component_model.dart +++ b/lib/components/organism_components/menu_component/menu_component_model.dart @@ -1,12 +1,14 @@ import 'package:flutter/material.dart'; -import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; +import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import '/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart'; -import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'menu_component_widget.dart' show MenuComponentWidget; + + class MenuComponentModel extends FlutterFlowModel { /// Local state fields for this component. @@ -128,13 +130,13 @@ class MenuComponentModel extends FlutterFlowModel { 'liberationHistory', 'acessHistoryPage', 'scheduleCompleteVisitPage', - // 'messageHistoryPage', + 'messageHistoryPage' ], iconsListIcon: [ Icons.history_rounded, Icons.history_rounded, Icons.history_rounded, - // Icons.history_rounded, + Icons.history_rounded, ], nameListStr: [ FFLocalizations.of(context).getVariableText( @@ -149,10 +151,10 @@ class MenuComponentModel extends FlutterFlowModel { ptText: 'Histórico\nde Visita', enText: 'Visit\nHistory', ), - // FFLocalizations.of(context).getVariableText( - // ptText: 'Histórico\nde Mensagens', - // enText: 'Message\nHistory', - // ), + FFLocalizations.of(context).getVariableText( + ptText: 'Histórico\nde Mensagens', + enText: 'Message\nHistory', + ), ], ), ); @@ -172,4 +174,19 @@ class MenuComponentModel extends FlutterFlowModel { }, ); } -} + + Future messageHistoryAction(BuildContext context) async { + context.pushNamed( + 'messageHistoryPage', + extra: { + kTransitionInfoKey: const TransitionInfo( + hasTransition: true, + transitionType: PageTransitionType.scale, + alignment: Alignment.bottomCenter, + ), + }, + ); + } + + +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_component/menu_component_widget.dart b/lib/components/organism_components/menu_component/menu_component_widget.dart index 20fca7e9..6803c748 100644 --- a/lib/components/organism_components/menu_component/menu_component_widget.dart +++ b/lib/components/organism_components/menu_component/menu_component_widget.dart @@ -1,3 +1,9 @@ +import 'dart:developer'; + +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + import '/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart'; import '/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; import '/flutter_flow/flutter_flow_util.dart'; @@ -5,8 +11,19 @@ import 'package:flutter/material.dart'; import 'menu_component_model.dart'; export 'menu_component_model.dart'; + class MenuComponentWidget extends StatefulWidget { - const MenuComponentWidget({super.key}); + const MenuComponentWidget({ + Key? key, + required this.style, + required this.item, + required this.expandable, + required this.options, + }); + final MenuView style; + final MenuItem item; + final bool expandable; + final List options; @override State createState() => _MenuComponentWidgetState(); @@ -36,16 +53,111 @@ class _MenuComponentWidgetState extends State { @override Widget build(BuildContext context) { + log('MenuComponentWidget: ${widget.options.toList().toString()}'); return Padding( padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), child: Builder( builder: (context) { - if (_model.isGrid == true) { + if (widget.style == MenuView.list_grid && widget.expandable == true && widget.item == MenuItem.button) { + if (_model.isGrid == true) { + return wrapWithModel( + model: _model.menuListViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuListViewComponentWidget( + options: widget.options, + expandable: widget.expandable, + item: widget.item, + + + changeMenuStyle: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + registerVisitorOptAction: () async { + await _model.registerVisitorOptAction(context); + setState(() {}); + }, + scheduleVisitOptAction: () async { + await _model.scheduleVisitOptAction(context); + setState(() {}); + }, + peopleOnThePropertyOptAction: () async { + await _model.peopleOnThePropertyAction(context); + setState(() {}); + }, + preferencesSettings: () async { + await _model.preferencesSettings(context); + setState(() {}); + }, + liberationHistoryOptAction: () async { + await _model.liberationHistoryOptAction(context); + setState(() {}); + }, + accessQRCodeOptAction: () async { + await _model.accessQRCodeOptAction(context); + setState(() {}); + }, + messageHistoryAction: () async { + await _model.messageHistoryAction(context); + setState(() {}); + }, + + ), + ); + } else { + return wrapWithModel( + model: _model.menuStaggeredViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuStaggeredViewComponentWidget( + changeMenuStyleAction: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + registerVisitorOptAction: () async { + await _model.registerVisitorOptAction(context); + setState(() {}); + }, + scheduleVisitOptAction: () async { + await _model.scheduleVisitOptAction(context); + setState(() {}); + }, + peopleOnThePropertyOptAction: () async { + await _model.peopleOnThePropertyAction(context); + setState(() {}); + }, + preferencesSettings: () async { + await _model.preferencesSettings(context); + setState(() {}); + }, + liberationHistoryOptAction: () async { + await _model.liberationHistoryOptAction(context); + setState(() {}); + }, + accessQRCodeOptAction: () async { + await _model.accessQRCodeOptAction(context); + setState(() {}); + }, + ), + ); + } + } + if (widget.style == MenuView.list && widget.expandable == false && widget.item == MenuItem.card){ return wrapWithModel( model: _model.menuListViewComponentModel, updateCallback: () => setState(() {}), updateOnChange: true, child: MenuListViewComponentWidget( + expandable: widget.expandable, + item: widget.item, + options: widget.options, + messageHistoryAction: () async { + await _model.messageHistoryAction(context); + setState(() {}); + }, + + changeMenuStyle: () async { await _model.changeMenuStyle(context); setState(() {}); @@ -74,46 +186,13 @@ class _MenuComponentWidgetState extends State { await _model.accessQRCodeOptAction(context); setState(() {}); }, - ), - ); - } else { - return wrapWithModel( - model: _model.menuStaggeredViewComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: MenuStaggeredViewComponentWidget( - changeMenuStyleAction: () async { - await _model.changeMenuStyle(context); - setState(() {}); - }, - registerVisitorOptAction: () async { - await _model.registerVisitorOptAction(context); - setState(() {}); - }, - scheduleVisitOptAction: () async { - await _model.scheduleVisitOptAction(context); - setState(() {}); - }, - peopleOnThePropertyOptAction: () async { - await _model.peopleOnThePropertyAction(context); - setState(() {}); - }, - preferencesSettings: () async { - await _model.preferencesSettings(context); - setState(() {}); - }, - liberationHistoryOptAction: () async { - await _model.liberationHistoryOptAction(context); - setState(() {}); - }, - accessQRCodeOptAction: () async { - await _model.accessQRCodeOptAction(context); - setState(() {}); - }, + + ), ); } - }, + return const SizedBox(); + }, ), ); } @@ -132,4 +211,4 @@ class _MenuComponentWidgetState extends State { } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart index 7ce9985b..027278ab 100644 --- a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart +++ b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_model.dart @@ -2,6 +2,8 @@ import '/flutter_flow/flutter_flow_util.dart'; import 'menu_list_view_component_widget.dart' show MenuListViewComponentWidget; import 'package:flutter/material.dart'; + + class MenuListViewComponentModel extends FlutterFlowModel { @override @@ -9,4 +11,4 @@ class MenuListViewComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart index 06154b38..d9418237 100644 --- a/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart +++ b/lib/components/organism_components/menu_list_view_component/menu_list_view_component_widget.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; -import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; -import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/components/atomic_components/menu_button_item/menu_button_item_widget.dart'; +import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; @@ -9,6 +10,9 @@ import 'menu_list_view_component_model.dart'; export 'menu_list_view_component_model.dart'; +/// + + class MenuListViewComponentWidget extends StatefulWidget { const MenuListViewComponentWidget({ super.key, @@ -19,8 +23,16 @@ class MenuListViewComponentWidget extends StatefulWidget { required this.preferencesSettings, required this.liberationHistoryOptAction, required this.accessQRCodeOptAction, + required this.expandable, + required this.item, + required this.options, + required this.messageHistoryAction, }); + final bool expandable; + final MenuItem item; + + final List options; final Future Function()? changeMenuStyle; final Future Function()? registerVisitorOptAction; final Future Function()? scheduleVisitOptAction; @@ -28,6 +40,7 @@ class MenuListViewComponentWidget extends StatefulWidget { final Future Function()? preferencesSettings; final Future Function()? liberationHistoryOptAction; final Future Function()? accessQRCodeOptAction; + final Future Function()? messageHistoryAction; @override State createState() => @@ -69,959 +82,94 @@ class _MenuListViewComponentWidgetState verticalDirection: VerticalDirection.down, clipBehavior: Clip.none, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(5.0, 0.0, 5.0, 0.0), - child: Container( - width: double.infinity, - height: 125.0, - decoration: const BoxDecoration(), - child: ListView( - padding: const EdgeInsets.fromLTRB( - 10.0, - 0, - 10.0, - 0, - ), - scrollDirection: Axis.horizontal, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.scheduleVisitOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - 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( - FFIcons.kvector1, - 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( - FFLocalizations.of(context).getText( - 'utgue9a5' /* Agendar -Visita */ - , - ), - 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)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.registerVisitorOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - 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( - FFIcons.kvector, - 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( - FFLocalizations.of(context).getText( - '82b5f8yz' /* Cadastrar -Visitante */ - , - ), - 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)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: Container( - width: 100.0, - height: double.infinity, - 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( - FFIcons.khome, - 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( - FFLocalizations.of(context).getText( - 't4ie13ut' /* Vincular -Condomínio */ - , - ), - 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)), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: Container( - width: 100.0, - height: double.infinity, - 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( - FFIcons.kpets, - 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( - FFLocalizations.of(context).getText( - 'n3n76pha' /* Cadastrar -Pet */ - , - ), - 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)), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.accessQRCodeOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - 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( - FFIcons.kvector2, - 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( - FFLocalizations.of(context).getText( - 'l6b9o7yn' /* QR Code -de Acesso */ - , - ), - 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)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.peopleOnThePropertyOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - 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( - Icons.people, - 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( - FFLocalizations.of(context).getText( - 'rxnrtdau' /* Pessoas na -Propriedade */ - , - ), - 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)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.liberationHistoryOptAction?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - 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( - Icons.history_sharp, - 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( - FFLocalizations.of(context) - .getVariableText( - ptText: 'Consultar\nConsultar', - enText: 'Consult\nHistories', - ), - 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)), - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 20.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await widget.preferencesSettings?.call(); - }, - child: Container( - width: 100.0, - height: double.infinity, - 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( - Icons.settings, - 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( - FFLocalizations.of(context).getVariableText( - enText: 'Preferences\nSystem', - ptText: 'Preferências\ndo Sistema', - ), - 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)), - ), - ), - ), - ), - ), - - ].divide(const SizedBox(width: 15.0)), - ), - ), - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - FFLocalizations.of(context).getVariableText( - enText: 'Expand', - ptText: 'Expandir', - ), - style: FlutterFlowTheme.of(context).title1.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 12.0, - fontWeight: FontWeight.w600, - fontStyle: FontStyle.normal, - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 20.0, - borderWidth: 0.0, - buttonSize: 50.0, - fillColor: const Color(0x00FFFFFF), - icon: Icon( - Icons.keyboard_arrow_down_outlined, - color: FlutterFlowTheme.of(context).primary, - ), - onPressed: () async { - await widget.changeMenuStyle?.call(); - }, - ), - ), - ], - ), + buildMenuItem(context), + if (widget.expandable) + buildExpandableButton(context), ], ); } + + Widget buildMenuItem(BuildContext context) { + switch(widget.item) { + case MenuItem.button: + return SizedBox( + height: 100, + width: double.infinity, + child: ListView.builder( + addAutomaticKeepAlives: true, + padding: EdgeInsets.zero, + shrinkWrap: true, + physics: const AlwaysScrollableScrollPhysics(), + scrollDirection: Axis.horizontal, + + itemCount: widget.options.length, + itemBuilder: (context, index) { + return SizedBox( + height: 115, + width: 115, + child: widget.options[index]); + }, + ), + ); + case MenuItem.card: + return ListView.builder( + addAutomaticKeepAlives: true, + padding: EdgeInsets.zero, + shrinkWrap: true, + physics: const AlwaysScrollableScrollPhysics(), + itemCount: widget.options.length, + itemBuilder: (context, index) { + return MenuButtonWidget( + action: widget.registerVisitorOptAction, + title: FFLocalizations.of(context).getVariableText( + enText: 'Register Visitor', + ptText: 'Registrar Visitante', + ), + icon: Icons.person_add_alt_1_outlined, + ); + }, + ); + } } + + Row buildExpandableButton(BuildContext context) { + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + FFLocalizations.of(context).getVariableText( + enText: 'Expand', + ptText: 'Expandir', + ), + style: FlutterFlowTheme.of(context).title1.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 12.0, + fontWeight: FontWeight.w600, + fontStyle: FontStyle.normal, + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 20.0, + borderWidth: 0.0, + buttonSize: 50.0, + fillColor: const Color(0x00FFFFFF), + icon: Icon( + Icons.keyboard_arrow_down_outlined, + color: FlutterFlowTheme.of(context).primary, + ), + onPressed: () async { + await widget.changeMenuStyle?.call(); + }, + ), + ), + ], + ); + } +} + diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart index 8aebfc69..4ee29584 100644 --- a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart +++ b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart @@ -1,8 +1,10 @@ +import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart'; + import '/flutter_flow/flutter_flow_util.dart'; -import 'menu_staggered_view_component_widget.dart' - show MenuStaggeredViewComponentWidget; + import 'package:flutter/material.dart'; + class MenuStaggeredViewComponentModel extends FlutterFlowModel { @override @@ -10,4 +12,4 @@ class MenuStaggeredViewComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart index 8e5441a3..35a411d6 100644 --- a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart +++ b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart @@ -3,13 +3,14 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_expandable_fab/flutter_expandable_fab.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_model.dart'; +import 'package:hub/flutter_flow/custom_icons.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'menu_staggered_view_component_model.dart'; - -export 'menu_staggered_view_component_model.dart'; class MenuStaggeredViewComponentWidget extends StatefulWidget { const MenuStaggeredViewComponentWidget({ @@ -1079,4 +1080,4 @@ Propriedade */ ], ); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/message_well_component/message_well_component_model.dart b/lib/components/organism_components/message_well_component/message_well_component_model.dart index 89ce0d76..e6b577de 100644 --- a/lib/components/organism_components/message_well_component/message_well_component_model.dart +++ b/lib/components/organism_components/message_well_component/message_well_component_model.dart @@ -1,10 +1,16 @@ -import 'package:f_r_e_hub/backend/api_requests/api_manager.dart'; -import 'package:f_r_e_hub/flutter_flow/request_manager.dart'; + +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'message_well_component_widget.dart' show MessageWellComponentWidget; import 'package:flutter/material.dart'; +/// + +import 'package:flutter/material.dart'; + + class MessageWellComponentModel extends FlutterFlowModel { final unfocusNode = FocusNode(); @@ -43,4 +49,4 @@ class MessageWellComponentModel clearGetLiberationsCache(); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/message_well_component/message_well_component_widget.dart b/lib/components/organism_components/message_well_component/message_well_component_widget.dart index 1a82d88f..29432952 100644 --- a/lib/components/organism_components/message_well_component/message_well_component_widget.dart +++ b/lib/components/organism_components/message_well_component/message_well_component_widget.dart @@ -2,16 +2,19 @@ import 'dart:async'; import 'dart:collection'; import 'dart:developer'; -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/flutter_flow/flutter_flow_theme.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_util.dart'; + import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:provider/provider.dart'; import 'package:rxdart/rxdart.dart'; +// + + final dropdown = BehaviorSubject>.seeded( LinkedHashMap.from({ 'All': 'A', @@ -340,4 +343,4 @@ class MessageWellNotifier extends StateNotifier { final messageWellProvider = StateNotifierProvider((ref) { return MessageWellNotifier(); -}); +}); \ No newline at end of file diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart index d30b8442..39705ca6 100644 --- a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart +++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart @@ -1,7 +1,9 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'schedule_visit_detail_widget.dart' show ScheduleVisitDetailWidget; +import 'package:hub/backend/api_requests/api_manager.dart'; + + import 'package:flutter/material.dart'; +import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; class ScheduleVisitDetailModel extends FlutterFlowModel { @@ -57,4 +59,4 @@ class ScheduleVisitDetailModel textFieldFocusNode6?.dispose(); textController6?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart index 9641ca52..935379ad 100644 --- a/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart +++ b/lib/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart @@ -1,16 +1,20 @@ -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/custom_functions.dart' as functions; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; + import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart'; +import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:provider/provider.dart'; -import 'schedule_visit_detail_model.dart'; -export 'schedule_visit_detail_model.dart'; + class ScheduleVisitDetailWidget extends StatefulWidget { const ScheduleVisitDetailWidget({ @@ -68,11 +72,11 @@ class _ScheduleVisitDetailWidgetState extends State { _model.textFieldFocusNode3 ??= FocusNode(); _model.textController4 ??= TextEditingController( - text: functions.extractDescToStr(widget.visitResonStr!)); + text: extractDescToStr(widget.visitResonStr!)); _model.textFieldFocusNode4 ??= FocusNode(); _model.textController5 ??= TextEditingController( - text: functions.extractDescToStr(widget.visitLevelStr!)); + text: extractDescToStr(widget.visitLevelStr!)); _model.textFieldFocusNode5 ??= FocusNode(); _model.textController6 ??= TextEditingController(text: widget.visitObsStr); @@ -225,10 +229,10 @@ class _ScheduleVisitDetailWidgetState extends State { const Duration(milliseconds: 500), imageUrl: valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( visitorsDataItem, r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', + ).toString()}&tipo=E", 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', ), width: 100.0, @@ -931,8 +935,8 @@ class _ScheduleVisitDetailWidgetState extends State { dtFim: widget.visitEndDate, unica: widget.visitTempStr, idMotivo: - functions.extractIdToStr(widget.visitResonStr!), - idNAC: functions.extractIdToStr(widget.visitLevelStr!), + extractIdToStr(widget.visitResonStr!), + idNAC: extractIdToStr(widget.visitLevelStr!), obs: widget.visitObsStr, cliID: FFAppState().cliUUID, ); @@ -977,4 +981,4 @@ class _ScheduleVisitDetailWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart index e4db1d96..54f840ca 100644 --- a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart +++ b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart @@ -1,6 +1,7 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'up_arrow_linked_locals_component_widget.dart' - show UpArrowLinkedLocalsComponentWidget; +import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; class UpArrowLinkedLocalsComponentModel @@ -10,4 +11,4 @@ class UpArrowLinkedLocalsComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart index fea22bdb..968b22f9 100644 --- a/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart +++ b/lib/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_widget.dart @@ -1,12 +1,16 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; + +import 'package:hub/components/organism_components/up_arrow_linked_locals_component/up_arrow_linked_locals_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; + + import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'up_arrow_linked_locals_component_model.dart'; -export 'up_arrow_linked_locals_component_model.dart'; + class UpArrowLinkedLocalsComponentWidget extends StatefulWidget { const UpArrowLinkedLocalsComponentWidget({super.key}); @@ -240,4 +244,4 @@ class _UpArrowLinkedLocalsComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart index b0f33c80..f9ee4e21 100644 --- a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart +++ b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_model.dart @@ -4,6 +4,7 @@ import 'access_notification_modal_template_component_widget.dart' show AccessNotificationModalTemplateComponentWidget; import 'package:flutter/material.dart'; + class AccessNotificationModalTemplateComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. diff --git a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart index 789b1b44..a8d77589 100644 --- a/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart +++ b/lib/components/templates_components/access_notification_modal_template_component/access_notification_modal_template_component_widget.dart @@ -7,6 +7,9 @@ import 'package:provider/provider.dart'; import 'access_notification_modal_template_component_model.dart'; export 'access_notification_modal_template_component_model.dart'; + + + class AccessNotificationModalTemplateComponentWidget extends StatefulWidget { const AccessNotificationModalTemplateComponentWidget({ super.key, @@ -380,4 +383,4 @@ class _AccessNotificationModalTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart index 3f35acf9..032a1f68 100644 --- a/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart +++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_model.dart @@ -3,6 +3,7 @@ import 'card_item_template_component_widget.dart' show CardItemTemplateComponentWidget; import 'package:flutter/material.dart'; + class CardItemTemplateComponentModel extends FlutterFlowModel { @override @@ -10,4 +11,4 @@ class CardItemTemplateComponentModel @override void dispose() {} -} +} \ No newline at end of file diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart index 41c28eee..a1e4cfc6 100644 --- a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart +++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart @@ -10,6 +10,10 @@ import 'package:provider/provider.dart'; import 'card_item_template_component_model.dart'; export 'card_item_template_component_model.dart'; +/// + + + class CardItemTemplateComponentWidget extends StatefulWidget { const CardItemTemplateComponentWidget({ super.key, @@ -20,8 +24,8 @@ class CardItemTemplateComponentWidget extends StatefulWidget { }); final Map? labelsHashMap; - final Map? statusHashMap; - final Map imageHashMap; //document/vteID and type + final List?> statusHashMap; + final Map imageHashMap; final Future Function()? onTapCardItemAction; @override @@ -35,8 +39,8 @@ class _CardItemTemplateComponentWidgetState LinkedHashMap get labelsLinkedHashMap => LinkedHashMap.from(widget.labelsHashMap ?? {}); - LinkedHashMap get statusLinkedHashMap => - LinkedHashMap.from(widget.statusHashMap ?? {}); + List> get statusLinkedHashMap => + widget.statusHashMap.map((map) => LinkedHashMap.from(map ?? {})).toList(); @override void setState(VoidCallback callback) { @@ -70,7 +74,8 @@ class _CardItemTemplateComponentWidgetState @override Widget build(BuildContext context) { context.watch(); - log('imageHashMap: ${widget.imageHashMap}'); + + return InkWell( splashColor: Colors.transparent, @@ -178,36 +183,40 @@ class _CardItemTemplateComponentWidgetState }, ), ), - Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: - const EdgeInsets.symmetric(vertical: 3.0), - child: Container( - width: 200.0, - height: 27.0, - decoration: BoxDecoration( - color: statusLinkedHashMap.values.first, - borderRadius: BorderRadius.circular(5.0), - ), - child: Align( - alignment: Alignment.center, - child: Text( - statusLinkedHashMap.keys - .first, // Acessa diretamente a chave como texto do status - style: TextStyle( - // Substitua por seu tema ou estilo de texto - color: FlutterFlowTheme.of(context) - .info, // Cor do texto, ajuste conforme necessário + Row( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: statusLinkedHashMap.expand((linkedHashMap) { + return linkedHashMap.entries.map((MapEntry item) { + return Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 1.0, vertical: 3.0), + child: Container( + width: 100.0, + height: 27.0, + decoration: BoxDecoration( + color: item.value, // Usa a cor do item atual + borderRadius: BorderRadius.circular(5.0), + ), + child: Align( + alignment: Alignment.center, + child: Text( + item.key, // Usa a chave do item atual como texto + style: TextStyle( + color: FlutterFlowTheme.of(context).info, // Ajuste conforme necessário + ), + ), + ), ), ), - ), + ], ), - ), - ], - ), + ); + }).toList(); + }).toList(), ), ]), ), @@ -236,4 +245,4 @@ class _CardItemTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart index c2febab7..25cc4529 100644 --- a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart +++ b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_model.dart @@ -3,6 +3,7 @@ import 'change_pass_widget.dart' show PassKeyTemplateWidget; import 'package:flutter/material.dart'; + class PassKeyTemplateComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. @@ -19,11 +20,16 @@ class PassKeyTemplateComponentModel String? Function(BuildContext, String?)? keyTextFieldTextControllerValidator2; String? _keyTextFieldTextControllerValidator( BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'f128ajey' /* Field is required */, + if (val == null || val.isEmpty ) { + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', ); } + if ( val.length < 4 ) return FFLocalizations.of(context).getVariableText( + enText: 'This field must have at least 4 characters', + ptText: 'Este campo deve ter pelo menos 4 caracteres', + ); return null; } @@ -42,4 +48,4 @@ class PassKeyTemplateComponentModel keyTextFieldTextController1?.dispose(); keyTextFieldTextController2?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart index 5c19dfb3..02ae2c83 100644 --- a/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart +++ b/lib/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart @@ -1,3 +1,5 @@ +import 'package:hub/flutter_flow/nav/nav.dart'; + import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; @@ -8,6 +10,7 @@ import 'package:google_fonts/google_fonts.dart'; import 'change_pass_model.dart'; export 'change_pass_model.dart'; + class PassKeyTemplateWidget extends StatefulWidget { const PassKeyTemplateWidget({ super.key, @@ -126,7 +129,7 @@ class _PassKeyTemplateWidgetState child: Text( FFLocalizations.of(context).getVariableText( enText: 'INSERT PASSWORD', - ptText: 'ADICIONAR SENHA', + ptText: FFAppState().accessPass != '' ? 'ALTERAR SENHA' : 'ADICIONAR SENHA', ), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Outfit', @@ -158,7 +161,7 @@ class _PassKeyTemplateWidgetState ), Form( key: _model.formKey, - autovalidateMode: AutovalidateMode.always, + autovalidateMode: AutovalidateMode.onUserInteraction, child: Column( children: [ Padding( @@ -166,101 +169,28 @@ class _PassKeyTemplateWidgetState child: SizedBox( width: double.infinity, child: TextFormField( - controller: _model.keyTextFieldTextController1, - focusNode: _model.keyTextFieldFocusNode1, - onChanged: (_) => EasyDebounce.debounce( - '_model.keyTextFieldTextController', - const Duration(milliseconds: 2000), - () { - if (mounted) setState(() {}); - }, - ), - autofillHints: const [AutofillHints.password], - textCapitalization: TextCapitalization.none, - textInputAction: TextInputAction.done, - obscureText: !_model.keyTextFieldVisibility1, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getVariableText( - ptText: 'Senha', - enText: 'Password', + controller: _model.keyTextFieldTextController1, + focusNode: _model.keyTextFieldFocusNode1, + onChanged: (_) => EasyDebounce.debounce( + '_model.keyTextFieldTextController', + const Duration(milliseconds: 2000), + () { + if (mounted) setState(() {}); + }, ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primary, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Digite a sua senha.....', - enText: 'Enter your password.....', - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent3, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.0, - ), - borderRadius: BorderRadius.circular(12.0), - ), - filled: true, - fillColor: - FlutterFlowTheme.of(context).primaryBackground, - contentPadding: - const EdgeInsetsDirectional.fromSTEB( - 24.0, 24.0, 20.0, 24.0), - suffixIcon: InkWell( - onTap: () => setState( - () => _model.keyTextFieldVisibility1 = - !_model.keyTextFieldVisibility1, - ), - focusNode: FocusNode(skipTraversal: true), - child: Icon( - _model.keyTextFieldVisibility1 - ? Icons.visibility_outlined - : Icons.visibility_off_outlined, - color: FlutterFlowTheme.of(context).accent1, - size: 22.0, - ), - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( + autofillHints: const [AutofillHints.password], + textCapitalization: TextCapitalization.none, + textInputAction: TextInputAction.done, + obscureText: !_model.keyTextFieldVisibility1, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getVariableText( + ptText: 'Senha', + enText: 'Password', + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, fontSize: 14.0, @@ -268,20 +198,94 @@ class _PassKeyTemplateWidgetState fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() .containsKey('Plus Jakarta Sans'), + ), + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Digite a sua senha.....', + enText: 'Enter your password.....', + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.0, + ), + borderRadius: BorderRadius.circular(12.0), + ), + filled: true, + fillColor: + FlutterFlowTheme.of(context).primaryBackground, + contentPadding: + const EdgeInsetsDirectional.fromSTEB( + 24.0, 24.0, 20.0, 24.0), + suffixIcon: InkWell( + onTap: () => setState( + () => _model.keyTextFieldVisibility1 = + !_model.keyTextFieldVisibility1, + ), + focusNode: FocusNode(skipTraversal: true), + child: Icon( + _model.keyTextFieldVisibility1 + ? Icons.visibility_outlined + : Icons.visibility_off_outlined, + color: FlutterFlowTheme.of(context).accent1, + size: 22.0, + ), + ), ), - maxLength: 4, - maxLengthEnforcement: MaxLengthEnforcement.enforced, - buildCounter: (context, - {required currentLength, - required isFocused, - maxLength}) => - null, - keyboardType: TextInputType.number, - cursorColor: FlutterFlowTheme.of(context).primary, - validator: _model.keyTextFieldTextControllerValidator1 - .asValidator(context), - inputFormatters: [ + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + maxLength: 4, + maxLengthEnforcement: MaxLengthEnforcement.enforced, + buildCounter: (context, + {required currentLength, + required isFocused, + maxLength}) => + null, + keyboardType: TextInputType.number, + cursorColor: FlutterFlowTheme.of(context).primary, + validator: _model.keyTextFieldTextControllerValidator1 + .asValidator(context), + inputFormatters: [ FilteringTextInputFormatter.allow(RegExp('[0-9]')), + LengthLimitingTextInputFormatter(4), ], ), ), @@ -340,4 +344,4 @@ class _PassKeyTemplateWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart index 4178de7c..4b79c7c0 100644 --- a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart +++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart @@ -4,6 +4,8 @@ import 'forgot_password_template_component_widget.dart' show ForgotPasswordTemplateComponentWidget; import 'package:flutter/material.dart'; + + class ForgotPasswordTemplateComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. @@ -23,4 +25,4 @@ class ForgotPasswordTemplateComponentModel emailAddressFocusNode?.dispose(); emailAddressTextController?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart index 39cce295..156672de 100644 --- a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart +++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart @@ -1,3 +1,5 @@ +import 'package:hub/flutter_flow/nav/nav.dart'; + import '/backend/api_requests/api_calls.dart'; import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; import '/flutter_flow/flutter_flow_theme.dart'; @@ -8,6 +10,9 @@ import 'package:google_fonts/google_fonts.dart'; import 'forgot_password_template_component_model.dart'; export 'forgot_password_template_component_model.dart'; +// + + class ForgotPasswordTemplateComponentWidget extends StatefulWidget { const ForgotPasswordTemplateComponentWidget({super.key}); @@ -310,4 +315,4 @@ class _ForgotPasswordTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart index 009f0a84..6612b45a 100644 --- a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart +++ b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart @@ -1,7 +1,10 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'liberation_history_item_details_template_component_widget.dart' - show LiberationHistoryItemDetailsTemplateComponentWidget; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart'; + +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + import 'package:flutter/material.dart'; class LiberationHistoryItemDetailsTemplateComponentModel @@ -75,4 +78,4 @@ class LiberationHistoryItemDetailsTemplateComponentModel return false; } } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart index bf7b6a1b..025df6e5 100644 --- a/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart +++ b/lib/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_widget.dart @@ -1,11 +1,13 @@ -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/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:hub/app_state.dart'; +import 'package:hub/components/templates_components/liberation_history_item_details_template_component/liberation_history_item_details_template_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:provider/provider.dart'; -import 'liberation_history_item_details_template_component_model.dart'; -export 'liberation_history_item_details_template_component_model.dart'; class LiberationHistoryItemDetailsTemplateComponentWidget extends StatefulWidget { @@ -363,4 +365,4 @@ class _LiberationHistoryItemDetailsTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart index 2e5bc0c6..0bcc4038 100644 --- a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart +++ b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart @@ -1,8 +1,10 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'message_notification_widget.dart' - show MessageNotificationModalTemplateComponentWidget; + import 'package:flutter/material.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; class MessageNotificationModalTemplateComponentModel extends FlutterFlowModel { @@ -74,4 +76,4 @@ class MessageNotificationModalTemplateComponentModel return false; } } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart index 3a67f3dd..964a9cd7 100644 --- a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart +++ b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart @@ -1,10 +1,15 @@ -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.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 'message_notification_model.dart'; class MessageNotificationModalTemplateComponentWidget extends StatefulWidget { const MessageNotificationModalTemplateComponentWidget({ @@ -285,4 +290,4 @@ class _MessageNotificationModalTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart index 4e3f3260..da0ca0a5 100644 --- a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart +++ b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_model.dart @@ -16,10 +16,15 @@ class QrCodePassKeyTemplateComponentModel String? _keyTextFieldTextControllerValidator( BuildContext context, String? val) { if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'f128ajey' /* Field is required */, + return FFLocalizations.of(context).getVariableText( + enText: 'This field is required', + ptText: 'Este campo é obrigatório', ); } + if (val.length < 4) return FFLocalizations.of(context).getVariableText( + enText: 'This field must be at least 4 characters', + ptText: 'Este campo deve ter pelo menos 4 caracteres', + ); return null; } diff --git a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart index c2d27cca..9fcaa067 100644 --- a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart +++ b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart @@ -1,3 +1,5 @@ +import 'package:hub/flutter_flow/nav/nav.dart'; + import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; @@ -8,6 +10,9 @@ import 'package:google_fonts/google_fonts.dart'; import 'qr_code_pass_key_template_component_model.dart'; export 'qr_code_pass_key_template_component_model.dart'; + + + class QrCodePassKeyTemplateComponentWidget extends StatefulWidget { const QrCodePassKeyTemplateComponentWidget({ super.key, @@ -38,7 +43,7 @@ class _QrCodePassKeyTemplateComponentWidgetState _model.keyTextFieldTextController ??= TextEditingController(); _model.keyTextFieldFocusNode ??= FocusNode(); - _model.keyTextFieldFocusNode!.addListener(() => setState(() {})); + _model.keyTextFieldFocusNode!.addListener(() => safeSetState(() {})); } @override @@ -156,19 +161,18 @@ class _QrCodePassKeyTemplateComponentWidgetState ), Form( key: _model.formKey, - autovalidateMode: AutovalidateMode.always, + autovalidateMode: AutovalidateMode.onUserInteraction, child: Padding( padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), child: SizedBox( width: double.infinity, child: TextFormField( controller: _model.keyTextFieldTextController, - focusNode: _model.keyTextFieldFocusNode, onChanged: (_) => EasyDebounce.debounce( '_model.keyTextFieldTextController', const Duration(milliseconds: 2000), - () => setState(() {}), + () => safeSetState(() {}), ), autofillHints: const [AutofillHints.password], textCapitalization: TextCapitalization.none, @@ -182,7 +186,7 @@ class _QrCodePassKeyTemplateComponentWidgetState labelStyle: FlutterFlowTheme.of(context).labelMedium.override( fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primary, + color: FlutterFlowTheme.of(context).primaryText, fontSize: 14.0, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -204,14 +208,14 @@ class _QrCodePassKeyTemplateComponentWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, + color: FlutterFlowTheme.of(context).primary, width: 2.0, ), borderRadius: BorderRadius.circular(12.0), ), focusedBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent3, + color: FlutterFlowTheme.of(context).primary, width: 2.0, ), borderRadius: BorderRadius.circular(12.0), @@ -235,7 +239,7 @@ class _QrCodePassKeyTemplateComponentWidgetState contentPadding: const EdgeInsetsDirectional.fromSTEB( 24.0, 24.0, 20.0, 24.0), suffixIcon: InkWell( - onTap: () => setState( + onTap: () => safeSetState( () => _model.keyTextFieldVisibility = !_model.keyTextFieldVisibility, ), @@ -259,7 +263,7 @@ class _QrCodePassKeyTemplateComponentWidgetState .containsKey('Plus Jakarta Sans'), ), maxLength: 4, - maxLengthEnforcement: MaxLengthEnforcement.none, + maxLengthEnforcement: MaxLengthEnforcement.enforced, buildCounter: (context, {required currentLength, required isFocused, @@ -270,7 +274,9 @@ class _QrCodePassKeyTemplateComponentWidgetState validator: _model.keyTextFieldTextControllerValidator .asValidator(context), inputFormatters: [ - FilteringTextInputFormatter.allow(RegExp('[0-9]')) + FilteringTextInputFormatter.allow(RegExp('[0-9]')), + LengthLimitingTextInputFormatter(4), + ], ), ), @@ -325,4 +331,4 @@ class _QrCodePassKeyTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart index a779051b..e0f842b7 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart @@ -1,9 +1,12 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/form_field_controller.dart'; -import 'regisiter_vistor_template_component_widget.dart' - show RegisiterVistorTemplateComponentWidget; + +import 'dart:typed_data'; + import 'package:flutter/material.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/form_field_controller.dart'; +import 'package:hub/flutter_flow/uploaded_file.dart'; class RegisiterVistorTemplateComponentModel extends FlutterFlowModel { @@ -55,3 +58,4 @@ class RegisiterVistorTemplateComponentModel textController4?.dispose(); } } + diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index 4a00c919..2ea62d9b 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -1,17 +1,25 @@ -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/flutter_flow/flutter_flow_drop_down.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import '/flutter_flow/form_field_controller.dart'; -import '/flutter_flow/upload_data.dart'; -import '/custom_code/actions/index.dart' as actions; + +import 'dart:typed_data'; + import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart'; +import 'package:hub/custom_code/actions/convert_image_file_to_base64.dart'; +import 'package:hub/flutter_flow/flutter_flow_drop_down.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/form_field_controller.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/upload_data.dart'; +import 'package:hub/flutter_flow/uploaded_file.dart'; import 'package:provider/provider.dart'; -import 'regisiter_vistor_template_component_model.dart'; -export 'regisiter_vistor_template_component_model.dart'; + + class RegisiterVistorTemplateComponentWidget extends StatefulWidget { const RegisiterVistorTemplateComponentWidget({super.key}); @@ -705,7 +713,7 @@ class _RegisiterVistorTemplateComponentWidgetState _model.dropDownValue != '') && (_model.textController2.text != '')) { _model.imgBase64 = - await actions.convertImageFileToBase64( + await convertImageFileToBase64( _model.uploadedLocalFile, ); _model.registerVisitor = @@ -818,4 +826,4 @@ class _RegisiterVistorTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart index f305c4de..8da449ab 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart @@ -1,8 +1,10 @@ -import '/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; -import '/components/view_visit_detail/view_visit_detail_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'visit_details_modal_template_component_widget.dart' - show VisitDetailsModalTemplateComponentWidget; + + +import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_model.dart'; +import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; +import 'package:hub/components/view_visit_detail/view_visit_detail_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + import 'package:flutter/material.dart'; class VisitDetailsModalTemplateComponentModel @@ -30,4 +32,4 @@ class VisitDetailsModalTemplateComponentModel viewVisitDetailModel.dispose(); scheduleVisitDetailModel.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart index e5aba602..3ae6ce62 100644 --- a/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart +++ b/lib/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart @@ -1,9 +1,11 @@ -import '/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; -import '/components/view_visit_detail/view_visit_detail_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; + + + import 'package:flutter/material.dart'; -import 'visit_details_modal_template_component_model.dart'; -export 'visit_details_modal_template_component_model.dart'; +import 'package:hub/components/organism_components/schedule_visit_detail/schedule_visit_detail_widget.dart'; +import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_model.dart'; +import 'package:hub/components/view_visit_detail/view_visit_detail_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; class VisitDetailsModalTemplateComponentWidget extends StatefulWidget { const VisitDetailsModalTemplateComponentWidget({ @@ -118,4 +120,4 @@ class _VisitDetailsModalTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart index 965cbd4b..a5a7eb07 100644 --- a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart +++ b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart @@ -1,8 +1,7 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'visit_request_template_component_widget.dart' - show VisitRequestTemplateComponentWidget; + import 'package:flutter/material.dart'; +import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; class VisitRequestTemplateComponentModel extends FlutterFlowModel { @@ -56,4 +55,4 @@ class VisitRequestTemplateComponentModel textFieldFocusNodeStatus?.dispose(); textControllerStatus?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart index 59ac857a..faae71ee 100644 --- a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart +++ b/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart @@ -1,14 +1,14 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; import 'package:provider/provider.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'visit_request_template_component_model.dart'; -export 'visit_request_template_component_model.dart'; class VisitRequestTemplateComponentWidget extends StatefulWidget { const VisitRequestTemplateComponentWidget({ @@ -836,4 +836,4 @@ class _VisitRequestTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart index 63da16d2..1b473920 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart @@ -1,7 +1,8 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'visitor_search_modal_template_component_widget.dart' - show VisitorSearchModalTemplateComponentWidget; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; class VisitorSearchModalTemplateComponentModel @@ -42,4 +43,4 @@ class VisitorSearchModalTemplateComponentModel textFieldFocusNode?.dispose(); textController?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index f393b4ec..460ef502 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -1,16 +1,20 @@ -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; -import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; + +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/components/molecular_components/visitor_not_found_component/visitor_not_found_component_widget.dart'; +import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; +import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/internationalization.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 'visitor_search_modal_template_component_model.dart'; -export 'visitor_search_modal_template_component_model.dart'; class VisitorSearchModalTemplateComponentWidget extends StatefulWidget { const VisitorSearchModalTemplateComponentWidget({ @@ -531,4 +535,4 @@ class _VisitorSearchModalTemplateComponentWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/components/view_visit_detail/view_visit_detail_widget.dart b/lib/components/view_visit_detail/view_visit_detail_widget.dart index e5c4195f..bea401b7 100644 --- a/lib/components/view_visit_detail/view_visit_detail_widget.dart +++ b/lib/components/view_visit_detail/view_visit_detail_widget.dart @@ -1,6 +1,9 @@ import 'dart:convert'; import 'dart:developer'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/flutter_flow/nav/serialization_util.dart'; + import '/backend/api_requests/api_calls.dart'; import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; diff --git a/lib/custom_code/actions/convert_image_file_to_base64.dart b/lib/custom_code/actions/convert_image_file_to_base64.dart index 595a0468..33f4fd83 100644 --- a/lib/custom_code/actions/convert_image_file_to_base64.dart +++ b/lib/custom_code/actions/convert_image_file_to_base64.dart @@ -1,17 +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 'index.dart'; // Imports other custom actions -import '/flutter_flow/custom_functions.dart'; // Imports custom functions -import 'package:flutter/material.dart'; -// Begin custom action code -// DO NOT REMOVE OR MODIFY THE CODE ABOVE! + +// Automatic FlutterFlow imports + +import 'index.dart'; // Imports other custom actions +import 'package:flutter/material.dart'; import 'dart:convert'; import 'dart:typed_data'; +import '../../flutter_flow/uploaded_file.dart'; Future convertImageFileToBase64(FFUploadedFile imageFile) async { List? imageBytes = imageFile.bytes; @@ -19,4 +14,4 @@ Future convertImageFileToBase64(FFUploadedFile imageFile) async { String base64Image = base64Encode(imageBytes); return base64Image; } -} +} \ No newline at end of file diff --git a/lib/custom_code/actions/convert_to_upload_file.dart b/lib/custom_code/actions/convert_to_upload_file.dart index da9e3dae..e72f0efe 100644 --- a/lib/custom_code/actions/convert_to_upload_file.dart +++ b/lib/custom_code/actions/convert_to_upload_file.dart @@ -14,6 +14,7 @@ import 'dart:convert'; // Import for base64 decoding import 'dart:io'; // Import for file operations import 'package:path_provider/path_provider.dart'; // Import for temporary directory + Future convertToUploadFile(String img) async { // Decode the base64 string into bytes Uint8List bytes = base64.decode(img); @@ -29,4 +30,4 @@ Future convertToUploadFile(String img) async { bytes: bytes, name: 'image.jpg', ); -} +} \ No newline at end of file diff --git a/lib/custom_code/actions/get_dev_u_u_i_d.dart b/lib/custom_code/actions/get_dev_u_u_i_d.dart index 7fb469f1..e5df025d 100644 --- a/lib/custom_code/actions/get_dev_u_u_i_d.dart +++ b/lib/custom_code/actions/get_dev_u_u_i_d.dart @@ -12,6 +12,9 @@ import 'package:flutter/material.dart'; import 'dart:io'; import 'package:device_info_plus/device_info_plus.dart'; + + + Future getDevUUID() async { var deviceInfo = DeviceInfoPlugin(); if (Platform.isIOS) { @@ -58,4 +61,4 @@ Future getSerialNumber() async { log('DeviceInfoPLugin => androidDeviceInfo.id: ${androidDeviceInfo.id}'); // e.g. "iPhone" return androidDeviceInfo.serialNumber; // unique ID on Android } -} +} \ No newline at end of file diff --git a/lib/custom_code/widgets/image_cropper.dart b/lib/custom_code/widgets/image_cropper.dart index da1dbe23..90704f46 100644 --- a/lib/custom_code/widgets/image_cropper.dart +++ b/lib/custom_code/widgets/image_cropper.dart @@ -1,179 +1,181 @@ -// 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 'index.dart'; // Imports other custom widgets -import '/custom_code/actions/index.dart'; // Imports custom actions -import '/flutter_flow/custom_functions.dart'; // Imports custom functions -import 'package:flutter/material.dart'; -// Begin custom widget code -// DO NOT REMOVE OR MODIFY THE CODE ABOVE! +// // 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 'index.dart'; // Imports other custom widgets +// import '/custom_code/actions/index.dart'; // Imports custom actions +// import '/flutter_flow/custom_functions.dart'; // Imports custom functions +// import 'package:flutter/material.dart'; +// // Begin custom widget code +// // DO NOT REMOVE OR MODIFY THE CODE ABOVE! -import 'package:crop_your_image/crop_your_image.dart'; -import 'package:google_fonts/google_fonts.dart'; -import '/backend/firebase_storage/storage.dart'; +// import 'package:crop_your_image/crop_your_image.dart'; +// import 'package:google_fonts/google_fonts.dart'; +// import '/backend/firebase_storage/storage.dart'; -class ImageCropper extends StatefulWidget { - const ImageCropper({ - super.key, - this.width, - this.height, - this.imageFile, - this.callBackAction, - this.currentUserId, - }); +// ///////////////// - final double? width; - final double? height; - final FFUploadedFile? imageFile; - final Future Function(String? url)? callBackAction; - final String? currentUserId; +// class ImageCropper extends StatefulWidget { +// const ImageCropper({ +// super.key, +// this.width, +// this.height, +// this.imageFile, +// this.callBackAction, +// this.currentUserId, +// }); - @override - State createState() => _ImageCropperState(); -} +// final double? width; +// final double? height; +// final FFUploadedFile? imageFile; +// final Future Function(String? url)? callBackAction; +// final String? currentUserId; -class _ImageCropperState extends State { - bool loading = false; - final _crop_controller = CropController(); - @override - Widget build(BuildContext context) { - return Stack( - children: [ - Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: widget.width ?? double.infinity, - height: (widget.height ?? 555) - 80, - child: Center( - child: Crop( - image: Uint8List.fromList(widget.imageFile!.bytes!), - controller: _crop_controller, - onCropped: (image) async { - final path = _getStoragePath(_firebasePathPrefix(), - widget.imageFile!.name!, false, 0); - uploadData(path, image).then((value) { - log('image cropped'); - widget.callBackAction!.call(value!); - loading = false; - }); - // add error handling here - }, +// @override +// State createState() => _ImageCropperState(); +// } - aspectRatio: 1 / 1, - initialSize: 0.5, - // initialArea: Rect.fromLTWH(240, 212, 800, 600),\ - //initialAreaBuilder: (rect) => Rect.fromLTRB(rect.left + 80, rect.top + 80, rect.right - 80, rect.bottom - 80), - withCircleUi: true, - baseColor: Color.fromARGB(255, 0, 3, 22), - maskColor: Colors.white.withAlpha(100), - radius: 20, +// class _ImageCropperState extends State { +// bool loading = false; +// final _crop_controller = CropController(); +// @override +// Widget build(BuildContext context) { +// return Stack( +// children: [ +// Column( +// mainAxisSize: MainAxisSize.min, +// mainAxisAlignment: MainAxisAlignment.start, +// crossAxisAlignment: CrossAxisAlignment.center, +// children: [ +// Container( +// width: widget.width ?? double.infinity, +// height: (widget.height ?? 555) - 80, +// child: Center( +// child: Crop( +// image: Uint8List.fromList(widget.imageFile!.bytes!), +// controller: _crop_controller, +// onCropped: (image) async { +// final path = _getStoragePath(_firebasePathPrefix(), +// widget.imageFile!.name!, false, 0); +// uploadData(path, image).then((value) { +// log('image cropped'); +// widget.callBackAction!.call(value!); +// loading = false; +// }); +// // add error handling here +// }, - onMoved: (newRect) { - // do something with current cropping area. - }, - onStatusChanged: (status) { - // do something with current CropStatus - }, - cornerDotBuilder: (size, edgeAlignment) => - const DotControl(color: Colors.white), - interactive: true, - // fixArea: true, - ))), - Padding( - padding: EdgeInsetsDirectional.fromSTEB(8, 5, 8, 5), - child: ElevatedButton( - onPressed: () async { - if (!loading) { - setState(() { - loading = true; - }); - log('Button pressed ...'); - _crop_controller.crop(); +// aspectRatio: 1 / 1, +// initialSize: 0.5, +// // initialArea: Rect.fromLTWH(240, 212, 800, 600),\ +// //initialAreaBuilder: (rect) => Rect.fromLTRB(rect.left + 80, rect.top + 80, rect.right - 80, rect.bottom - 80), +// withCircleUi: true, +// baseColor: Color.fromARGB(255, 0, 3, 22), +// maskColor: Colors.white.withAlpha(100), +// radius: 20, - //widget.loading = true; - } - }, - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( - FlutterFlowTheme.of(context).primaryColor, - ), - padding: MaterialStateProperty.all( - EdgeInsets.zero, - ), - shape: MaterialStateProperty.all( - RoundedRectangleBorder( - borderRadius: BorderRadius.circular(100), - side: BorderSide.none, - ), - ), - ), - child: Container( - width: 250, - height: 50, - alignment: Alignment.center, - child: loading - ? CircularProgressIndicator( - valueColor: - AlwaysStoppedAnimation(Colors.white), - ) - : Text( - 'Crop', - style: FlutterFlowTheme.of(context) - .subtitle2 - .override( - fontFamily: 'Lexend', - color: Colors.white, - fontSize: 16, - fontWeight: FontWeight.normal, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .subtitle2Family), - ), - ), - ), - )), - ]), - Positioned( - top: 4, - right: 4, - child: IconButton( - icon: Icon(Icons.close), - onPressed: () => Navigator.pop(context), - )) - ], - ); - } +// onMoved: (newRect) { +// // do something with current cropping area. +// }, +// onStatusChanged: (status) { +// // do something with current CropStatus +// }, +// cornerDotBuilder: (size, edgeAlignment) => +// const DotControl(color: Colors.white), +// interactive: true, +// // fixArea: true, +// ))), +// Padding( +// padding: EdgeInsetsDirectional.fromSTEB(8, 5, 8, 5), +// child: ElevatedButton( +// onPressed: () async { +// if (!loading) { +// setState(() { +// loading = true; +// }); +// log('Button pressed ...'); +// _crop_controller.crop(); - String _getStoragePath( - String? pathPrefix, - String filePath, - bool isVideo, [ - int? index, - ]) { - pathPrefix ??= _firebasePathPrefix(); - pathPrefix = _removeTrailingSlash(pathPrefix); - final timestamp = DateTime.now().microsecondsSinceEpoch; - final prefix = 'cropped-'; - // Workaround fixed by https://github.com/flutter/plugins/pull/3685 - // (not yet in stable). - final ext = isVideo ? 'mp4' : filePath.split('.').last; - final indexStr = index != null ? '_$index' : ''; - return '$pathPrefix/$prefix$timestamp$indexStr.$ext'; - } +// //widget.loading = true; +// } +// }, +// style: ButtonStyle( +// backgroundColor: MaterialStateProperty.all( +// FlutterFlowTheme.of(context).primaryColor, +// ), +// padding: MaterialStateProperty.all( +// EdgeInsets.zero, +// ), +// shape: MaterialStateProperty.all( +// RoundedRectangleBorder( +// borderRadius: BorderRadius.circular(100), +// side: BorderSide.none, +// ), +// ), +// ), +// child: Container( +// width: 250, +// height: 50, +// alignment: Alignment.center, +// child: loading +// ? CircularProgressIndicator( +// valueColor: +// AlwaysStoppedAnimation(Colors.white), +// ) +// : Text( +// 'Crop', +// style: FlutterFlowTheme.of(context) +// .subtitle2 +// .override( +// fontFamily: 'Lexend', +// color: Colors.white, +// fontSize: 16, +// fontWeight: FontWeight.normal, +// useGoogleFonts: GoogleFonts.asMap() +// .containsKey( +// FlutterFlowTheme.of(context) +// .subtitle2Family), +// ), +// ), +// ), +// )), +// ]), +// Positioned( +// top: 4, +// right: 4, +// child: IconButton( +// icon: Icon(Icons.close), +// onPressed: () => Navigator.pop(context), +// )) +// ], +// ); +// } - String? _removeTrailingSlash(String? path) => - path != null && path.endsWith('/') - ? path.substring(0, path.length - 1) - : path; +// String _getStoragePath( +// String? pathPrefix, +// String filePath, +// bool isVideo, [ +// int? index, +// ]) { +// pathPrefix ??= _firebasePathPrefix(); +// pathPrefix = _removeTrailingSlash(pathPrefix); +// final timestamp = DateTime.now().microsecondsSinceEpoch; +// final prefix = 'cropped-'; +// // Workaround fixed by https://github.com/flutter/plugins/pull/3685 +// // (not yet in stable). +// final ext = isVideo ? 'mp4' : filePath.split('.').last; +// final indexStr = index != null ? '_$index' : ''; +// return '$pathPrefix/$prefix$timestamp$indexStr.$ext'; +// } - String _firebasePathPrefix() => 'users/${widget.currentUserId}/uploads'; -} -// Set your widget name, define your parameter, and then add the -// boilerplate code using the green button on the right! +// String? _removeTrailingSlash(String? path) => +// path != null && path.endsWith('/') +// ? path.substring(0, path.length - 1) +// : path; + +// String _firebasePathPrefix() => 'users/${widget.currentUserId}/uploads'; +// } +// // Set your widget name, define your parameter, and then add the +// // boilerplate code using the green button on the right! diff --git a/lib/custom_code/widgets/menu.dart b/lib/custom_code/widgets/menu.dart new file mode 100644 index 00000000..b3fa00c7 --- /dev/null +++ b/lib/custom_code/widgets/menu.dart @@ -0,0 +1,61 @@ + +import 'dart:collection'; + +import 'package:flutter/material.dart'; + +LinkedHashMap menu = LinkedHashMap.from({ + "Schedule": + [{ + "title": "Schedule\nVisit", + "icon": Icons.settings, + "route": "/Schedule", + }, + { + "title": "Complete\Schedule", + "icon": Icons.calendar_today, + "route": "/Complete", + }, + { + "title": "Provisional\Schedule", + "icon": Icons.calendar_today, + "route": "/Provisional", + }, + { + "title": "Fast\Schedule", + "icon": Icons.calendar_today, + "route": "/Fast", + }], + "Consult": + [{ + "title": "Consult", + "icon": Icons.search, + "route": "/consult", + }, + { + "title": "Liberation\nConsult", + "icon": Icons.search, + "route": "/Liberation", + }, + { + "title": "Access\nConsult", + "icon": Icons.search, + "route": "/Access", + }, + { + "title": "Poeple\nConsult", + "icon": Icons.search, + "route": "/Poeple", + }, + { + "title": "QR Code\nConsult", + "icon": Icons.search, + "route": "/qrcode", + }], + "Preferences": + [{ + "title": "Preferences", + "icon": Icons.settings, + "route": "/preferences", + }], + +}); \ No newline at end of file diff --git a/lib/flutter_flow/custom_functions.dart b/lib/flutter_flow/custom_functions.dart index 066402f2..f33176c1 100644 --- a/lib/flutter_flow/custom_functions.dart +++ b/lib/flutter_flow/custom_functions.dart @@ -8,8 +8,7 @@ import 'package:timeago/timeago.dart' as timeago; import 'lat_lng.dart'; import 'place.dart'; import 'uploaded_file.dart'; -import '/backend/schema/structs/index.dart'; -import '/backend/schema/enums/enums.dart'; + String? isOneAcliID(String jsonString) { // Converte o JSON em um Map diff --git a/lib/flutter_flow/custom_icons.dart b/lib/flutter_flow/custom_icons.dart index 52991086..07cebe2e 100644 --- a/lib/flutter_flow/custom_icons.dart +++ b/lib/flutter_flow/custom_icons.dart @@ -18,4 +18,4 @@ class FFIcons { IconData(0xe900, fontFamily: _menuFamily); static const IconData kvector2 = IconData(0xe905, fontFamily: _menuFamily); static const IconData kvector3 = IconData(0xe906, fontFamily: _menuFamily); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_animations.dart b/lib/flutter_flow/flutter_flow_animations.dart index 486179ca..c101a376 100644 --- a/lib/flutter_flow/flutter_flow_animations.dart +++ b/lib/flutter_flow/flutter_flow_animations.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; + enum AnimationTrigger { onPageLoad, onActionTrigger, @@ -108,4 +109,4 @@ class TiltEffect extends Effect { ), ); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_button_tabbar.dart b/lib/flutter_flow/flutter_flow_button_tabbar.dart index fcf320b3..4ea6374d 100644 --- a/lib/flutter_flow/flutter_flow_button_tabbar.dart +++ b/lib/flutter_flow/flutter_flow_button_tabbar.dart @@ -6,6 +6,8 @@ import 'package:flutter/gestures.dart' show DragStartBehavior; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; + + const double _kTabHeight = 46.0; typedef _LayoutCallback = void Function( @@ -851,4 +853,4 @@ class _FlutterFlowButtonTabBarState extends State return tabBar; } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_checkbox_group.dart b/lib/flutter_flow/flutter_flow_checkbox_group.dart index 61e5f3df..fc089d10 100644 --- a/lib/flutter_flow/flutter_flow_checkbox_group.dart +++ b/lib/flutter_flow/flutter_flow_checkbox_group.dart @@ -4,6 +4,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; +//// + + class FlutterFlowCheckboxGroup extends StatefulWidget { const FlutterFlowCheckboxGroup({ super.key, @@ -131,4 +134,4 @@ class _FlutterFlowCheckboxGroupState extends State { ); }, ); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_drop_down.dart b/lib/flutter_flow/flutter_flow_drop_down.dart index 0e7bc61c..26476a81 100644 --- a/lib/flutter_flow/flutter_flow_drop_down.dart +++ b/lib/flutter_flow/flutter_flow_drop_down.dart @@ -1,5 +1,7 @@ import 'package:dropdown_button2/dropdown_button2.dart'; +import 'package:dropdown_button2/dropdown_button2.dart'; + import 'form_field_controller.dart'; import 'package:flutter/material.dart'; @@ -370,4 +372,4 @@ class _FlutterFlowDropDownState extends State> { : null, ); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_icon_button.dart b/lib/flutter_flow/flutter_flow_icon_button.dart index 6e77c8a0..d41b72bb 100644 --- a/lib/flutter_flow/flutter_flow_icon_button.dart +++ b/lib/flutter_flow/flutter_flow_icon_button.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + + class FlutterFlowIconButton extends StatefulWidget { const FlutterFlowIconButton({ super.key, @@ -167,4 +169,4 @@ class _FlutterFlowIconButtonState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_model.dart b/lib/flutter_flow/flutter_flow_model.dart index 5a1225da..93752ff6 100644 --- a/lib/flutter_flow/flutter_flow_model.dart +++ b/lib/flutter_flow/flutter_flow_model.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:provider/provider.dart'; + Widget wrapWithModel({ required T model, required Widget child, @@ -164,4 +165,4 @@ T? _getDefaultValue() { extension TextValidationExtensions on String? Function(BuildContext, String?)? { String? Function(String?)? asValidator(BuildContext context) => this != null ? (val) => this!(context, val) : null; -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_theme.dart b/lib/flutter_flow/flutter_flow_theme.dart index 12792945..a924cb38 100644 --- a/lib/flutter_flow/flutter_flow_theme.dart +++ b/lib/flutter_flow/flutter_flow_theme.dart @@ -5,6 +5,7 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:shared_preferences/shared_preferences.dart'; + const kThemeModeKey = '__theme_mode__'; SharedPreferences? _prefs; @@ -50,6 +51,7 @@ abstract class FlutterFlowTheme { late Color secondary; late Color tertiary; late Color alternate; + late Color alternate2; late Color primaryText; late Color secondaryText; late Color primaryBackground; @@ -160,6 +162,7 @@ class LightModeTheme extends FlutterFlowTheme { late Color secondary = const Color(0xFFB59E9E); late Color tertiary = const Color(0xFF984BB6); late Color alternate = const Color(0xFFF2F2F2); + late Color alternate2 = const Color(0xFF232323); late Color primaryText = const Color(0xFF000000); late Color secondaryText = const Color(0xFFFFFFFF); late Color primaryBackground = const Color(0xFFFFFFFF); @@ -559,6 +562,7 @@ class DarkModeTheme extends FlutterFlowTheme { late Color secondary = const Color(0xFF18AA99); late Color tertiary = const Color(0xFF984BB6); late Color alternate = const Color(0xFF232323); + late Color alternate2 = const Color(0xFF171717); late Color primaryText = const Color(0xFFFFFFFF); late Color secondaryText = const Color(0xFF000000); late Color primaryBackground = const Color(0xFF171717); @@ -616,4 +620,4 @@ extension TextStyleHelper on TextStyle { height: lineHeight, shadows: shadows, ); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_util.dart b/lib/flutter_flow/flutter_flow_util.dart index 8bdcf64e..ba7e763b 100644 --- a/lib/flutter_flow/flutter_flow_util.dart +++ b/lib/flutter_flow/flutter_flow_util.dart @@ -18,7 +18,7 @@ export 'keep_alive_wrapper.dart'; export 'lat_lng.dart'; export 'place.dart'; export 'uploaded_file.dart'; -export '../app_state.dart'; +export '/app_state.dart'; export 'flutter_flow_model.dart'; export 'dart:math' show min, max; export 'dart:typed_data' show Uint8List; @@ -27,7 +27,6 @@ export 'package:intl/intl.dart'; export 'package:page_transition/page_transition.dart'; export 'custom_icons.dart' show FFIcons; export 'internationalization.dart' show FFLocalizations; -export 'nav/nav.dart'; T valueOrDefault(T? value, T defaultValue) => (value is String && value.isEmpty) || value == null ? defaultValue : value; @@ -568,4 +567,4 @@ double computeGradientAlignmentY(double evaluatedAngle) { y = sin(2 * rads); } return double.parse(roundTo(y, 2)); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/flutter_flow_widgets.dart b/lib/flutter_flow/flutter_flow_widgets.dart index 5f36df96..f9db2be0 100644 --- a/lib/flutter_flow/flutter_flow_widgets.dart +++ b/lib/flutter_flow/flutter_flow_widgets.dart @@ -2,6 +2,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:flutter/material.dart'; import 'package:auto_size_text/auto_size_text.dart'; + class FFButtonOptions { const FFButtonOptions({ this.textAlign, @@ -285,4 +286,4 @@ double? _getTextWidth(String? text, TextStyle? style, int maxLines) => )..layout()) .size .width - : null; + : null; \ No newline at end of file diff --git a/lib/flutter_flow/form_field_controller.dart b/lib/flutter_flow/form_field_controller.dart index b8020e3b..1d152bb9 100644 --- a/lib/flutter_flow/form_field_controller.dart +++ b/lib/flutter_flow/form_field_controller.dart @@ -1,5 +1,6 @@ import 'package:flutter/foundation.dart'; + class FormFieldController extends ValueNotifier { FormFieldController(this.initialValue) : super(initialValue); @@ -20,4 +21,4 @@ class FormListFieldController extends FormFieldController> { @override void reset() => value = List.from(_initialListValue ?? []); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index e535962b..ca4cb34f 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -967,7 +967,7 @@ final kTranslationsMap = >>[ }, 'a9smhn5b': { 'pt': 'Você já tem uma conta? ', - 'en': 'You already have an account?', + 'en': 'You already have an account? ', }, '09xv5ctc': { 'pt': 'Clique aqui', @@ -1272,4 +1272,4 @@ final kTranslationsMap = >>[ 'en': 'Block completed', }, }, -].reduce((a, b) => a..addAll(b)); +].reduce((a, b) => a..addAll(b)); \ No newline at end of file diff --git a/lib/flutter_flow/keep_alive_wrapper.dart b/lib/flutter_flow/keep_alive_wrapper.dart index 286bde09..fd9c5150 100644 --- a/lib/flutter_flow/keep_alive_wrapper.dart +++ b/lib/flutter_flow/keep_alive_wrapper.dart @@ -22,4 +22,4 @@ class _KeepAliveWidgetWrapperState extends State super.build(context); return widget.builder(context); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/lat_lng.dart b/lib/flutter_flow/lat_lng.dart index 9e7b8ea8..68758f91 100644 --- a/lib/flutter_flow/lat_lng.dart +++ b/lib/flutter_flow/lat_lng.dart @@ -16,4 +16,4 @@ class LatLng { other is LatLng && latitude == other.latitude && longitude == other.longitude; -} +} \ No newline at end of file diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index 6eed8f03..29785cdc 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -1,9 +1,10 @@ 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:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/fast_pass_page/fast_pass_page_widget.dart'; +import 'package:hub/pages/message_history_page/message_history_page_widget.dart'; +import 'package:hub/pages/preferences_settings_page/preferences_settings_widget.dart'; import 'package:provider/provider.dart'; import '/backend/schema/structs/index.dart'; @@ -17,6 +18,8 @@ export 'serialization_util.dart'; const kTransitionInfoKey = '__transition_info__'; +/// + class AppStateNotifier extends ChangeNotifier { AppStateNotifier._(); @@ -379,4 +382,4 @@ extension GoRouterLocationExtension on GoRouter { : routerDelegate.currentConfiguration; return matchList.uri.toString(); } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/nav/serialization_util.dart b/lib/flutter_flow/nav/serialization_util.dart index f9665c41..887c8eec 100644 --- a/lib/flutter_flow/nav/serialization_util.dart +++ b/lib/flutter_flow/nav/serialization_util.dart @@ -10,6 +10,7 @@ import '../../flutter_flow/lat_lng.dart'; import '../../flutter_flow/place.dart'; import '../../flutter_flow/uploaded_file.dart'; + /// SERIALIZATION HELPERS String dateTimeRangeToString(DateTimeRange dateTimeRange) { @@ -228,4 +229,4 @@ dynamic deserializeParam( log('Error deserializing parameter: $e'); return null; } -} +} \ No newline at end of file diff --git a/lib/flutter_flow/permissions_util.dart b/lib/flutter_flow/permissions_util.dart index c7b8c2ff..304c8a17 100644 --- a/lib/flutter_flow/permissions_util.dart +++ b/lib/flutter_flow/permissions_util.dart @@ -15,4 +15,4 @@ Future getPermissionStatus(Permission setting) async { } Future requestPermission(Permission setting) async => - await setting.request(); + await setting.request(); \ No newline at end of file diff --git a/lib/flutter_flow/place.dart b/lib/flutter_flow/place.dart index e3589b3b..972fb8be 100644 --- a/lib/flutter_flow/place.dart +++ b/lib/flutter_flow/place.dart @@ -43,4 +43,4 @@ class FFPlace { state == other.state && country == other.country && zipCode == other.zipCode; -} +} \ No newline at end of file diff --git a/lib/flutter_flow/random_data_util.dart b/lib/flutter_flow/random_data_util.dart index 6599e5a6..fd966a2c 100644 --- a/lib/flutter_flow/random_data_util.dart +++ b/lib/flutter_flow/random_data_util.dart @@ -48,4 +48,4 @@ String randomImageUrl(int width, int height) { Color randomColor() { return Color.fromARGB( 255, _random.nextInt(255), _random.nextInt(255), _random.nextInt(255)); -} +} \ No newline at end of file diff --git a/lib/flutter_flow/request_manager.dart b/lib/flutter_flow/request_manager.dart index f26ed03b..c9b4dcc8 100644 --- a/lib/flutter_flow/request_manager.dart +++ b/lib/flutter_flow/request_manager.dart @@ -90,4 +90,4 @@ class StreamRequestManager { } String _requestKey(String? key) => - key == null || key.isEmpty ? '__DEFAULT_KEY__' : key; + key == null || key.isEmpty ? '__DEFAULT_KEY__' : key; \ No newline at end of file diff --git a/lib/flutter_flow/upload_data.dart b/lib/flutter_flow/upload_data.dart index 11219e59..6b6baf2b 100644 --- a/lib/flutter_flow/upload_data.dart +++ b/lib/flutter_flow/upload_data.dart @@ -374,4 +374,4 @@ void showUploadMessage( String? _removeTrailingSlash(String? path) => path != null && path.endsWith('/') ? path.substring(0, path.length - 1) - : path; + : path; \ No newline at end of file diff --git a/lib/flutter_flow/uploaded_file.dart b/lib/flutter_flow/uploaded_file.dart index 2dfd2ff1..cbe68cad 100644 --- a/lib/flutter_flow/uploaded_file.dart +++ b/lib/flutter_flow/uploaded_file.dart @@ -65,4 +65,4 @@ class FFUploadedFile { height == other.height && width == other.width && blurHash == other.blurHash; -} +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 9bc5efc1..3348f78f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,19 +1,25 @@ import 'package:firebase_core/firebase_core.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:provider/provider.dart'; import 'package:flutter/material.dart'; import 'package:responsive_framework/responsive_framework.dart'; import 'firebase_options.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_web_plugins/url_strategy.dart'; -import 'flutter_flow/flutter_flow_theme.dart'; -import 'flutter_flow/flutter_flow_util.dart'; -import 'flutter_flow/internationalization.dart'; +import 'package:flutter/services.dart'; final GlobalKey navigatorKey = GlobalKey(); void main() async { WidgetsFlutterBinding.ensureInitialized(); + SystemChrome.setPreferredOrientations([ + DeviceOrientation.portraitUp, + DeviceOrientation.portraitDown, + ]); await initializeApp(); runApp(ChangeNotifierProvider( create: (context) => FFAppState(), @@ -129,4 +135,4 @@ class _MyAppState extends State { routerConfig: _router, ); } -} +} \ No newline at end of file diff --git a/lib/pages/acess_history_page/acess_history_page_model.dart b/lib/pages/acess_history_page/acess_history_page_model.dart index a03ec14e..4d633ac2 100644 --- a/lib/pages/acess_history_page/acess_history_page_model.dart +++ b/lib/pages/acess_history_page/acess_history_page_model.dart @@ -1,10 +1,13 @@ -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/opt_modal/opt_modal_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/request_manager.dart'; -import 'acess_history_page_widget.dart' show AcessHistoryPageWidget; + import 'package:flutter/material.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_widget.dart'; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; +import 'package:hub/pages/acess_history_page/acess_history_page_widget.dart'; +import 'package:hub/pages/liberation_history/liberation_history_model.dart'; class AcessHistoryPageModel extends FlutterFlowModel { final unfocusNode = FocusNode(); @@ -54,4 +57,4 @@ class AcessHistoryPageModel extends FlutterFlowModel { }, ); } -} +} \ No newline at end of file diff --git a/lib/pages/acess_history_page/acess_history_page_widget.dart b/lib/pages/acess_history_page/acess_history_page_widget.dart index ecbbdb94..58976eb6 100644 --- a/lib/pages/acess_history_page/acess_history_page_widget.dart +++ b/lib/pages/acess_history_page/acess_history_page_widget.dart @@ -3,18 +3,24 @@ import 'dart:developer'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_widget.dart'; +import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; +import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/pages/acess_history_page/acess_history_page_model.dart'; import 'package:rxdart/rxdart.dart'; -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/opt_modal/opt_modal_widget.dart'; -import '/flutter_flow/custom_functions.dart' as functions; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '../../components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; -import 'acess_history_page_model.dart'; -export 'acess_history_page_model.dart'; + @immutable class AcessHistoryPageWidget extends StatefulWidget { @@ -319,26 +325,48 @@ class _AcessHistoryPageWidgetState extends State { 'Acesso:': accessHistoryItem['ACE_DATAHORA'] ?? '', 'Setor:': accessHistoryItem['SET_DESCRICAO'] ?? '', }), - statusHashMap: accessHistoryItem['PES_TIPO'] == 'O' + statusHashMap: [ + accessHistoryItem['PES_TIPO'] == 'O' ? Map.from({ FFLocalizations.of(context).getVariableText( - ptText: 'Visitado', - enText: 'Visited', - ): FlutterFlowTheme.of(context).success, + ptText: 'Morador', + enText: 'Resident', + ): FlutterFlowTheme.of(context).alternate2, }) : accessHistoryItem['PES_TIPO'] == 'E' ? Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Visitante', enText: 'Visitor', - ): FlutterFlowTheme.of(context).warning, + ): FlutterFlowTheme.of(context).alternate2, }) : Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Desconhecido', enText: 'Unknown', - ): FlutterFlowTheme.of(context).error, + ): FlutterFlowTheme.of(context).alternate2, }), + accessHistoryItem['ACE_TIPO'] == '0' + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Entrada', + enText: 'Entrance', + ): FlutterFlowTheme.of(context).success, + }) + : accessHistoryItem['ACE_TIPO'] == '1' + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Saída', + enText: 'Exit', + ): FlutterFlowTheme.of(context).error, + }) + : Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Desconhecido', + enText: 'Unknown', + ): FlutterFlowTheme.of(context).warning, + }) + ], onTapCardItemAction: () async {}); } } @@ -382,8 +410,8 @@ Widget _cardHeaderAtomWidget(BuildContext context, String urlImagem, decoration: BoxDecoration( color: (() { // Extrai o valor de PES_TIPO, converte para String, remove espaços em branco e aspas - final pesTipo = functions - .jsonToStr(getJsonField( + final pesTipo = + jsonToStr(getJsonField( accessHistoryItem, r'''$.PES_TIPO''', )) @@ -525,4 +553,4 @@ String imageUrlAtomWidget(String document, String type) { "https://freaccess.com.br/freaccess/getImage.php?&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=$document&tipo=$type", "https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg", ); -} +} \ No newline at end of file diff --git a/lib/pages/fast_pass_page/fast_pass_page_widget.dart b/lib/pages/fast_pass_page/fast_pass_page_widget.dart index 556fc661..96dfaf9a 100644 --- a/lib/pages/fast_pass_page/fast_pass_page_widget.dart +++ b/lib/pages/fast_pass_page/fast_pass_page_widget.dart @@ -1,13 +1,12 @@ import 'dart:developer'; -import 'package:f_r_e_hub/app_state.dart'; +import 'package:hub/app_state.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:url_launcher/url_launcher_string.dart'; import 'package:webview_flutter/webview_flutter.dart'; import 'dart:io' show Platform; -import '/flutter_flow/flutter_flow_util.dart'; class FastPassPageWidget extends StatefulWidget { final String freToken = FFAppState().userUUID; @@ -95,4 +94,4 @@ class _FastPassPageWidgetState extends State { ); } -} +} \ No newline at end of file diff --git a/lib/pages/home_page/home_page_model.dart b/lib/pages/home_page/home_page_model.dart index d938eebc..7c227e9c 100644 --- a/lib/pages/home_page/home_page_model.dart +++ b/lib/pages/home_page/home_page_model.dart @@ -1,11 +1,10 @@ -import 'package:f_r_e_hub/components/organism_components/message_well_component/message_well_component_model.dart'; -import '/components/organism_components/local_profile_component/local_profile_component_widget.dart'; -import '/components/organism_components/menu_component/menu_component_widget.dart'; -import '/components/organism_components/message_well_component/message_well_component_widget.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'home_page_widget.dart' show HomePageWidget; import 'package:flutter/material.dart'; +import 'package:hub/components/organism_components/local_profile_component/local_profile_component_model.dart'; +import 'package:hub/components/organism_components/menu_component/menu_component_model.dart'; +import 'package:hub/components/organism_components/message_well_component/message_well_component_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/pages/home_page/home_page_widget.dart'; class HomePageModel extends FlutterFlowModel { /// Local state fields for this page. @@ -45,4 +44,6 @@ class HomePageModel extends FlutterFlowModel { menuComponentModel.dispose(); messageWellComponentModel.dispose(); } -} + + +} \ No newline at end of file diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index 00cdc98e..c81132ab 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -1,29 +1,38 @@ -// import 'package:f_r_e_hub/backend/push_notification/pushNotification.dart'; +// import 'package:hub/backend/push_notification/pushNotification.dart'; import 'dart:developer'; -import 'package:f_r_e_hub/actions/actions.dart'; -import 'package:f_r_e_hub/backend/push_notification/pushNotificationService.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/actions/actions.dart'; +import 'package:hub/backend/push_notification/pushNotificationService.dart'; +import 'package:hub/backend/schema/enums/enums.dart'; +import 'package:hub/components/atomic_components/menu_button_item/menu_button_item_widget.dart'; +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/components/organism_components/local_profile_component/local_profile_component_widget.dart'; +import 'package:hub/components/organism_components/menu_component/menu_component_widget.dart'; +import 'package:hub/components/organism_components/message_well_component/message_well_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; + +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/home_page/home_page_model.dart'; + + import 'package:provider/provider.dart'; -import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; -import '/components/organism_components/local_profile_component/local_profile_component_widget.dart'; -import '/components/organism_components/menu_component/menu_component_widget.dart'; -import '/components/organism_components/message_well_component/message_well_component_widget.dart'; -import '/flutter_flow/custom_functions.dart' as functions; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import 'home_page_model.dart'; -export 'home_page_model.dart'; class HomePageWidget extends StatefulWidget { const HomePageWidget({super.key}); + + + @override State createState() => _HomePageWidgetState(); } @@ -96,6 +105,7 @@ class _HomePageWidgetState extends State { @override Widget build(BuildContext context) { + context.watch(); return GestureDetector( onTap: () => _model.unfocusNode.canRequestFocus @@ -155,7 +165,14 @@ class _HomePageWidgetState extends State { wrapWithModel( model: _model.menuComponentModel, updateCallback: () => setState(() {}), - child: const MenuComponentWidget(), + child: MenuComponentWidget( + options: [ + + ], + expandable: true, + style: MenuView.list_grid, + item: MenuItem.button, + ), ), Align( alignment: const AlignmentDirectional(0.0, 0.0), @@ -401,7 +418,7 @@ class _HomePageWidgetState extends State { width: 150.0, child: Text( valueOrDefault( - functions.convertToUppercase( + convertToUppercase( FFAppState().local), 'NOME DO LOCAL', ), @@ -573,569 +590,41 @@ class _HomePageWidgetState extends State { child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( 10.0, 20.0, 10.0, 0.0), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - 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( - FFLocalizations.of(context) - .getText( - 'dlaeicxd' /* Auto-Visita */, - ), - 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( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - 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.khome, - color: - FlutterFlowTheme.of(context) - .primary, - size: 24.0, - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - '53jd930v' /* Condominio */, - ), - 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( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - 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.kpets, - 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( - FFLocalizations.of(context) - .getText( - 'ptsx0rln' /* Cadastrar Pet */, - ), - 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( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - 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.kvector1, - color: - FlutterFlowTheme.of(context) - .primary, - size: 22.0, - ), - ), - Expanded( - child: Padding( - padding: - const EdgeInsetsDirectional - .fromSTEB( - 10.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context) - .getText( - 'rgxgw626' /* Cadastrar Visitante */, - ), - 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( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - 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.kvector2, - 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( - FFLocalizations.of(context) - .getText( - 'j2tn9lpw' /* QR Code de Acesso */, - ), - 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( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - 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.kvector3, - 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( - FFLocalizations.of(context) - .getText( - '9weuwgs1' /* Histórico de Acesso */, - ), - 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( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - 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.kvector1, - 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( - FFLocalizations.of(context) - .getText( - 'vuk5bjau' /* Agendar Visita */, - ), - 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( - Icons.chevron_right_rounded, - color: FlutterFlowTheme.of(context) - .customColor1, - size: 24.0, - ), - ], - ), - ), - ), - ), - Divider( - thickness: 0.1, - color: - FlutterFlowTheme.of(context).customColor1, - ), - ], + child: wrapWithModel( + model: _model.menuComponentModel, + updateCallback: () => setState(() {}), + child: MenuComponentWidget( + options: [ + MenuButtonWidget( + action: () => scheduleVisitOptAction(context), + title: FFLocalizations.of(context).getVariableText( + enText: 'Register Visitor', + ptText: 'Registrar Visitante', + ), + icon: Icons.person_add_alt_1_outlined, ), + MenuButtonWidget( + action: () => scheduleVisitOptAction(context), + title: FFLocalizations.of(context).getVariableText( + enText: 'Register Visitors', + ptText: 'Registrar Visitantes', + ), + icon: Icons.person_add_alt_1_outlined, + ), + ], + expandable: false, + style: MenuView.list, + item: MenuItem.card, ), ), + ), ), ), FFButtonWidget( onPressed: () async { FFAppState().isLogged = false; setState(() {}); - context.goNamed( 'welcomePage', extra: { diff --git a/lib/pages/liberation_history/liberation_history_model.dart b/lib/pages/liberation_history/liberation_history_model.dart index b828bcf3..a26534bb 100644 --- a/lib/pages/liberation_history/liberation_history_model.dart +++ b/lib/pages/liberation_history/liberation_history_model.dart @@ -1,9 +1,10 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/request_manager.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; + -import 'liberation_history_widget.dart' show LiberationHistoryWidget; import 'package:flutter/material.dart'; +import 'package:hub/pages/liberation_history/liberation_history_widget.dart'; class LiberationHistoryModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. @@ -44,4 +45,4 @@ class LiberationHistoryModel extends FlutterFlowModel { clearGetLiberationsCache(); } -} +} \ No newline at end of file diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index 29443a9d..3627c1b4 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -2,23 +2,25 @@ import 'dart:developer'; -import 'package:f_r_e_hub/actions/actions.dart'; -import 'package:f_r_e_hub/backend/push_notification/pushNotificationService.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/visit_request_template_component/visit_request_template_component_widget.dart'; +import 'package:hub/actions/actions.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/push_notification/pushNotificationService.dart'; + +import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; +import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/custom_functions.dart' as functions; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/pages/liberation_history/liberation_history_model.dart'; import 'package:provider/provider.dart'; -import 'liberation_history_model.dart'; -export 'liberation_history_model.dart'; + class LiberationHistoryWidget extends StatefulWidget { const LiberationHistoryWidget({super.key}); @@ -253,8 +255,7 @@ Widget liberationDynamicListView( []; final filteredLiberationHistory = _model.textController.text.isNotEmpty ? liberationHistory - .where((item) => functions - .jsonToStr(getJsonField( + .where((item) => jsonToStr(getJsonField( item, r'''$.VTE_NOME''', )) @@ -308,7 +309,7 @@ Widget liberationHistoryItemCard( 'Data:': liberationHistoryItem['NOT_DTENVIO'], 'Motivo:': liberationHistoryItem['NOT_MOTIVO'], }), - statusHashMap: liberationHistoryItem['NOT_STATUS'] == 'L' + statusHashMap: [liberationHistoryItem['NOT_STATUS'] == 'L' ? Map.from({ FFLocalizations.of(context).getVariableText( ptText: 'Ativo', @@ -327,7 +328,7 @@ Widget liberationHistoryItemCard( ptText: 'Pendente', enText: 'Pending', ): FlutterFlowTheme.of(context).warning, - }), + })], onTapCardItemAction: () async { showModalBottomSheet( isScrollControlled: true, @@ -379,4 +380,4 @@ Widget liberationHistoryItemCard( }); }, ); -} +} \ No newline at end of file diff --git a/lib/pages/message_history_page/message_history_page_model.dart b/lib/pages/message_history_page/message_history_page_model.dart index 1bfa4793..9a40e0c4 100644 --- a/lib/pages/message_history_page/message_history_page_model.dart +++ b/lib/pages/message_history_page/message_history_page_model.dart @@ -1,9 +1,10 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/request_manager.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; + -import 'message_history_page_widget.dart' show MessageHistoryPageWidget; import 'package:flutter/material.dart'; +import 'package:hub/pages/message_history_page/message_history_page_widget.dart'; class MessageHistoryPageModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. @@ -17,6 +18,10 @@ class MessageHistoryPageModel extends FlutterFlowModel TextEditingController? textController; String? Function(BuildContext, String?)? textControllerValidator; + TabController? tabBarController; + int get tabBarCurrentIndex => + tabBarController != null ? tabBarController!.index : 0; + /// Query cache managers for this widget. final _getLiberationsManager = StreamRequestManager(); @@ -42,9 +47,11 @@ class MessageHistoryPageModel extends FlutterFlowModel unfocusNode.dispose(); textFieldFocusNode?.dispose(); textController?.dispose(); + tabBarController?.dispose(); + /// Dispose query cache managers for this widget. clearGetLiberationsCache(); } -} +} \ No newline at end of file diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart index 00a96f6f..18cffa18 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -2,22 +2,21 @@ import 'dart:developer'; -import 'package:f_r_e_hub/actions/actions.dart'; -import 'package:f_r_e_hub/backend/push_notification/pushNotificationService.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/visit_request_template_component/visit_request_template_component_widget.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; + +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/message_history_page/message_history_page_model.dart'; + -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/custom_functions.dart' as functions; -import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'message_history_page_model.dart'; class MessageHistoryPageWidget extends StatefulWidget { const MessageHistoryPageWidget({super.key}); @@ -27,7 +26,7 @@ class MessageHistoryPageWidget extends StatefulWidget { _MessageHistoryPageWidgetState(); } -class _MessageHistoryPageWidgetState extends State { +class _MessageHistoryPageWidgetState extends State with TickerProviderStateMixin { late MessageHistoryPageModel _model; final scaffoldKey = GlobalKey(); @@ -37,6 +36,12 @@ class _MessageHistoryPageWidgetState extends State { super.initState(); _model = createModel(context, () => MessageHistoryPageModel()); + _model.tabBarController = TabController( + vsync: this, + length: 3, + initialIndex: 1, + )..addListener(() => setState(() {})); + _model.textController ??= TextEditingController(); _model.textFieldFocusNode ??= FocusNode(); } @@ -56,21 +61,16 @@ class _MessageHistoryPageWidgetState extends State { @override Widget build(BuildContext context) { context.watch(); - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: appBarLiberationHistoryPage(context), - body: bodyLiberationHistoryPage(context, _model), - ), + return Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: appBarMessage(context), + body: bodyMessage(context, _model), ); } } -PreferredSizeWidget appBarLiberationHistoryPage(BuildContext context) { +PreferredSizeWidget appBarMessage(BuildContext context) { return AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, automaticallyImplyLeading: false, @@ -89,8 +89,9 @@ PreferredSizeWidget appBarLiberationHistoryPage(BuildContext context) { }, ), title: Text( - FFLocalizations.of(context).getText( - '784f83pc' /* Histórico de Liberação */, + FFLocalizations.of(context).getVariableText( + enText: 'Message History', + ptText: 'Histórico de Mensagens', ), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Nunito', @@ -105,7 +106,7 @@ PreferredSizeWidget appBarLiberationHistoryPage(BuildContext context) { ); } -Widget bodyLiberationHistoryPage( +Widget bodyMessage( BuildContext context, MessageHistoryPageModel _model) { return SafeArea( top: true, @@ -113,7 +114,55 @@ Widget bodyLiberationHistoryPage( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded(child: liberationDynamicListView(context, _model)), + Align( + alignment: const Alignment(0.0, 0), + child: TabBar( + labelColor: FlutterFlowTheme.of(context).primaryText, + unselectedLabelColor: FlutterFlowTheme.of(context).primaryText, + labelStyle: FlutterFlowTheme.of(context).titleMedium.override( + fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, + fontSize: 13.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleMediumFamily), + ), + unselectedLabelStyle: const TextStyle(), + indicatorColor: FlutterFlowTheme.of(context).primary, + padding: const EdgeInsets.all(4.0), + tabs: [ + Tab( + text: FFLocalizations.of(context).getVariableText( + ptText: 'Pessoal', + enText: 'Personal', + ), + ), + Tab( + text: FFLocalizations.of(context).getVariableText( + enText: 'All', + ptText: 'Todos', + ), + ), + Tab( + text: FFLocalizations.of(context).getVariableText( + ptText: 'Global', + enText: 'Global', + ), + ), + ], + controller: _model.tabBarController, + onTap: (i) async { + [() async {}, () async {}][i](); + }, + ), + ), + Expanded(child: TabBarView( + controller: _model.tabBarController, + children: [ + liberationDynamicListView(context, _model, 'P'), + liberationDynamicListView(context, _model, 'A'), + liberationDynamicListView(context, _model, 'T'), + ] + )), ].addToStart(const SizedBox(height: 0)), ), ); @@ -125,22 +174,31 @@ Widget bodyLiberationHistoryPage( Widget liberationDynamicListView( BuildContext context, MessageHistoryPageModel _model, + String DestIndex ) { return Container( width: double.infinity, height: double.infinity, decoration: const BoxDecoration(), - child: StreamBuilder( - stream: _model.getLiberations( - requestFn: () => PhpGroup.getLiberationsCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getSolicitacoes', - ), - ), + child: FutureBuilder( + future: PhpGroup.getMessagesCall.call( + devUUID: FFAppState().devUUID.toString(), + userUUID: FFAppState().userUUID.toString(), + cliID: FFAppState().cliUUID.toString(), + atividade: 'getMensagens', + pageSize: '100', + pageNumber: '1', + tipoDestino: DestIndex, + ).catchError((error) { + log('Error: ${error.toString()}'); + return Future.delayed(Duration(seconds: 1), () { + return Center( + child: Text('Erro ao carregar mensagens'), + ); + }); + }), builder: (context, snapshot) { - if (!snapshot.hasData) { + if (snapshot.connectionState == ConnectionState.waiting) { return Center( child: SizedBox( width: 50.0, @@ -152,50 +210,22 @@ Widget liberationDynamicListView( ), ); } - final columnGetLiberationsResponse = snapshot.data!; - final liberationHistory = PhpGroup.getLiberationsCall - .rqList( - columnGetLiberationsResponse.jsonBody, - ) - ?.toList() ?? - []; - final filteredLiberationHistory = _model.textController.text.isNotEmpty - ? liberationHistory - .where((item) => functions - .jsonToStr(getJsonField( - item, - r'''$.VTE_NOME''', - )) - .toLowerCase() - .contains( - _model.textController.text.toLowerCase(), - )) - .toList() - : liberationHistory; - + if (snapshot.hasError == true || snapshot.data == null) { + log('Error: ${snapshot.error.toString()}'); + // log('Error: ${snapshot.data!.jsonBody['mensagens']}'); + return const Center( + child: Text('Erro ao carregar mensagens'), + ); + } return ListView.builder( - itemCount: filteredLiberationHistory.length, + itemCount: snapshot.data!.jsonBody['total_rows'], addAutomaticKeepAlives: false, addRepaintBoundaries: true, cacheExtent: 1000.0, itemBuilder: (BuildContext context, int index) { - final liberationHistoryItem = filteredLiberationHistory[index]; - return Padding( - padding: EdgeInsets.only( - top: index == 0 - ? MediaQuery.of(context).size.height * 0.075 - : 8.0, - left: 8.0, - right: 8.0, - bottom: 8.0, - ), - child: Align( - alignment: AlignmentDirectional(0.0, 0.0), - child: liberationHistoryItemCard( - context, - liberationHistoryItem, - ), - ), + return messageHistoryItem( + context, + snapshot.data!.jsonBody['mensagens'][index], ); }, ); @@ -204,87 +234,71 @@ Widget liberationDynamicListView( ); } -Widget liberationHistoryItemCard( - BuildContext context, dynamic liberationHistoryItem) { - return CardItemTemplateComponentWidget( - imageHashMap: Map.from({ - 'key': liberationHistoryItem['VTE_ID'], - 'value': 'E', - }), - labelsHashMap: Map.from({ - 'Nome:': liberationHistoryItem['VTE_NOME'], - 'Data:': liberationHistoryItem['NOT_DTENVIO'], - 'Motivo:': liberationHistoryItem['NOT_MOTIVO'], - }), - statusHashMap: liberationHistoryItem['NOT_STATUS'] == 'L' - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Ativo', - enText: 'Active', - ): FlutterFlowTheme.of(context).success, - }) - : liberationHistoryItem['NOT_STATUS'] == 'B' - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Bloqueado', - enText: 'Blocked', - ): FlutterFlowTheme.of(context).error, - }) - : Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Pendente', - enText: 'Pending', - ): FlutterFlowTheme.of(context).warning, - }), - onTapCardItemAction: () async { - showModalBottomSheet( - isScrollControlled: true, - isDismissible: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - context: context, - builder: (context) { - return VisitRequestTemplateComponentWidget( - vteName: liberationHistoryItem['VTE_NOME'], - vteReason: liberationHistoryItem['NOT_MOTIVO'], - vawDate: liberationHistoryItem['NOT_STATUS'] == 'S' - ? liberationHistoryItem['NOT_DTENVIO'] - : liberationHistoryItem['NOT_DTRESPOSTA'], - vawStatus: liberationHistoryItem['NOT_STATUS'], - vteMsg: liberationHistoryItem['NOT_MSGENVIO'], - vteUUID: liberationHistoryItem['VTE_ID'], - cliUUID: FFAppState().cliUUID, - msgUUID: liberationHistoryItem['NOT_ID'], - vawDestino: liberationHistoryItem['NOT_DESTINO'], - vawUUID: liberationHistoryItem['NOT_ID'], - vawName: liberationHistoryItem['NOT_NOME'], - vawRef: liberationHistoryItem['NOT_ID'], - changeStatusAction: changeStatusAction, - // vteDocument: liberationHistoryItem['VTE_DOCUMENTO'], - ); - }, - ).then((_) { - PushNotificationManager _pushNotificationService = - PushNotificationManager(); - - _pushNotificationService.onMessageReceived.listen((received) { - if (received.data['click_action'] == 'cancel_request') { - log('Aprovado'); - _pushNotificationService.dispose(); - snackbar(context, opt: true); - context.pushReplacementNamed( - 'liberationHistory', - extra: { - kTransitionInfoKey: const TransitionInfo( - hasTransition: true, - transitionType: PageTransitionType.scale, - alignment: Alignment.bottomCenter, - ), - }, - ); - } - }); - }); - }, +Widget messageHistoryItem( + BuildContext context, dynamic jsonBody) { + log(jsonBody.toString()); + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 15), + child: Card( + child: Container( + // height: 100, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.only(left: 15.0), + child: Text( + jsonBody['MSG_DATE'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: FlutterFlowTheme.of(context).primary, + overflow: TextOverflow.ellipsis, + ), + ), + ), + Icon( + jsonBody['MSG_DESTINO_TP'] == 'T' + ? Icons.group + : Icons.person, + color: FlutterFlowTheme.of(context).accent1, + ) + ], + ), + SizedBox(height: 8), + Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Text( + jsonBody['MSG_ORIGEM_DESC'].toString(), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: FlutterFlowTheme.of(context).primary, + ), + overflow: TextOverflow.fade, + ), + ), + ), + ], + ), + SizedBox(height: 8), + Text(jsonBody['MSG_TEXTO'].toString(),), + ], + ), + ), + ), + ), ); -} + + +} \ No newline at end of file diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart index 31fed050..cc62f4f5 100644 --- a/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart +++ b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart @@ -1,7 +1,7 @@ -import '/flutter_flow/flutter_flow_util.dart'; -import 'people_on_the_property_page_widget.dart' - show PeopleOnThePropertyPageWidget; + import 'package:flutter/material.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/pages/people_on_the_property_page/people_on_the_property_page_widget.dart'; class PeopleOnThePropertyPageModel extends FlutterFlowModel { @@ -16,4 +16,4 @@ class PeopleOnThePropertyPageModel void dispose() { unfocusNode.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart index aed5b8f0..0dbfce20 100644 --- a/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart +++ b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart @@ -1,14 +1,18 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/people_on_the_property_page/people_on_the_property_page_model.dart'; + + import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'people_on_the_property_page_model.dart'; -export 'people_on_the_property_page_model.dart'; + class PeopleOnThePropertyPageWidget extends StatefulWidget { const PeopleOnThePropertyPageWidget({super.key}); @@ -41,138 +45,120 @@ class _PeopleOnThePropertyPageWidgetState Widget build(BuildContext context) { context.watch(); - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, + return Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - forceMaterialTransparency: true, - leading: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 30.0, - borderWidth: 1.0, - buttonSize: 60.0, - icon: Icon( - Icons.keyboard_arrow_left, - color: FlutterFlowTheme.of(context).primaryText, - size: 30.0, - ), - onPressed: () async { - context.pop(); - }, + automaticallyImplyLeading: false, + forceMaterialTransparency: true, + leading: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: FlutterFlowTheme.of(context).primaryText, + size: 30.0, ), - title: Text( - FFLocalizations.of(context).getText( - 'nsu13r5d' /* Pessoas na Propriedade */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - actions: const [], - centerTitle: true, - elevation: 0.0, + onPressed: () async { + context.pop(); + }, ), - body: SafeArea( - top: true, - child: FutureBuilder( - future: PhpGroup.getPessoasLocalCall.call( - cliID: FFAppState().cliUUID, - ownID: FFAppState().ownerUUID, - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - ), - builder: (context, snapshot) { - // Customize what your widget looks like when it's loading. - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context).primary, - size: 50.0, - ), - ), - ); - } - final columnGetPessoasLocalResponse = snapshot.data!; - return Builder( - builder: (context) { - final getPoepleProperty = PhpGroup.getPessoasLocalCall - .pessoas( - columnGetPessoasLocalResponse.jsonBody, - ) - ?.toList() ?? - []; - - return Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: List.generate(getPoepleProperty.length, - (getPoeplePropertyIndex) { - final getPoeplePropertyItem = - getPoepleProperty[getPoeplePropertyIndex]; - return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(4.0), - child: Container( - width: 50.0, - height: 50.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: CachedNetworkImage( - fadeInDuration: const Duration(milliseconds: 500), - fadeOutDuration: const Duration(milliseconds: 500), - imageUrl: 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - fit: BoxFit.cover, - ), - ), - ), - Text( - getJsonField( - getPoeplePropertyItem, - r'''$.USU_NOME''', - ).toString(), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ] - .divide(const SizedBox(width: 20.0)) - .addToStart(const SizedBox(width: 40.0)), - ); - }).divide(const SizedBox(height: 3.0)), - ); - }, - ); - }, + title: Text( + FFLocalizations.of(context).getText( + 'nsu13r5d' /* Pessoas na Propriedade */, ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + actions: const [], + centerTitle: true, + elevation: 0.0, + ), + body: SafeArea( + top: true, + child: FutureBuilder( + future: PhpGroup.getPessoasLocalCall.call( + cliID: FFAppState().cliUUID, + ownID: FFAppState().ownerUUID, + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context).primary, + size: 50.0, + ), + ), + ); + } + final columnGetPessoasLocalResponse = snapshot.data!; + final getPoepleProperty = PhpGroup.getPessoasLocalCall.pessoas(columnGetPessoasLocalResponse.jsonBody,)?.toList() ?? + []; + return ListView.builder( + physics: const AlwaysScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: getPoepleProperty.length, + itemBuilder: (context, index) { + final getPoeplePropertyItem = getPoepleProperty[index]; + return Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(4.0), + child: Container( + width: 50.0, + height: 50.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: CachedNetworkImage( + fadeInDuration: const Duration(milliseconds: 500), + fadeOutDuration: const Duration(milliseconds: 500), + imageUrl: + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + fit: BoxFit.cover, + ), + ), + ), + Text( + getJsonField( + getPoeplePropertyItem, + r'''$.USU_NOME''', + ).toString(), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontSize: 14.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + ), + ] + .divide(const SizedBox(width: 20.0)) + .addToStart(const SizedBox(width: 40.0)), + ); + }, + ); + }, ), ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index bc06c770..4668af2e 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -1,11 +1,16 @@ import 'dart:developer'; -import 'package:f_r_e_hub/backend/api_requests/api_calls.dart'; -import 'package:f_r_e_hub/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:f_r_e_hub/flutter_flow/flutter_flow_util.dart'; + + +import 'package:hub/app_state.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + import 'package:flutter/material.dart'; +import 'package:hub/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; class PreferencesPageModel with ChangeNotifier { final unfocusNode = FocusNode(); @@ -135,8 +140,8 @@ class PreferencesPageModel with ChangeNotifier { ) .then((value) { FFAppState().pass = true; - var error = jsonDecode(value.jsonBody['error'].toString()); - log('${jsonDecode(value.jsonBody['error'].toString())}'); + // var error = jsonDecode(value.jsonBody['error'].toString()); + // log('${jsonDecode(value.jsonBody['error'].toString())}'); if(jsonDecode(value.jsonBody['error'].toString()) == false) { FFAppState().pass = true; } else { diff --git a/lib/pages/preferences_settings_page/preferences_settings_widget.dart b/lib/pages/preferences_settings_page/preferences_settings_widget.dart index 9e803f27..f2173bfd 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_widget.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_widget.dart @@ -1,10 +1,14 @@ import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/app_state.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/preferences_settings_page/preferences_settings_model.dart'; import 'package:provider/provider.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'preferences_settings_model.dart'; + class PreferencesPageWidget extends StatelessWidget { const PreferencesPageWidget({super.key}); @@ -62,14 +66,14 @@ class PreferencesPageWidget extends StatelessWidget { Container(), Expanded( flex: 2, - child: GridView.builder( - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, - crossAxisSpacing: 12.0, - mainAxisSpacing: 12.0, - childAspectRatio: 1.0, - mainAxisExtent: 100.0, - ), + child: ListView.builder( + // gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( + // crossAxisCount: 3, + // crossAxisSpacing: 12.0, + // mainAxisSpacing: 12.0, + // childAspectRatio: 1.0, + // mainAxisExtent: 100.0, + // ), itemCount: 6, // Assuming 4 items for simplicity padding: const EdgeInsets.symmetric(horizontal: 20.0), physics: const AlwaysScrollableScrollPhysics(), @@ -90,51 +94,106 @@ class PreferencesPageWidget extends StatelessWidget { IconData icon; Function() onPressed =() => {}; bool isEnabled; + String content; switch (index) { case 0: icon = Icons.fingerprint; - onPressed = () => model.toggleFingerprint(context); // Desabilita se fingerprint for false + onPressed = () => model.toggleFingerprint(context); // Disable if fingerprint is false isEnabled = FFAppState().fingerprint; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative a autenticação por impressão digital para login seguro.', + enText: 'Enable fingerprint authentication for secure login.', + ); break; case 1: icon = Icons.person; onPressed = () => model.enablePerson(context); isEnabled = FFAppState().person; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Exibir código de identificação remota', + enText: 'Display remote identification code', + ); break; case 2: icon = Icons.notifications; onPressed = model.toggleNotify; isEnabled = FFAppState().notify; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para receber sua notificação de acesso', + enText: 'Enable to receive your access notification', + ); break; case 3: icon = Icons.lock_clock_sharp; // onLongPress = model.togglePass(context, model); isEnabled = FFAppState().pass; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para inserir uma credencial de acesso para o QRCode', + enText: 'Enable to enter an access credential for the QRCode', + ); break; case 4: icon = Icons.landscape; onPressed = model.localLogout; isEnabled = false; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Ative para se desvincular do local selecionado', + enText: 'Enable to unlink from the selected location', + ); break; case 5: icon = Icons.delete; onPressed = () => model.deleteAccount(context); isEnabled = false; + content = FFLocalizations.of(context).getVariableText( + ptText: 'Delete sua conta e todos os dados associados permanentemente.', + enText: 'Delete your account and all associated data permanently.', + ); break; default: throw Exception('Invalid index: $index'); } - return FlutterFlowIconButton( - icon: Icon(icon, color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, size: 40.0), - onPressed: index != 3 ? onPressed : () {model.togglePass(context);}, - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - fillColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, - disabledColor: FlutterFlowTheme.of(context).alternate, - disabledIconColor: FlutterFlowTheme.of(context).primary, + return Container( + height: 100, + child: GestureDetector( + onTap: index != 3 ? onPressed : () {model.togglePass(context);}, + child: Row( + children: [ + CircleAvatar( + backgroundColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, + child: Icon( + icon, + color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, + // icon: Icon(icon, color: isEnabled ? FlutterFlowTheme.of(context).primaryBackground : FlutterFlowTheme.of(context).primary, size: 40.0), + // onPressed: index != 3 ? onPressed : () {model.togglePass(context);}, + // borderRadius: 20.0, + // borderWidth: 1.0, + // buttonSize: 40.0, + // fillColor: isEnabled ? FlutterFlowTheme.of(context).primary : FlutterFlowTheme.of(context).alternate, + // disabledColor: FlutterFlowTheme.of(context).alternate, + // disabledIconColor: FlutterFlowTheme.of(context).primary, + ), + ), + SizedBox(width: 8.0), + Expanded( + child: Text( + content, + style: FlutterFlowTheme.of(context).bodySmall.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + ), + overflow: TextOverflow.clip, + ), + ), + ], + ), + ), ); } } \ No newline at end of file diff --git a/lib/pages/qr_code_page/qr_code_page_model.dart b/lib/pages/qr_code_page/qr_code_page_model.dart index 7770c77e..40e016ab 100644 --- a/lib/pages/qr_code_page/qr_code_page_model.dart +++ b/lib/pages/qr_code_page/qr_code_page_model.dart @@ -1,7 +1,7 @@ -import '/flutter_flow/flutter_flow_util.dart'; import 'dart:async'; -import 'qr_code_page_widget.dart' show QrCodePageWidget; import 'package:flutter/material.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/pages/qr_code_page/qr_code_page_widget.dart'; class QrCodePageModel extends FlutterFlowModel { /// Local state fields for this page. @@ -29,4 +29,4 @@ class QrCodePageModel extends FlutterFlowModel { BuildContext context, { required String? key, }) async {} -} +} \ No newline at end of file diff --git a/lib/pages/qr_code_page/qr_code_page_widget.dart b/lib/pages/qr_code_page/qr_code_page_widget.dart index b165965a..a6994b95 100644 --- a/lib/pages/qr_code_page/qr_code_page_widget.dart +++ b/lib/pages/qr_code_page/qr_code_page_widget.dart @@ -1,24 +1,30 @@ +import 'dart:developer'; + import 'package:barcode_widget/barcode_widget.dart'; -import 'package:f_r_e_hub/actions/actions.dart'; -import 'package:f_r_e_hub/flutter_flow/custom_functions.dart'; +import 'package:hub/actions/actions.dart'; + +import 'package:hub/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_animations.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + +import 'package:hub/pages/qr_code_page/qr_code_page_model.dart'; import 'package:percent_indicator/circular_percent_indicator.dart'; -import '/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_animations.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; + import 'dart:async'; -import '/flutter_flow/custom_functions.dart' as functions; // import 'package:barcode_widget/barcode_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:google_fonts/google_fonts.dart'; // import 'package:percent_indicator/percent_indicator.dart'; -import 'qr_code_page_model.dart'; -export 'qr_code_page_model.dart'; + import 'package:qr_flutter/qr_flutter.dart'; @@ -99,16 +105,11 @@ void dispose() { @override Widget build(BuildContext context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Scaffold( - key: scaffoldKey, - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: buildAppBar(context), - body: buildBody(context), - ), + return Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + appBar: buildAppBar(context), + body: buildBody(context), ); } @@ -117,16 +118,15 @@ void dispose() { double screenHeight = MediaQuery.of(context).size.height; double smallerDimension = screenWidth < screenHeight ? screenWidth : screenHeight; double dimension = smallerDimension * 0.75; - double totalTimeInSeconds = 100.0; return SafeArea( - top: true, + // top: true, child: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ if (_model.isAccess == true && _model.key != null) - Text( + Text( FFLocalizations.of(context).getVariableText( ptText: 'Use esse QR Code para acesso', enText: 'Use this QR Code for access', @@ -148,9 +148,12 @@ void dispose() { alignment: const AlignmentDirectional(0.0, 0.0), child: InkWell( onTap: () { - safeSetState(() { - - }); + + safeSetState(() async { + _resetAnimationAndToggleAccess(); + FFAppState().fingerprint ? await _showBiometricsAuth(context) : await _showQrCodeBottomSheet(context); + }); + }, child: buildQrCode( dimension: dimension, @@ -181,7 +184,7 @@ void dispose() { ), ), if (_model.isAccess == false && _model.key == null) - Align( + Align( alignment: const AlignmentDirectional(0.0, 0.0), child: InkWell( splashColor: Colors.transparent, @@ -203,10 +206,7 @@ void dispose() { alignment: const AlignmentDirectional(0.0, 0.0), child: FFButtonWidget( onPressed: () async { - await _showQrCodeBottomSheet(context).then((value) => _toggleQrCodeAccess()).onError((error, stackTrace) => safeSetState((){ - _resetAnimationAndToggleAccess(); - })); - + FFAppState().fingerprint ? await _showBiometricsAuth(context) : await _showQrCodeBottomSheet(context); }, text: FFLocalizations.of(context).getVariableText( ptText: 'Gerar QR Code', @@ -311,7 +311,7 @@ void dispose() { padding: const EdgeInsetsDirectional.fromSTEB( 0.0, 0.0, 20.0, 0.0), child: StreamBuilder( - stream: functions.getProgressValue(), + stream: getProgressValue(), builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { return CircularProgressIndicator(); @@ -359,20 +359,28 @@ void dispose() { ); } - void _toggleQrCodeAccess() { - if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { - animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop(); - animationsMap['barcodeOnActionTriggerAnimation']!.controller.reverse(); + + + Future _showBiometricsAuth(BuildContext context) async { + FFAppState().checkBiometrics() + .then((value) => FFAppState().authenticateBiometric() + .then( (value) { + safeSetState(() { + if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { + animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop(); + animationsMap['barcodeOnActionTriggerAnimation']!.controller.reverse(); + } + _model.isAccess = !_model.isAccess; + _model.key = FFAppState().fingerprintPass; + }); + } )) + .onError((error, StackTrace) { + _showQrCodeBottomSheet(context); + }); + } - _model.isAccess = !_model.isAccess; - setState(() {}); -} Future _showQrCodeBottomSheet(BuildContext context) async { - if(FFAppState().fingerprint) { - FFAppState().checkBiometrics().then((value) => FFAppState().authenticateBiometric().then( (value) => safeSetState(() {_model.key = FFAppState().accessPass;}) )).catchError((error) => safeSetState((){_resetAnimationAndToggleAccess();})); - - } else { await showModalBottomSheet( isScrollControlled: true, backgroundColor: Colors.transparent, @@ -391,18 +399,26 @@ void dispose() { child: QrCodePassKeyTemplateComponentWidget( toggleActionStatus: (key) async { + log('Key: $key'); + safeSetState(() { + if (animationsMap['barcodeOnActionTriggerAnimation'] != null) { + animationsMap['barcodeOnActionTriggerAnimation']!.controller.stop(); + animationsMap['barcodeOnActionTriggerAnimation']!.controller.reverse(); + } + _model.isAccess = !_model.isAccess; _model.key = key; - setState(() {}); + }); }, ), ), ); }, - ).then((value) => safeSetState(() {})); - }; - - - + ) + + .catchError((error) => safeSetState((){ + log('Error: $error'); + _resetAnimationAndToggleAccess(); + })); unawaited( () async { await _model.qrCodeEncoder( @@ -415,7 +431,7 @@ void dispose() { } void _resetAnimationAndToggleAccess() { - setState(() { + safeSetState(() { // Reinicia a animação animationsMap['barcodeOnActionTriggerAnimation']!.controller.reset(); animationsMap['barcodeOnActionTriggerAnimation']!.controller.forward(); @@ -461,4 +477,4 @@ void dispose() { elevation: 0.0, ); } -} +} \ No newline at end of file diff --git a/lib/pages/register_visitor_page/register_visitor_page_model.dart b/lib/pages/register_visitor_page/register_visitor_page_model.dart index 08de852d..96b3252e 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_model.dart +++ b/lib/pages/register_visitor_page/register_visitor_page_model.dart @@ -55,4 +55,4 @@ class RegisterVisitorPageModel textFieldFocusNode4?.dispose(); textController4?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/register_visitor_page/register_visitor_page_widget.dart b/lib/pages/register_visitor_page/register_visitor_page_widget.dart index fb885d1b..c495da52 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_widget.dart +++ b/lib/pages/register_visitor_page/register_visitor_page_widget.dart @@ -1,3 +1,5 @@ +import 'package:hub/flutter_flow/nav/nav.dart'; + import '/backend/api_requests/api_calls.dart'; import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; import '/flutter_flow/flutter_flow_drop_down.dart'; @@ -66,7 +68,6 @@ class _RegisterVisitorPageWidgetState extends State { appBar: AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, automaticallyImplyLeading: false, - forceMaterialTransparency: true, leading: FlutterFlowIconButton( borderColor: Colors.transparent, borderRadius: 30.0, @@ -889,4 +890,4 @@ class _RegisterVisitorPageWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart index 155fc82c..f5192ee5 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart @@ -1,11 +1,12 @@ -import 'package:f_r_e_hub/backend/api_requests/api_manager.dart'; -import 'package:f_r_e_hub/flutter_flow/request_manager.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; + +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/form_field_controller.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; + -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/form_field_controller.dart'; -import 'schedule_complete_visit_page_widget.dart' - show ScheduleCompleteVisitPageWidget; import 'package:flutter/material.dart'; +import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; class ScheduleCompleteVisitPageModel extends FlutterFlowModel { diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart index a01ffeb6..8b684610 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart @@ -1,26 +1,29 @@ import 'dart:developer'; -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; -import '/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; -import '/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; -import '/flutter_flow/flutter_flow_drop_down.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; -import '/flutter_flow/form_field_controller.dart'; -import '/flutter_flow/custom_functions.dart' as functions; + import 'package:auto_size_text/auto_size_text.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; +import 'package:hub/components/templates_components/visitor_details_modal_template_component/visitor_details_modal_template_component_widget.dart'; +import 'package:hub/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_drop_down.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/form_field_controller.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart'; import 'package:provider/provider.dart'; -import 'schedule_complete_visit_page_model.dart'; -export 'schedule_complete_visit_page_model.dart'; + class ScheduleCompleteVisitPageWidget extends StatefulWidget { const ScheduleCompleteVisitPageWidget({ @@ -492,7 +495,7 @@ Widget scheduleVisit( }, getDocs: (docsParam) async { _model.visitorStrList = - functions.strListToStr( + strListToStr( docsParam!.toList()); setState(() {}); }, @@ -613,39 +616,7 @@ Widget scheduleVisit( ), ), Row( - mainAxisSize: MainAxisSize.max, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'qygj6ra5' /* Inicio da Visita */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), Expanded( child: Container( width: 100.0, @@ -657,7 +628,7 @@ Widget scheduleVisit( children: [ Padding( padding: const EdgeInsetsDirectional - .fromSTEB(10.0, 0.0, 24.0, 0.0), + .fromSTEB(24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController1, focusNode: _model.textFieldFocusNode1, @@ -782,7 +753,7 @@ Widget scheduleVisit( ), Padding( padding: const EdgeInsetsDirectional - .fromSTEB(10.0, 0.0, 24.0, 0.0), + .fromSTEB(24.0, 0.0, 24.0, 0.0), child: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, @@ -851,7 +822,7 @@ Widget scheduleVisit( ); }, ); - + TimeOfDay? datePicked1Time; if (datePicked1Date != null) { datePicked1Time = @@ -919,7 +890,7 @@ Widget scheduleVisit( }, ); } - + if (datePicked1Date != null && datePicked1Time != null) { safeSetState(() { @@ -970,37 +941,6 @@ Widget scheduleVisit( Row( mainAxisSize: MainAxisSize.max, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 40.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'p4ws3t66' /* Fim da Visita */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), Expanded( child: Container( width: 100.0, @@ -1012,7 +952,7 @@ Widget scheduleVisit( children: [ Padding( padding: const EdgeInsetsDirectional - .fromSTEB(10.0, 0.0, 24.0, 0.0), + .fromSTEB(24.0, 0.0, 24.0, 0.0), child: TextFormField( controller: _model.textController2, focusNode: _model.textFieldFocusNode2, @@ -1137,7 +1077,7 @@ Widget scheduleVisit( ), Padding( padding: const EdgeInsetsDirectional - .fromSTEB(10.0, 0.0, 24.0, 0.0), + .fromSTEB(24.0, 0.0, 24.0, 0.0), child: InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, @@ -1206,7 +1146,7 @@ Widget scheduleVisit( ); }, ); - + TimeOfDay? datePicked2Time; if (datePicked2Date != null) { datePicked2Time = @@ -1274,7 +1214,7 @@ Widget scheduleVisit( }, ); } - + if (datePicked2Date != null && datePicked2Time != null) { safeSetState(() { @@ -1355,41 +1295,10 @@ Widget scheduleVisit( Row( mainAxisSize: MainAxisSize.max, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 42.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '2f68zi9t' /* Motivo da Visita */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), Expanded( child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 24.0, 0.0), + 24.0, 0.0, 24.0, 0.0), child: Container( width: 100.0, height: 40.0, @@ -1488,41 +1397,10 @@ Widget scheduleVisit( Row( mainAxisSize: MainAxisSize.max, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 0.0), - child: Container( - width: 100.0, - height: 42.0, - decoration: const BoxDecoration(), - child: Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'il4di4ln' /* Nível de Acesso */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - ), Expanded( child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 24.0, 0.0), + 24.0, 0.0, 24.0, 0.0), child: Container( width: 100.0, height: 40.0, @@ -2306,7 +2184,7 @@ Widget visitHistory( decoration: BoxDecoration( color: valueOrDefault( () { - if (functions.jsonToStr( + if (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -2315,26 +2193,25 @@ Widget visitHistory( return FlutterFlowTheme .of(context) .success; - } else if ((functions - .jsonToStr( + } else if (( jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"C\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"F\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"B\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -2343,8 +2220,8 @@ Widget visitHistory( return FlutterFlowTheme .of(context) .error; - } else if (functions - .jsonToStr( + } else if ( + jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -2372,7 +2249,7 @@ Widget visitHistory( 0.0, 0.0), child: Text( () { - if (functions.jsonToStr( + if (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -2384,26 +2261,26 @@ Widget visitHistory( ptText: 'Ativo', enText: 'Active', ); - } else if ((functions - .jsonToStr( + } else if (( + jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"F\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"C\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"B\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart index 6166e387..8baf87a9 100644 --- a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart +++ b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart @@ -1,8 +1,9 @@ -import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import 'schedule_provisional_visit_page_widget.dart' - show ScheduleProvisionalVisitPageWidget; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; + + import 'package:flutter/material.dart'; +import 'package:hub/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart'; class ScheduleProvisionalVisitPageModel extends FlutterFlowModel { @@ -61,4 +62,4 @@ class ScheduleProvisionalVisitPageModel textFieldFocusNode3?.dispose(); textController3?.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart index 1b5639a8..6200de1c 100644 --- a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart +++ b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart @@ -1,16 +1,22 @@ -import '/backend/api_requests/api_calls.dart'; -import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; -import '/flutter_flow/flutter_flow_theme.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; + +import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; +import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + + + + import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart'; import 'package:provider/provider.dart'; -import 'schedule_provisional_visit_page_model.dart'; -export 'schedule_provisional_visit_page_model.dart'; + class ScheduleProvisionalVisitPageWidget extends StatefulWidget { const ScheduleProvisionalVisitPageWidget({super.key}); @@ -862,4 +868,4 @@ class _ScheduleProvisionalVisitPageWidgetState ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/sign_in_page/sign_in_page_model.dart b/lib/pages/sign_in_page/sign_in_page_model.dart index e8b945bd..6cea2517 100644 --- a/lib/pages/sign_in_page/sign_in_page_model.dart +++ b/lib/pages/sign_in_page/sign_in_page_model.dart @@ -21,4 +21,4 @@ class SignInPageModel extends FlutterFlowModel { unfocusNode.dispose(); signInTemplateComponentModel.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/sign_in_page/sign_in_page_widget.dart b/lib/pages/sign_in_page/sign_in_page_widget.dart index da1727c7..23b13170 100644 --- a/lib/pages/sign_in_page/sign_in_page_widget.dart +++ b/lib/pages/sign_in_page/sign_in_page_widget.dart @@ -56,4 +56,4 @@ class _SignInPageWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/sign_up_page/sign_up_page_model.dart b/lib/pages/sign_up_page/sign_up_page_model.dart index 938a3b46..349ee990 100644 --- a/lib/pages/sign_up_page/sign_up_page_model.dart +++ b/lib/pages/sign_up_page/sign_up_page_model.dart @@ -21,4 +21,4 @@ class SignUpPageModel extends FlutterFlowModel { unfocusNode.dispose(); signUpTemplateComponentModel.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/sign_up_page/sign_up_page_widget.dart b/lib/pages/sign_up_page/sign_up_page_widget.dart index 18c575ec..8d68605b 100644 --- a/lib/pages/sign_up_page/sign_up_page_widget.dart +++ b/lib/pages/sign_up_page/sign_up_page_widget.dart @@ -57,4 +57,4 @@ class _SignUpPageWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/lib/pages/test_page/test_page.dart b/lib/pages/test_page/test_page.dart index 522b0d2d..c8e9cc15 100644 --- a/lib/pages/test_page/test_page.dart +++ b/lib/pages/test_page/test_page.dart @@ -1,63 +1,63 @@ -import 'dart:developer'; +// import 'dart:developer'; -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/flutter_flow/flutter_flow_theme.dart'; -import 'package:flutter/material.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/flutter_flow/flutter_flow_theme.dart'; +// import 'package:flutter/material.dart'; -class TestPage extends StatelessWidget { - const TestPage({Key? key}) : super(key: key); +// class TestPage extends StatelessWidget { +// const TestPage({Key? key}) : super(key: key); - @override - Widget build(BuildContext context) { - // Exemplo de dados para os HashMaps - final Map labelsHashMap = { - 'Nome:': 'Gabriel da Silva', - 'Entrada:': '08:00 AM 01/01/2022', - 'Saída:': '17:00 PM 01/01/2022', - }; +// @override +// Widget build(BuildContext context) { +// // Exemplo de dados para os HashMaps +// final Map labelsHashMap = { +// 'Nome:': 'Gabriel da Silva', +// 'Entrada:': '08:00 AM 01/01/2022', +// 'Saída:': '17:00 PM 01/01/2022', +// }; - // Ajuste para o novo tipo esperado pelo componente - final Map statusHashMap = { - 'Ativo': FlutterFlowTheme.of(context).success, - }; +// // Ajuste para o novo tipo esperado pelo componente +// final Map statusHashMap = { +// 'Ativo': FlutterFlowTheme.of(context).success, +// }; - // função set statusHashMap que recebe um String status faz um switch case e retorna um Map - Map getStatusHashMap(String status) { - switch (status) { - case 'Ativo': - return {'Ativo': FlutterFlowTheme.of(context).success}; - case 'Inativo': - return {'Inativo': FlutterFlowTheme.of(context).error}; - default: - return {'Desconhecido': FlutterFlowTheme.of(context).primaryColor}; - } - } +// // função set statusHashMap que recebe um String status faz um switch case e retorna um Map +// Map getStatusHashMap(String status) { +// switch (status) { +// case 'Ativo': +// return {'Ativo': FlutterFlowTheme.of(context).success}; +// case 'Inativo': +// return {'Inativo': FlutterFlowTheme.of(context).error}; +// default: +// return {'Desconhecido': FlutterFlowTheme.of(context).primaryColor}; +// } +// } - // Ajuste para passar os valores corretos para a URL da imagem - final Map imageKeyValue = { - 'key': 'docID', - 'value': 'imageType', - }; +// // Ajuste para passar os valores corretos para a URL da imagem +// final Map imageKeyValue = { +// 'key': 'docID', +// 'value': 'imageType', +// }; - return Scaffold( - appBar: AppBar( - title: const Text('Test Page'), - ), - body: Center( - child: ListView.builder( - itemCount: 10, - itemBuilder: (context, index) { - return CardItemTemplateComponentWidget( - labelsHashMap: labelsHashMap, - statusHashMap: statusHashMap, - imageHashMap: imageKeyValue, - onTapCardItemAction: () async { - // Ação ao tocar no card - log('Card tapped'); - }, - ); - }), - ), - ); - } -} +// return Scaffold( +// appBar: AppBar( +// title: const Text('Test Page'), +// ), +// body: Center( +// child: ListView.builder( +// itemCount: 10, +// itemBuilder: (context, index) { +// return CardItemTemplateComponentWidget( +// labelsHashMap: labelsHashMap, +// statusHashMap: statusHashMap, +// imageHashMap: imageKeyValue, +// onTapCardItemAction: () async { +// // Ação ao tocar no card +// log('Card tapped'); +// }, +// ); +// }), +// ), +// ); +// } +// } diff --git a/lib/pages/visit_history_page/visit_history_page_model.dart b/lib/pages/visit_history_page/visit_history_page_model.dart index 327fe168..c0c3bed8 100644 --- a/lib/pages/visit_history_page/visit_history_page_model.dart +++ b/lib/pages/visit_history_page/visit_history_page_model.dart @@ -1,10 +1,11 @@ -import 'package:f_r_e_hub/backend/api_requests/api_manager.dart'; -import 'package:f_r_e_hub/flutter_flow/request_manager.dart'; -import 'package:flutter/material.dart'; -import '/flutter_flow/flutter_flow_util.dart'; -import '/flutter_flow/form_field_controller.dart'; -import 'visit_history_page_widget.dart' show VisitHistoryPageWidget; + +import 'package:flutter/material.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; +import 'package:hub/flutter_flow/flutter_flow_model.dart'; +import 'package:hub/flutter_flow/form_field_controller.dart'; +import 'package:hub/flutter_flow/request_manager.dart'; +import 'package:hub/pages/visit_history_page/visit_history_page_widget.dart'; class VisitHistoryPageModel extends FlutterFlowModel { final _visitHistoryManager = FutureRequestManager(); @@ -104,4 +105,4 @@ class VisitHistoryPageModel extends FlutterFlowModel { return false; } -} +} \ No newline at end of file diff --git a/lib/pages/visit_history_page/visit_history_page_widget.dart b/lib/pages/visit_history_page/visit_history_page_widget.dart index ad681eb1..52130219 100644 --- a/lib/pages/visit_history_page/visit_history_page_widget.dart +++ b/lib/pages/visit_history_page/visit_history_page_widget.dart @@ -1,19 +1,23 @@ import 'dart:developer'; import 'package:cached_network_image/cached_network_image.dart'; -import 'package:f_r_e_hub/pages/visit_history_page/visit_history_page_model.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/backend/api_requests/api_manager.dart'; + +import 'package:hub/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; +import 'package:hub/flutter_flow/custom_functions.dart'; +import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; +import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/nav/nav.dart'; + +import 'package:hub/pages/visit_history_page/visit_history_page_model.dart'; import 'package:provider/provider.dart'; -import '/flutter_flow/custom_functions.dart' as functions; -import '../../backend/api_requests/api_calls.dart'; -import '../../components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; -import '../../flutter_flow/flutter_flow_icon_button.dart'; -import '../../flutter_flow/flutter_flow_theme.dart'; -import '../../flutter_flow/flutter_flow_util.dart'; class VisitHistoryPageWidget extends StatefulWidget { const VisitHistoryPageWidget({ @@ -327,10 +331,10 @@ Widget visitHistory( r'''$.VAW_OBS''', ).toString(), visitorImgPath: valueOrDefault( - 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( visitaWrapItem, r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E', + ).toString()}&tipo=E", 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', ), visitorStrList: getJsonField( @@ -574,7 +578,7 @@ Widget visitHistory( decoration: BoxDecoration( color: valueOrDefault( () { - if (functions.jsonToStr( + if (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -583,26 +587,26 @@ Widget visitHistory( return FlutterFlowTheme .of(context) .success; - } else if ((functions - .jsonToStr( + } else if (( + jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"C\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"F\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"B\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -611,8 +615,8 @@ Widget visitHistory( return FlutterFlowTheme .of(context) .error; - } else if (functions - .jsonToStr( + } else if ( + jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -640,7 +644,7 @@ Widget visitHistory( 0.0, 0.0), child: Text( () { - if (functions.jsonToStr( + if (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -652,26 +656,26 @@ Widget visitHistory( ptText: 'Ativo', enText: 'Active', ); - } else if ((functions - .jsonToStr( + } else if (( + jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"F\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"C\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', )) == '\"B\"') || - (functions.jsonToStr( + (jsonToStr( getJsonField( visitaWrapItem, r'''$.VAW_STATUS''', @@ -751,4 +755,4 @@ Widget visitHistory( ), ), ); -} +} \ No newline at end of file diff --git a/lib/pages/welcome_page/welcome_page_model.dart b/lib/pages/welcome_page/welcome_page_model.dart index b8a54a7e..4c08929e 100644 --- a/lib/pages/welcome_page/welcome_page_model.dart +++ b/lib/pages/welcome_page/welcome_page_model.dart @@ -25,4 +25,4 @@ class WelcomePageModel extends FlutterFlowModel { unfocusNode.dispose(); welcomeTemplateComponentModel.dispose(); } -} +} \ No newline at end of file diff --git a/lib/pages/welcome_page/welcome_page_widget.dart b/lib/pages/welcome_page/welcome_page_widget.dart index 6089703a..5ec8a486 100644 --- a/lib/pages/welcome_page/welcome_page_widget.dart +++ b/lib/pages/welcome_page/welcome_page_widget.dart @@ -77,4 +77,4 @@ class _WelcomePageWidgetState extends State { ), ); } -} +} \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 7c09b904..276cf9cc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,4 +1,4 @@ -name: f_r_e_hub +name: hub description: A new Flutter project. # The following line prevents the package from being accidentally published to @@ -133,6 +133,7 @@ flutter_launcher_icons: adaptive_icon_foreground: 'assets/images/adaptive_foreground_icon.svg' + # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec @@ -148,6 +149,8 @@ flutter: assets: - assets/fonts/ - assets/images/ + - assets/images/dark/ + - assets/images/light/ - assets/videos/ - assets/audios/ - assets/lottie_animations/ @@ -195,4 +198,3 @@ flutter: # # For details regarding fonts from package dependencies, # see https://flutter.dev/custom-fonts/#from-packages - diff --git a/test/widget_test.dart b/test/widget_test.dart index 9e847a93..76de18a9 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -1,17 +1,17 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility that Flutter provides. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. +// // This is a basic Flutter widget test. +// // +// // To perform an interaction with a widget in your test, use the WidgetTester +// // utility that Flutter provides. For example, you can send tap and scroll +// // gestures. You can also use WidgetTester to find child widgets in the widget +// // tree, read text, and verify that the values of widget properties are correct. -import 'package:flutter_test/flutter_test.dart'; +// import 'package:flutter_test/flutter_test.dart'; -import 'package:f_r_e_hub/main.dart'; +// import 'package:f_r_e_hub/main.dart'; -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(MyApp()); - }); -} +// void main() { +// testWidgets('Counter increments smoke test', (WidgetTester tester) async { +// // Build our app and trigger a frame. +// await tester.pumpWidget(MyApp()); +// }); +// }