diff --git a/assets/images/home.png b/assets/images/home.png index 6682503e..8e391e50 100644 Binary files a/assets/images/home.png and b/assets/images/home.png differ diff --git a/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart b/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart index 5951ef8a..60adbaa4 100644 --- a/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart +++ b/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart @@ -1,10 +1,8 @@ - import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/components/molecular_components/order_filter_modal/order_filter_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'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; class OrderFilterModalWidget extends StatefulWidget { final String defaultAdresseeType; @@ -25,12 +23,28 @@ class _OrderFilterModalWidgetState extends State { late Map selected; final List> adresseeTypeOptions = [ - {'title': 'Morador', 'value': 'MOR'}, - {'title': 'Propriedade', 'value': 'PRO'}, + { + 'title': FFLocalizations.of(AppState().context!) + .getVariableText(enText: 'Resident', ptText: 'Morador'), + 'value': 'MOR' + }, + { + 'title': FFLocalizations.of(AppState().context!) + .getVariableText(enText: 'Property', ptText: 'Propriedade'), + 'value': 'PRO' + }, ]; final List> statusOptions = [ - {'title': 'Aguardando Retirada', 'value': 'notPickedUp'}, - {'title': 'Retirado', 'value': 'pickedUp'}, + { + 'title': FFLocalizations.of(AppState().context!).getVariableText( + ptText: 'Aguardando Retirada', enText: 'Waiting for Pickup'), + 'value': 'notPickedUp' + }, + { + 'title': FFLocalizations.of(AppState().context!) + .getVariableText(ptText: 'Retirado', enText: 'Picked Up'), + 'value': 'pickedUp' + }, ]; @override @@ -46,8 +60,12 @@ class _OrderFilterModalWidgetState extends State { _model = createModel(context, () => OrderFilterModalModel()); selected = { - 'adresseeType': widget.defaultAdresseeType == '.*' ? ['MOR', 'PRO'] : [widget.defaultAdresseeType], - 'status': widget.defaultStatus == '.*' ? ['notPickedUp', 'pickedUp'] : [widget.defaultStatus], + 'adresseeType': widget.defaultAdresseeType == '.*' + ? ['MOR', 'PRO'] + : [widget.defaultAdresseeType], + 'status': widget.defaultStatus == '.*' + ? ['notPickedUp', 'pickedUp'] + : [widget.defaultStatus], }; } @@ -76,7 +94,8 @@ class _OrderFilterModalWidgetState extends State { Navigator.pop(context, filterResult); } - Widget _buildCheckboxListTile(String key, List> options, double fontsize) { + Widget _buildCheckboxListTile( + String key, List> options, double fontsize) { return Column( children: [ Row( @@ -89,13 +108,13 @@ class _OrderFilterModalWidgetState extends State { key == 'status' ? 'Status' : 'Destinátario', textAlign: TextAlign.left, style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: fontsize, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - color: FlutterFlowTheme.of(context).primaryText, - ), + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontSize: fontsize, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + color: FlutterFlowTheme.of(context).primaryText, + ), ), ), ], @@ -110,12 +129,13 @@ class _OrderFilterModalWidgetState extends State { title: Text( option['title']!, style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - fontSize: fontsize, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), - color: FlutterFlowTheme.of(context).primaryText, - ), + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontSize: fontsize, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + color: FlutterFlowTheme.of(context).primaryText, + ), ), dense: true, value: selected[key]!.contains(option['value']), @@ -141,7 +161,8 @@ class _OrderFilterModalWidgetState extends State { width: 5, color: FlutterFlowTheme.of(context).secondaryText, ), - controlAffinity: ListTileControlAffinity.leading, // Adiciona esta linha + controlAffinity: + ListTileControlAffinity.leading, // Adiciona esta linha ); }, ), @@ -177,17 +198,17 @@ class _OrderFilterModalWidgetState extends State { FFLocalizations.of(context) .getText('yfj9pd6k'), // Filtros style: - FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: FlutterFlowTheme.of(context) - .headlineMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 18.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .headlineMediumFamily), - ), + FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: FlutterFlowTheme.of(context) + .headlineMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 18.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .headlineMediumFamily), + ), ), ), ], @@ -199,7 +220,8 @@ class _OrderFilterModalWidgetState extends State { child: Column( mainAxisSize: MainAxisSize.min, children: [ - _buildCheckboxListTile('adresseeType', adresseeTypeOptions, 14), + _buildCheckboxListTile( + 'adresseeType', adresseeTypeOptions, 14), _buildCheckboxListTile('status', statusOptions, 14), ], ), @@ -220,4 +242,4 @@ class _OrderFilterModalWidgetState extends State { ), ); } -} \ 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 35891ba4..e6b5b298 100644 --- a/lib/components/organism_components/menu_component/menu_component_widget.dart +++ b/lib/components/organism_components/menu_component/menu_component_widget.dart @@ -4,7 +4,6 @@ import 'package:hub/components/atomic_components/menu_button_item/menu_button_it import 'package:hub/components/atomic_components/menu_card_item/menu_card_item.dart'; import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; -import 'package:material_symbols_icons/symbols.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'; @@ -128,14 +127,36 @@ class _MenuComponentWidgetState extends State { else return [ MenuButtonWidget( - icon: Icons.share_location_outlined, + icon: Icons.engineering_outlined, + action: () async { + await _model.provisionalSchedule(context); + setState(() {}); + }, + title: FFLocalizations.of(context).getVariableText( + enText: 'Schedule\nProviders', + ptText: 'Agendar\nPrestadores', + ), + ), + MenuButtonWidget( + icon: Icons.sports_motorsports_outlined, + action: () async { + await _model.deliverySchedule(context); + setState(() {}); + }, + title: FFLocalizations.of(context).getVariableText( + enText: 'Schedule\nDeliveries', + ptText: 'Agendar\nEntregas', + ), + ), + MenuButtonWidget( + icon: Icons.attach_email_outlined, action: () async { await _model.fastPassAction(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( - enText: 'Fast\nVisit', - ptText: 'Agenda\nRápida', + ptText: 'Convidar\nVisitantes', + enText: 'Invite\nVisitors', ), ), MenuButtonWidget( @@ -160,17 +181,6 @@ class _MenuComponentWidgetState extends State { enText: 'My\nOrders', ), ), - MenuButtonWidget( - icon: Icons.engineering_outlined, - action: () async { - await _model.provisionalSchedule(context); - setState(() {}); - }, - title: FFLocalizations.of(context).getVariableText( - enText: 'Register\nProviders', - ptText: 'Cadastrar\nPrestadores', - ), - ), MenuButtonWidget( icon: Icons.event_available, action: () async { @@ -178,19 +188,8 @@ class _MenuComponentWidgetState extends State { setState(() {}); }, title: FFLocalizations.of(context).getVariableText( - ptText: 'Reserva\nde Itens', - enText: 'Item\nReservation', - ), - ), - MenuButtonWidget( - icon: Icons.sports_motorsports_outlined, - action: () async { - await _model.deliverySchedule(context); - setState(() {}); - }, - title: FFLocalizations.of(context).getVariableText( - enText: 'Register\nDeliveries', - ptText: 'Cadastrar\nEntregas', + ptText: 'Reservas', + enText: 'Reservations', ), ), MenuButtonWidget( @@ -216,14 +215,14 @@ class _MenuComponentWidgetState extends State { ), ), MenuButtonWidget( - icon: Icons.groups, + icon: Icons.transfer_within_a_station_outlined, action: () async { - await _model.peopleOnThePropertyAction(context); + await _model.accessHistoryAction(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( - enText: 'People on\nthe Property', - ptText: 'Pessoas na\nPropriedade', + enText: 'Access\nHistory', + ptText: 'Consultar\nAcessos', ), ), MenuButtonWidget( @@ -237,28 +236,6 @@ class _MenuComponentWidgetState extends State { ptText: 'Consultar\nLiberações', ), ), - MenuButtonWidget( - icon: Icons.transfer_within_a_station_outlined, - action: () async { - await _model.accessHistoryAction(context); - setState(() {}); - }, - title: FFLocalizations.of(context).getVariableText( - enText: 'Access\nHistory', - ptText: 'Consultar\nAcessos', - ), - ), - MenuButtonWidget( - icon: Symbols.location_away, - action: () async { - await _model.visitHistoryAction(context); - setState(() {}); - }, - title: FFLocalizations.of(context).getVariableText( - enText: 'Visit\nHistory', - ptText: 'Consultar\nVisitas', - ), - ), MenuButtonWidget( icon: Icons.chat_outlined, action: () async { @@ -270,6 +247,17 @@ class _MenuComponentWidgetState extends State { ptText: 'Consultar\nMensagens', ), ), + MenuButtonWidget( + icon: Icons.groups, + action: () async { + await _model.peopleOnThePropertyAction(context); + setState(() {}); + }, + title: FFLocalizations.of(context).getVariableText( + enText: 'People on\nthe Property', + ptText: 'Pessoas na\nPropriedade', + ), + ), MenuButtonWidget( icon: Icons.settings, action: () async { @@ -384,7 +372,7 @@ class _MenuComponentWidgetState extends State { setState(() {}); }, title: FFLocalizations.of(context).getVariableText( - enText: 'Provisional Schedule', + enText: 'Schedule Providers', ptText: 'Agendar Prestadores', ), ), @@ -395,19 +383,19 @@ class _MenuComponentWidgetState extends State { setState(() {}); }, title: FFLocalizations.of(context).getVariableText( - enText: 'Delivery Schedule', + enText: 'Schedule Deliveries', ptText: 'Agendar Entregas', ), ), MenuCardItem( - icon: Icons.share_location_outlined, + icon: Icons.attach_email_outlined, action: () async { await _model.fastPassAction(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( - enText: 'Fast Visit', - ptText: 'Agenda Rápida', + ptText: 'Convidar Visitantes', + enText: 'Invite Visitors', ), ), MenuCardItem( @@ -439,19 +427,19 @@ class _MenuComponentWidgetState extends State { setState(() {}); }, title: FFLocalizations.of(context).getVariableText( - ptText: 'Reserva de Itens', - enText: 'Item Reservation', + ptText: 'Reservas', + enText: 'Reservations', ), ), MenuCardItem( - icon: FFIcons.khome, + icon: Icons.person_add_alt_1_outlined, action: () async { await _model.registerVisitorOptAction(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( enText: 'Register Visitor', - ptText: 'Cadastro de Visitante', + ptText: 'Cadastrar Visitante', ), ), MenuCardItem( @@ -466,29 +454,7 @@ class _MenuComponentWidgetState extends State { ), ), MenuCardItem( - icon: Icons.groups, - action: () async { - await _model.peopleOnThePropertyAction(context); - setState(() {}); - }, - title: FFLocalizations.of(context).getVariableText( - enText: 'People on the Property', - ptText: 'Pessoas na Propriedade', - ), - ), - MenuCardItem( - icon: Icons.group_add_outlined, - action: () async { - await _model.liberationHistoryAction(context); - setState(() {}); - }, - title: FFLocalizations.of(context).getVariableText( - enText: 'Liberations History', - ptText: 'Consultar Liberações', - ), - ), - MenuCardItem( - icon: Icons.key_outlined, + icon: Icons.transfer_within_a_station_outlined, action: () async { await _model.accessHistoryAction(context); setState(() {}); @@ -499,14 +465,14 @@ class _MenuComponentWidgetState extends State { ), ), MenuCardItem( - icon: Icons.people_outline_sharp, + icon: Icons.how_to_reg_outlined, action: () async { - await _model.visitHistoryAction(context); + await _model.liberationHistoryAction(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( - enText: 'Visit History', - ptText: 'Consultar Visitas', + enText: 'Liberations History', + ptText: 'Consultar Liberações', ), ), MenuCardItem( @@ -520,6 +486,17 @@ class _MenuComponentWidgetState extends State { ptText: 'Consultar Mensagens', ), ), + MenuCardItem( + icon: Icons.groups, + action: () async { + await _model.peopleOnThePropertyAction(context); + setState(() {}); + }, + title: FFLocalizations.of(context).getVariableText( + enText: 'People on the Property', + ptText: 'Pessoas na Propriedade', + ), + ), MenuCardItem( icon: Icons.settings, action: () async { @@ -546,57 +523,17 @@ class _MenuComponentWidgetState extends State { ]; }(); - return Padding( - padding: const EdgeInsetsDirectional.only( - top: 10, - ), - child: Builder( - builder: (context) { - if (widget.style == MenuView.list_grid && - widget.expandable == true && - widget.item == MenuItem.button) { - if (_model.isGrid == true) { - return wrapWithModel( - model: _model.menuStaggeredViewComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: MenuStaggeredViewComponentWidget( - options: options, - expandable: widget.expandable, - item: widget.item, - changeMenuStyle: () async { - await _model.changeMenuStyle(context); - setState(() {}); - }, - isGrid: _model.isGrid, - ), - ); - } else { - return wrapWithModel( - model: _model.menuStaggeredViewComponentModel, - updateCallback: () => setState(() {}), - updateOnChange: true, - child: MenuStaggeredViewComponentWidget( - options: options, - expandable: widget.expandable, - item: widget.item, - changeMenuStyle: () async { - await _model.changeMenuStyle(context); - setState(() {}); - }, - isGrid: _model.isGrid, - ), - ); - } - } - if (widget.style == MenuView.list && - widget.expandable == false && - widget.item == MenuItem.tile) { + return Builder( + builder: (context) { + if (widget.style == MenuView.list_grid && + widget.expandable == true && + widget.item == MenuItem.button) { + if (_model.isGrid == true) { return wrapWithModel( - model: _model.menuListViewComponentModel, + model: _model.menuStaggeredViewComponentModel, updateCallback: () => setState(() {}), updateOnChange: true, - child: MenuListViewComponentWidget( + child: MenuStaggeredViewComponentWidget( options: options, expandable: widget.expandable, item: widget.item, @@ -604,12 +541,47 @@ class _MenuComponentWidgetState extends State { await _model.changeMenuStyle(context); setState(() {}); }, + isGrid: _model.isGrid, + ), + ); + } else { + return wrapWithModel( + model: _model.menuStaggeredViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuStaggeredViewComponentWidget( + options: options, + expandable: widget.expandable, + item: widget.item, + changeMenuStyle: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + isGrid: _model.isGrid, ), ); } - return const SizedBox(); - }, - ), + } + if (widget.style == MenuView.list && + widget.expandable == false && + widget.item == MenuItem.tile) { + return wrapWithModel( + model: _model.menuListViewComponentModel, + updateCallback: () => setState(() {}), + updateOnChange: true, + child: MenuListViewComponentWidget( + options: options, + expandable: widget.expandable, + item: widget.item, + changeMenuStyle: () async { + await _model.changeMenuStyle(context); + setState(() {}); + }, + ), + ); + } + return const SizedBox(); + }, ); } 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 e7cd801a..c16e3669 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 @@ -107,9 +107,9 @@ class _MenuListViewComponentWidgetState } Widget buildMenuList(BuildContext context) { - return SizedBox( - width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.height, + return Expanded( + // width: MediaQuery.of(context).size.width, + // height: MediaQuery.of(context).size.height, child: ListView.separated( padding: const EdgeInsets.symmetric(horizontal: 15), shrinkWrap: true, 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 b47a20a4..ef9d3f46 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 @@ -87,7 +87,9 @@ class _MenuStaggeredViewComponentWidgetState ); }, ), - ], + ] + .addToStart(const SizedBox(height: 30)) + .addToEnd(const SizedBox(height: 30)), ); } diff --git a/lib/components/templates_components/details_component/details_component_action.dart b/lib/components/templates_components/details_component/details_component_action.dart index d197282a..ace71315 100644 --- a/lib/components/templates_components/details_component/details_component_action.dart +++ b/lib/components/templates_components/details_component/details_component_action.dart @@ -27,8 +27,8 @@ Widget buildDetails( showAlertDialog( context, FFLocalizations.of(context).getVariableText( - ptText: 'Bloquear Visita', - enText: 'Block Visit', + ptText: 'Cancelar Visita', + enText: 'Cancel Visit', ), FFLocalizations.of(context).getVariableText( ptText: 'Você tem certeza que deseja bloquear essa visita?', diff --git a/lib/components/templates_components/provisional_schedule_template/provisional_schedule_template_model.dart b/lib/components/templates_components/provisional_schedule_template/provisional_schedule_template_model.dart index b79236d8..75c7590b 100644 --- a/lib/components/templates_components/provisional_schedule_template/provisional_schedule_template_model.dart +++ b/lib/components/templates_components/provisional_schedule_template/provisional_schedule_template_model.dart @@ -1,8 +1,7 @@ import 'package:flutter/material.dart'; import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart'; -import 'package:hub/flutter_flow/flutter_flow_model.dart'; -import 'package:hub/flutter_flow/internationalization.dart'; +import 'package:hub/flutter_flow/flutter_flow_util.dart'; class ScheduleProvisionalVisitPageModel extends FlutterFlowModel { @@ -62,6 +61,26 @@ class ScheduleProvisionalVisitPageModel ); } + DateTime selectedDateTime; + DateTime currentDateTime = DateTime.now(); + selectedDateTime = DateFormat('dd/MM/yyyy HH:mm:ss').parse(val); + + try { + selectedDateTime = DateFormat('dd/MM/yyyy HH:mm:ss').parse(val); + } catch (e) { + return FFLocalizations.of(context).getVariableText( + ptText: 'Formato de data/hora inválido', + enText: 'Invalid date/time format', + ); + } + + if (selectedDateTime.isBefore(currentDateTime)) { + return FFLocalizations.of(context).getVariableText( + ptText: 'A data/hora selecionada é inválida', + enText: 'The selected date/time is invalid', + ); + } + return null; } diff --git a/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart b/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart index 0836e3cf..64823c0a 100644 --- a/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart +++ b/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart @@ -942,8 +942,9 @@ class _ScheduleProvisionalVisitPageWidgetState "Agendamento Provisório Realizado com Sucesso!", enText: "Provisional Scheduling Successfully Completed")); - setState(() { + safeSetState(() { _model.dateTimeTextController?.clear(); + _model.personNameTextController ?.clear(); _model.notesTextController?.clear(); 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 35178029..ed171aef 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,25 +1,22 @@ import 'dart:async'; -import 'dart:developer'; -import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import 'package:hub/custom_code/actions/convert_image_file_to_base64.dart'; -import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:flutter/material.dart'; import 'package:hub/shared/utils/validator_util.dart'; import '/backend/api_requests/api_calls.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/form_field_controller.dart'; -import 'package:flutter/material.dart'; - import 'regisiter_vistor_template_component_widget.dart'; -class RegisiterVistorTemplateComponentModel extends FlutterFlowModel { +class RegisiterVistorTemplateComponentModel + extends FlutterFlowModel { /// State fields for stateful widgets in this page. Timer? _debounceTimer; final unfocusNode = FocusNode(); bool isDataUploading = false; - FFUploadedFile uploadedLocalFile = FFUploadedFile(bytes: Uint8List.fromList([])); + FFUploadedFile uploadedLocalFile = + FFUploadedFile(bytes: Uint8List.fromList([])); void debounce(Function() fn, Duration time) { if (_debounceTimer != null) { @@ -28,6 +25,8 @@ class RegisiterVistorTemplateComponentModel extends FlutterFlowModel visitorAlreadyRegistered = BehaviorSubject(); + final _formKey = GlobalKey(); + + void _resetForm() { + _formKey.currentState?.reset(); + } + @override void initState() { super.initState(); visitorAlreadyRegistered = BehaviorSubject.seeded(false); - _model = createModel(context, () => RegisiterVistorTemplateComponentModel()); + _model = + createModel(context, () => RegisiterVistorTemplateComponentModel()); _model.textController1 ??= TextEditingController(); _model.textFieldFocusNode1 ??= FocusNode(); @@ -87,15 +90,19 @@ class _RegisiterVistorTemplateComponentWidgetState return false; } - if (_model.textController1.text.isEmpty || _model.textController1.text == '') { + if (_model.textController1.text.isEmpty || + _model.textController1.text == '') { return false; } - if (_model.dropDownValue == null || _model.dropDownValue!.isEmpty || _model.dropDownValue == '') { + if (_model.dropDownValue == null || + _model.dropDownValue!.isEmpty || + _model.dropDownValue == '') { return false; } - if (_model.textController2.text.isEmpty || _model.textController2.text == '') { + if (_model.textController2.text.isEmpty || + _model.textController2.text == '') { return false; } @@ -103,7 +110,9 @@ class _RegisiterVistorTemplateComponentWidgetState return false; } - if (_model.textController4.text.isNotEmpty && _model.textController4.text != '' && ValidatorUtil.isValidEmail(_model.textController4.text) == false) { + if (_model.textController4.text.isNotEmpty && + _model.textController4.text != '' && + ValidatorUtil.isValidEmail(_model.textController4.text) == false) { return false; } @@ -129,6 +138,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), child: SingleChildScrollView( child: Form( + key: _formKey, autovalidateMode: AutovalidateMode.onUserInteraction, child: Column( mainAxisSize: MainAxisSize.min, @@ -137,7 +147,8 @@ class _RegisiterVistorTemplateComponentWidgetState Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(20.0, 0.0, 0.0, 15.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 0.0, 15.0), child: Text( FFLocalizations.of(context).getText( 'zazj5d8b' /* Preencha o formulário com os d... */, @@ -167,6 +178,7 @@ class _RegisiterVistorTemplateComponentWidgetState keyboardType: TextInputType.number, textInputAction: TextInputAction.next, obscureText: false, + maxLength: 20, decoration: InputDecoration( isDense: true, labelText: FFLocalizations.of(context).getText( @@ -246,6 +258,7 @@ class _RegisiterVistorTemplateComponentWidgetState _model.textController2Validator.asValidator(context), inputFormatters: [ FilteringTextInputFormatter.allow(RegExp('[0-9]')), + LengthLimitingTextInputFormatter(20) ], ), _model.textController2.text.isEmpty @@ -295,13 +308,11 @@ class _RegisiterVistorTemplateComponentWidgetState controller: _model.textController1, autovalidateMode: AutovalidateMode.onUserInteraction, focusNode: _model.textFieldFocusNode1, - onChanged: (_) => - EasyDebounce.debounce( - '_model.textFieldFocusNode1', - const Duration( - milliseconds: 500), - () => setState(() {}), - ), + onChanged: (_) => EasyDebounce.debounce( + '_model.textFieldFocusNode1', + const Duration(milliseconds: 500), + () => setState(() {}), + ), autofocus: true, textInputAction: TextInputAction.next, obscureText: false, @@ -372,8 +383,11 @@ class _RegisiterVistorTemplateComponentWidgetState FlutterFlowTheme.of(context).bodyMediumFamily), ), maxLines: null, + maxLength: 80, keyboardType: TextInputType.name, - validator: _model.textController1Validator.asValidator(context), + inputFormatters: [LengthLimitingTextInputFormatter(80)], + validator: + _model.textController1Validator.asValidator(context), ), ), Padding( @@ -460,10 +474,12 @@ class _RegisiterVistorTemplateComponentWidgetState ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), child: Builder( builder: (context) { - if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? false)) { + if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? + false)) { return InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, @@ -495,7 +511,7 @@ class _RegisiterVistorTemplateComponentWidgetState child: FFButtonWidget( onPressed: () async { final selectedMedia = - await selectMediaWithSourceBottomSheet( + await selectMediaWithSourceBottomSheet( context: context, // maxWidth: 300.00, // maxHeight: 300.00, @@ -508,9 +524,10 @@ class _RegisiterVistorTemplateComponentWidgetState // selectedMedia.every((m) => // validateFileFormat( // m.storagePath, context))) { - setState(() => _model.isDataUploading = true); + setState( + () => _model.isDataUploading = true); var selectedUploadedFiles = - []; + []; try { showUploadMessage( @@ -520,13 +537,14 @@ class _RegisiterVistorTemplateComponentWidgetState ); selectedUploadedFiles = selectedMedia .map((m) => FFUploadedFile( - name: - m.storagePath.split('/').last, - bytes: m.bytes, - height: m.dimensions?.height, - width: m.dimensions?.width, - // blurHash: m.blurHash, - )) + name: m.storagePath + .split('/') + .last, + bytes: m.bytes, + height: m.dimensions?.height, + width: m.dimensions?.width, + // blurHash: m.blurHash, + )) .toList(); } finally { ScaffoldMessenger.of(context) @@ -557,26 +575,27 @@ class _RegisiterVistorTemplateComponentWidgetState options: FFButtonOptions( width: double.infinity, height: 120.0, - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 20.0), + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 20.0), iconPadding: - const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), + const EdgeInsetsDirectional.fromSTEB( + 14.0, 0.0, 0.0, 20.0), color: FlutterFlowTheme.of(context) .primaryBackground, textStyle: FlutterFlowTheme.of(context) .titleSmall .override( - fontFamily: FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), + fontFamily: FlutterFlowTheme.of(context) + .titleSmallFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), + ), borderSide: BorderSide( color: FlutterFlowTheme.of(context).accent1, width: 0.2, @@ -597,16 +616,16 @@ class _RegisiterVistorTemplateComponentWidgetState style: FlutterFlowTheme.of(context) .bodyMedium .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), ), ), ), @@ -645,12 +664,16 @@ class _RegisiterVistorTemplateComponentWidgetState autovalidateMode: AutovalidateMode.onUserInteraction, autofocus: false, textInputAction: TextInputAction.next, + + maxLength: 25, keyboardType: TextInputType.phone, inputFormatters: [ FilteringTextInputFormatter.allow( RegExp('[0-9, +, -, (, )]')), + LengthLimitingTextInputFormatter(25) ], obscureText: false, + decoration: InputDecoration( isDense: true, labelText: FFLocalizations.of(context).getText( @@ -729,15 +752,14 @@ class _RegisiterVistorTemplateComponentWidgetState focusNode: _model.textFieldFocusNode4, autovalidateMode: AutovalidateMode.onUserInteraction, autofocus: true, - onChanged: (_) => - EasyDebounce.debounce( - '_model.textFieldFocusNode4', - const Duration( - milliseconds: 500), - () => setState(() {}), - ), + onChanged: (_) => EasyDebounce.debounce( + '_model.textFieldFocusNode4', + const Duration(milliseconds: 500), + () => setState(() {}), + ), textInputAction: TextInputAction.done, obscureText: false, + maxLength: 80, decoration: InputDecoration( isDense: true, labelText: FFLocalizations.of(context).getText( @@ -805,11 +827,14 @@ class _RegisiterVistorTemplateComponentWidgetState FlutterFlowTheme.of(context).bodyMediumFamily), ), keyboardType: TextInputType.emailAddress, - validator: _model.textController4Validator.asValidator(context), + inputFormatters: [LengthLimitingTextInputFormatter(80)], + validator: + _model.textController4Validator.asValidator(context), ), ), Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 65.0, 0.0, 0.0), child: FFButtonWidget( onPressed: _isFormValid(context) ? () async { @@ -835,29 +860,7 @@ class _RegisiterVistorTemplateComponentWidgetState foto: 'base64;jpeg,${_model.imgBase64}', ) .onError((e, s) async { - return await showAdaptiveDialog( - context: context, - builder: (context) { - return GestureDetector( - onTap: () => Navigator.pop(context), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: Dialog( - backgroundColor: Colors.transparent, - child: ThrowExceptionWidget( - msg: FFLocalizations.of(context) - .getVariableText( - ptText: - 'Você esqueceu de adicionar algum dado obrigatório. Verifique se a imagem, nome, tipo e documento foram preenchidos corretamente.', - enText: - 'You forgot to add some required data. Check if the image, name, type and document were filled in correctly.', - ), - ), - ), - ), - ); - }, - ); + return await DialogUtil.errorDefault(context); }); if (PhpGroup.postScheduleVisitorCall.error( (_model.scheduleVisitor?.jsonBody ?? ''), @@ -895,6 +898,7 @@ class _RegisiterVistorTemplateComponentWidgetState ), ), ); + _formKey.currentState?.reset(); if (widget.source == 'VisitorNotFoundComponent') { Navigator.pop(context, true); diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index 4b7fbfe3..d8ffe95f 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -187,8 +187,8 @@ final kTranslationsMap = >>[ 'en': 'Service provider', }, 'pmezihb4': { - 'pt': 'Selecione...', - 'en': 'Please select...', + 'pt': 'Selecione o tipo de pessoa...', + 'en': 'Please select the type of person...', }, 'yza6i4t7': { 'pt': 'Search for an item...', @@ -286,12 +286,12 @@ final kTranslationsMap = >>[ 'en': 'Single visit', }, 'eftcs67c': { - 'pt': 'Você tem alguma observação sobre está visita?', + 'pt': 'Você tem alguma observação sobre esta visita?', 'en': 'Do you have any observations about this visit?', }, 't0q2vuup': { 'pt': 'Observações da Visita', - 'en': 'Visit Observations', + 'en': 'Visit Notes', }, 'w18iztdm': { 'pt': 'Escreva as suas observações aqui', @@ -350,7 +350,7 @@ final kTranslationsMap = >>[ }, 'cw8b3tbb': { 'pt': 'Observação da Visita', - 'en': 'Notes Visit', + 'en': 'Visit Notes', }, 'k4qkbv1f': { 'pt': '', @@ -482,7 +482,7 @@ final kTranslationsMap = >>[ 'en': 'Release QR Code', }, '6z6kvmhl': { - 'pt': 'Certifique-se de que o QRCode está visivel para o leitor', + 'pt': 'Certifique-se de que o QRCode está visível para o leitor', 'en': '', }, 'wkjkxd2e': { @@ -1181,7 +1181,7 @@ final kTranslationsMap = >>[ }, 'ujodm2ci': { 'pt': - 'Para gerar o QR Code digite a senha cadastrado no aplicativo e clique em enviar.', + 'Para gerar o QR Code digite a senha cadastrada no aplicativo e clique em enviar.', 'en': 'To generate the QR Code, enter the password registered in the application and click send.', }, 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 d4a7f003..03b6767e 100644 --- a/lib/pages/acess_history_page/acess_history_page_widget.dart +++ b/lib/pages/acess_history_page/acess_history_page_widget.dart @@ -23,7 +23,8 @@ class AcessHistoryPageWidget extends StatefulWidget { }; AcessHistoryPageWidget({super.key, required this.opt}); @override - State createState() => _AcessHistoryPageWidgetState(opt); + State createState() => + _AcessHistoryPageWidgetState(opt); } class _AcessHistoryPageWidgetState extends State { @@ -43,7 +44,8 @@ class _AcessHistoryPageWidgetState extends State { late Future _accessFuture; List _accessWrap = []; - _AcessHistoryPageWidgetState(Map opt) : selectedTypeSubject = BehaviorSubject.seeded(opt) { + _AcessHistoryPageWidgetState(Map opt) + : selectedTypeSubject = BehaviorSubject.seeded(opt) { selectedTypeSubject.listen((value) {}); } @@ -333,9 +335,18 @@ class _AcessHistoryPageWidgetState extends State { imagePath: 'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${accessHistoryItem['PES_ID'] ?? ''}&tipo=${accessHistoryItem['PES_TIPO'] ?? ''}', labelsHashMap: Map.from({ - 'Nome:': accessHistoryItem['PES_NOME'] ?? '', - 'Acesso:': accessHistoryItem['ACE_DATAHORA'] ?? '', - 'Setor:': accessHistoryItem['SET_DESCRICAO'] ?? '', + FFLocalizations.of(context).getVariableText( + ptText: 'Nome:', + enText: 'Name:', + ): accessHistoryItem['PES_NOME'] ?? '', + FFLocalizations.of(context).getVariableText( + ptText: 'Acesso:', + enText: 'Access:', + ): accessHistoryItem['ACE_DATAHORA'] ?? '', + FFLocalizations.of(context).getVariableText( + ptText: 'Setor', + enText: 'Sector', + ): accessHistoryItem['SET_DESCRICAO'] ?? '', }), statusHashMap: [ accessHistoryItem['PES_TIPO'] == 'O' diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index dd5094ff..91ec6881 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -225,15 +225,18 @@ class _HomePageWidgetState extends State { } Widget createBody() { - return Container( - color: FlutterFlowTheme.of(context).primaryBackground, - child: wrapWithModel( - model: _model.menuComponentModel, - updateCallback: () => setState(() {}), - child: const MenuComponentWidget( - expandable: true, - style: MenuView.list_grid, - item: MenuItem.button, + return SingleChildScrollView( + physics: const AlwaysScrollableScrollPhysics(), + child: Container( + color: FlutterFlowTheme.of(context).primaryBackground, + child: wrapWithModel( + model: _model.menuComponentModel, + updateCallback: () => setState(() {}), + child: const MenuComponentWidget( + expandable: true, + style: MenuView.list_grid, + item: MenuItem.button, + ), ), ), ); diff --git a/lib/pages/preferences_settings_page/preferences_settings_model.dart b/lib/pages/preferences_settings_page/preferences_settings_model.dart index 6cab1d32..68c8fa21 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_model.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_model.dart @@ -43,22 +43,24 @@ class PreferencesPageModel with ChangeNotifier { ); }, ).then((value) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Fingerprint changed successfully', - ptText: 'Impressão digital alterada com sucesso', - ), - style: TextStyle(color: FlutterFlowTheme.of(context).info)), - backgroundColor: FlutterFlowTheme.of(context).success, - duration: const Duration(seconds: 3), - behavior: SnackBarBehavior.floating, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), + if (value) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Fingerprint changed successfully', + ptText: 'Impressão digital alterada com sucesso', + ), + style: TextStyle(color: FlutterFlowTheme.of(context).info)), + backgroundColor: FlutterFlowTheme.of(context).success, + duration: const Duration(seconds: 3), + behavior: SnackBarBehavior.floating, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), ), - ), - ); + ); + } }).catchError((err, stack) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( 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 7da52036..c56f7d27 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 @@ -1747,7 +1747,7 @@ Widget scheduleVisit(BuildContext context, FFLocalizations.of(context).getVariableText( ptText: 'Inativo', enText: 'Inactive', - ): FlutterFlowTheme.of(context).warning, + ): FlutterFlowTheme.of(context).success, }), ], onTapCardItemAction: () async {}, diff --git a/lib/shared/widgets/drawer_widget/drawer_widget.dart b/lib/shared/widgets/drawer_widget/drawer_widget.dart index 3a0127c3..eff34735 100644 --- a/lib/shared/widgets/drawer_widget/drawer_widget.dart +++ b/lib/shared/widgets/drawer_widget/drawer_widget.dart @@ -72,8 +72,9 @@ class CustomDrawer extends StatelessWidget { ), ), ), - SizedBox(width: 10), + const SizedBox(width: 10), Expanded( + flex: 1, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -161,16 +162,14 @@ class CustomDrawer extends StatelessWidget { ); } - Expanded _buildDrawerBody() { - return Expanded( - child: wrapWithModel( - model: model.menuComponentModel, - updateCallback: () {}, - child: const MenuComponentWidget( - expandable: false, - style: MenuView.list, - item: MenuItem.tile, - ), + Widget _buildDrawerBody() { + return wrapWithModel( + model: model.menuComponentModel, + updateCallback: () {}, + child: const MenuComponentWidget( + expandable: false, + style: MenuView.list, + item: MenuItem.tile, ), ); }