From 6702017e07307e7dfad61b3b78dc842916346066 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Wed, 28 Aug 2024 11:31:44 -0300 Subject: [PATCH 1/2] WIP --- lib/actions/actions.dart | 19 +- ..._arrow_linked_locals_component_widget.dart | 164 +++++----- .../menu_component/menu_component_widget.dart | 57 ++-- .../details_component_action.dart | 37 ++- .../sign_in_template_component_widget.dart | 8 +- .../sign_up_template_component_widget.dart | 8 +- lib/flutter_flow/internationalization.dart | 10 +- .../liberation_history_widget.dart | 59 +--- .../message_history_page_widget.dart | 2 +- .../package_order_page.dart | 216 +++++++------ .../preferences_settings_widget.dart | 4 +- .../provisional_schedule_widget.dart | 2 +- .../reception_page/reception_page_widget.dart | 6 +- .../schedule_complete_visit_page_widget.dart | 296 +++++++++--------- .../widgets/drawer_widget/drawer_widget.dart | 1 - pubspec.lock | 32 +- pubspec.yaml | 29 +- 17 files changed, 488 insertions(+), 462 deletions(-) diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index e4305dd3..1547db1d 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -11,6 +11,7 @@ import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/flutter_flow/random_data_util.dart'; import 'package:hub/shared/utils/dialog_util.dart'; import 'package:qr_flutter/qr_flutter.dart'; +import 'package:share_plus/share_plus.dart'; import 'package:url_launcher/url_launcher.dart'; import '../shared/utils/log_util.dart'; @@ -153,7 +154,6 @@ Future singInLoginAction( AppState().haveLocal = await checkLocals(context: context, model: model); - log('haveLocal in login: ${AppState().haveLocal}'); toggleApp(context, AppState().haveLocal!); } else { if (PhpGroup.loginCall.msg((loginCall?.jsonBody ?? '')) == null) { @@ -299,7 +299,6 @@ Future toggleSignUpPage(BuildContext context) async { } Future toggleApp(BuildContext context, bool haveLocal) async { - log('haveLocal in toggleApp: $haveLocal'); if (haveLocal == true) context.goNamed( 'homePage', @@ -384,7 +383,6 @@ Future checkLocals({ devUUID: AppState().devUUID, userUUID: AppState().userUUID, ); - log(response.jsonBody.toString()); // Verificação rápida de erro para evitar processamento desnecessário. if (response.jsonBody['error']) { @@ -400,6 +398,21 @@ Future checkLocals({ } } +Future showShare(payload) async { + for (var i = 0; i < payload['convites'].length; i++) { + log('ADD'); + await Share.share(''' +Olá, \*${payload['convites'][i]['VTE_NOME']}\*! Você foi convidado para \*${AppState().local}\*. + +\*Validade do Convite\*: +- Início: ${payload['convites'][i]['VAW_DTINICIO']} +- Fim: ${payload['convites'][i]['VAW_DTFIM']} + +URL do Convite: https://visita.freaccess.com.br/${payload['convites'][i]['VAW_ID']}/${AppState().cliUUID}/${payload['convites'][i]['VAW_CHAVE']} + '''); + } +} + Future answersRequest(BuildContext context, String? ref, String? task, String? response, String? id) async { ApiCallResponse? respondeSolicitacaoCall; 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 58db3341..66e9ebc3 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,9 +1,4 @@ -import 'dart:developer'; - -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_spinkit/flutter_spinkit.dart'; -import 'package:google_fonts/google_fonts.dart'; import 'package:hub/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_model.dart'; import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; @@ -12,27 +7,26 @@ import 'package:hub/shared/utils/log_util.dart'; import 'package:provider/provider.dart'; import '/backend/api_requests/api_calls.dart'; -import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; class BottomArrowLinkedLocalsComponentWidget extends StatefulWidget { const BottomArrowLinkedLocalsComponentWidget({super.key}); @override - State createState() => _BottomArrowLinkedLocalsComponentWidgetState(); + State createState() => + _BottomArrowLinkedLocalsComponentWidgetState(); } -class _BottomArrowLinkedLocalsComponentWidgetState extends State { +class _BottomArrowLinkedLocalsComponentWidgetState + extends State { late BottomArrowLinkedLocalsComponentModel _model; - bool _loading = false; bool _hasData = false; late Future _localsFuture; List _localsWrap = []; - @override void setState(VoidCallback callback) { super.setState(callback); @@ -42,7 +36,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State BottomArrowLinkedLocalsComponentModel()); + _model = + createModel(context, () => BottomArrowLinkedLocalsComponentModel()); _localsFuture = _fetchLocals(); } @@ -69,7 +64,7 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State _fetchLocals() async { try { setState(() => _loading = true); - var response = await PhpGroup.getLocalsCall.call( + var response = await PhpGroup.getLocalsCall.call( devUUID: AppState().devUUID, userUUID: AppState().userUUID, ); @@ -100,31 +95,36 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State _fetchResponseLink(String status, String cliID) async { try { var response = await PhpGroup.resopndeVinculo.call( - devUUID: AppState().devUUID, - userUUID: AppState().userUUID, - cliID: cliID, - tarefa: status - ); + devUUID: AppState().devUUID, + userUUID: AppState().userUUID, + cliID: cliID, + tarefa: status); if (response.jsonBody['error'] == false) { - return {'error': false, 'error_msg': FFLocalizations.of(context).getVariableText(ptText: "Vinculo Ativado com Sucesso", enText: "Link Activated Successfully") }; + return { + 'error': false, + 'error_msg': FFLocalizations.of(context).getVariableText( + ptText: "Vinculo Ativado com Sucesso", + enText: "Link Activated Successfully") + }; } else { return response.jsonBody; } - } catch (e, s) { DialogUtil.errorDefault(context); - LogUtil.requestAPIFailed('responderVinculo.php', '', 'Responder Vinculo', e, s); - return {'error': true, 'error_msg': FFLocalizations.of(context).getVariableText( - ptText: "Falha ao efetuar operação, Tente Novamente mais tarde.", - enText: "Failed to perform operation, please try again later." - )}; + LogUtil.requestAPIFailed( + 'responderVinculo.php', '', 'Responder Vinculo', e, s); + return { + 'error': true, + 'error_msg': FFLocalizations.of(context).getVariableText( + ptText: "Falha ao efetuar operação, Tente Novamente mais tarde.", + enText: "Failed to perform operation, please try again later.") + }; } } @@ -135,18 +135,25 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State _labelsHashMap(dynamic local) { return Map.from({ '${local['CLI_PREFIXO']}:': local['CLI_NOME'], - '${FFLocalizations.of(context).getVariableText(ptText: 'Propriedade', enText: 'Property')}:': local['CLU_OWNER_DSC'] + '${FFLocalizations.of(context).getVariableText(ptText: 'Propriedade', enText: 'Property')}:': + local['CLU_OWNER_DSC'] }); } Map _statusHashMap(dynamic local) { return Map.from({ if (local['CLU_STATUS'] == 'A') - FFLocalizations.of(context).getVariableText(ptText: 'Ativo', enText: 'Active'): FlutterFlowTheme.of(context).success + FFLocalizations.of(context).getVariableText( + ptText: 'Ativo', + enText: 'Active'): FlutterFlowTheme.of(context).success else if (local['CLU_STATUS'] == 'B') - FFLocalizations.of(context).getVariableText(ptText: 'Bloqueado', enText: 'Blocked'): FlutterFlowTheme.of(context).error + FFLocalizations.of(context).getVariableText( + ptText: 'Bloqueado', + enText: 'Blocked'): FlutterFlowTheme.of(context).error else - FFLocalizations.of(context).getVariableText(ptText: 'Pendente', enText: 'Pending'): FlutterFlowTheme.of(context).warning + FFLocalizations.of(context).getVariableText( + ptText: 'Pendente', + enText: 'Pending'): FlutterFlowTheme.of(context).warning }); } @@ -156,7 +163,6 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State( - future: _localsFuture, - builder: (context, snapshot) { - return ListView.builder( - shrinkWrap: true, - physics: const BouncingScrollPhysics(), - itemCount: _localsWrap.length, - itemBuilder: (BuildContext context, int index) { - final item = _localsWrap[index]; - return _item(context, item); - }, - ); - }, - ) - ); + width: double.infinity, + height: double.infinity, + decoration: const BoxDecoration(), + padding: const EdgeInsets.only(top: 15), + child: FutureBuilder( + future: _localsFuture, + builder: (context, snapshot) { + return ListView.builder( + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + itemCount: _localsWrap.length, + itemBuilder: (BuildContext context, int index) { + final item = _localsWrap[index]; + return _item(context, item); + }, + ); + }, + )); } @override @@ -234,12 +241,9 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State { ]; else return [ - MenuButtonWidget( - icon: Icons.engineering_outlined, - action: () async { - await _model.provisionalSchedule(context); - setState(() {}); - }, - title: FFLocalizations.of(context).getVariableText( - enText: 'Provisional\nSchedule', - ptText: 'Agendar\nPrestadores', - ), - ), - MenuButtonWidget( - icon: Icons.sports_motorsports_outlined, - action: () async { - await _model.deliverySchedule(context); - setState(() {}); - }, - title: FFLocalizations.of(context).getVariableText( - enText: 'Delivery\nSchedule', - ptText: 'Agendar\nEntregas', - ), - ), MenuButtonWidget( icon: Icons.share_location_outlined, action: () async { @@ -181,6 +160,17 @@ 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 { @@ -193,14 +183,25 @@ class _MenuComponentWidgetState extends State { ), ), MenuButtonWidget( - icon: FFIcons.khome, + icon: Icons.sports_motorsports_outlined, + action: () async { + await _model.deliverySchedule(context); + setState(() {}); + }, + title: FFLocalizations.of(context).getVariableText( + enText: 'Register\nDeliveries', + ptText: 'Cadastrar\nEntregas', + ), + ), + MenuButtonWidget( + icon: Icons.person_add_alt_1_outlined, action: () async { await _model.registerVisitorOptAction(context); setState(() {}); }, title: FFLocalizations.of(context).getVariableText( enText: 'Register\nVisitor', - ptText: 'Cadastro\nde Visitante', + ptText: 'Cadastrar\nVisitante', ), ), MenuButtonWidget( @@ -237,7 +238,7 @@ class _MenuComponentWidgetState extends State { ), ), MenuButtonWidget( - icon: Icons.key_outlined, + icon: Icons.transfer_within_a_station_outlined, action: () async { await _model.accessHistoryAction(context); setState(() {}); @@ -248,7 +249,7 @@ class _MenuComponentWidgetState extends State { ), ), MenuButtonWidget( - icon: Icons.people_outline_sharp, + icon: Symbols.location_away, action: () async { await _model.visitHistoryAction(context); setState(() {}); @@ -276,7 +277,7 @@ class _MenuComponentWidgetState extends State { setState(() {}); }, title: FFLocalizations.of(context).getVariableText( - enText: 'Preferences\nSettings', + enText: 'System\n Settings', ptText: 'Opções\ndo Sistema', ), ), @@ -526,7 +527,7 @@ class _MenuComponentWidgetState extends State { setState(() {}); }, title: FFLocalizations.of(context).getVariableText( - enText: 'Preferences Settings', + enText: 'System Settings', ptText: 'Opções do Sistema', ), ), 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 8fb007f2..d197282a 100644 --- a/lib/components/templates_components/details_component/details_component_action.dart +++ b/lib/components/templates_components/details_component/details_component_action.dart @@ -1,24 +1,22 @@ -import 'dart:developer'; - import 'package:flutter/material.dart'; import 'package:hub/actions/actions.dart'; -import 'package:hub/app_state.dart'; import 'package:hub/components/templates_components/details_component/details_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/internationalization.dart'; -import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; import 'package:hub/shared/utils/validator_util.dart'; -import 'package:rxdart/rxdart.dart'; import 'package:share_plus/share_plus.dart'; -Widget buildDetails(dynamic visitaWrapItem, BuildContext context, Future Function(BuildContext, int, int, String, String)? changeStatusAction) { +Widget buildDetails( + dynamic visitaWrapItem, + BuildContext context, + Future Function(BuildContext, int, int, String, String)? + changeStatusAction) { return DetailsComponentWidget( buttons: [ - if (getStatus(visitaWrapItem['VAW_STATUS']) == status.active) // REJECT ACTION + if (getStatus(visitaWrapItem['VAW_STATUS']) == + status.active) // REJECT ACTION FFButtonWidget( text: FFLocalizations.of(context).getVariableText( ptText: 'Cancelar', @@ -141,13 +139,13 @@ Widget buildDetails(dynamic visitaWrapItem, BuildContext context, Future.from({ - '${FFLocalizations.of(context).getVariableText(ptText: "Nome", enText: "Name")}:': visitaWrapItem['VTE_NOME'] ?? '', - '${FFLocalizations.of(context).getVariableText(ptText: "Inicio", enText: "Start")}:': visitaWrapItem['VAW_DTINICIO'] != '' && visitaWrapItem['VAW_DTINICIO'] != null ? ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', visitaWrapItem['VAW_DTINICIO']) : '', - '${FFLocalizations.of(context).getVariableText(ptText: "Fim", enText: "End")}:': visitaWrapItem['VAW_DTFIM'] != '' && visitaWrapItem['VAW_DTFIM'] != null ? ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', visitaWrapItem['VAW_DTFIM']) : '', + '${FFLocalizations.of(context).getVariableText(ptText: "Nome", enText: "Name")}:': + visitaWrapItem['VTE_NOME'] ?? '', + '${FFLocalizations.of(context).getVariableText(ptText: "Inicio", enText: "Start")}:': + visitaWrapItem['VAW_DTINICIO'] != '' && + visitaWrapItem['VAW_DTINICIO'] != null + ? ValidatorUtil.toLocalDateTime( + 'yyyy-MM-dd HH:mm:ss', visitaWrapItem['VAW_DTINICIO']) + : '', + '${FFLocalizations.of(context).getVariableText(ptText: "Fim", enText: "End")}:': + visitaWrapItem['VAW_DTFIM'] != '' && + visitaWrapItem['VAW_DTFIM'] != null + ? ValidatorUtil.toLocalDateTime( + 'yyyy-MM-dd HH:mm:ss', visitaWrapItem['VAW_DTFIM']) + : '', }), imagePath: 'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${visitaWrapItem['VTE_DOCUMENTO'] ?? ''}&tipo=E', diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart index d428e668..5ac6b46f 100644 --- a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart +++ b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart @@ -154,8 +154,12 @@ class _SignInTemplateComponentWidgetState child: Padding( padding: const EdgeInsets.all(3.0), child: Text( - FFLocalizations.of(context).getText( - '9hbdjxrz' /* VAMOS LA! ENTRE COM A SUA CONT... */, + FFLocalizations.of(context) + .getVariableText( + ptText: + 'VAMOS LÁ! ENTRE COM A SUA CONTA', + enText: + 'LET\'S GO! SIGN IN WITH YOUR ACCOUNT', ), textAlign: TextAlign.start, style: FlutterFlowTheme.of(context) diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart index eb3ab3dd..d3b7772c 100644 --- a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart +++ b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart @@ -235,7 +235,7 @@ class _SignUpTemplateComponentWidgetState Form( key: _model.formKey, autovalidateMode: - AutovalidateMode.always, + AutovalidateMode.onUserInteraction, child: Column( mainAxisSize: MainAxisSize.max, children: [ @@ -255,7 +255,7 @@ class _SignUpTemplateComponentWidgetState EasyDebounce.debounce( '_model.nameRegisterFormTextController', const Duration( - milliseconds: 2000), + milliseconds: 500), () => setState(() {}), ), autofocus: false, @@ -397,7 +397,7 @@ class _SignUpTemplateComponentWidgetState EasyDebounce.debounce( '_model.emailRegisterFormTextController', const Duration( - milliseconds: 2000), + milliseconds: 500), () => setState(() {}), ), autofocus: false, @@ -541,7 +541,7 @@ class _SignUpTemplateComponentWidgetState EasyDebounce.debounce( '_model.passwordRegisterFormTextController', const Duration( - milliseconds: 2000), + milliseconds: 500), () => setState(() {}), ), autofocus: false, diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index 534b2d04..4b7fbfe3 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -1,5 +1,5 @@ -import 'package:flutter/material.dart'; import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; import 'package:shared_preferences/shared_preferences.dart'; const _kLocaleStorageKey = '__locale_key__'; @@ -222,8 +222,8 @@ final kTranslationsMap = >>[ // scheduleCompleteVisitPage { '61lcxdgm': { - 'pt': 'Agendar Visita', - 'en': 'Schedule Visit', + 'pt': 'Agenda Completa', + 'en': 'Complete Schedule', }, 'ueth1f4g': { 'pt': 'Cadastrar Visita', @@ -411,7 +411,7 @@ final kTranslationsMap = >>[ // acessHistoryPage { 'ch8qymga': { - 'pt': 'Histórico de Acesso', + 'pt': 'Consultar Acessos', 'en': 'Access History', }, '2odgr6hg': { @@ -442,7 +442,7 @@ final kTranslationsMap = >>[ 'en': 'Reason:', }, '784f83pc': { - 'pt': 'Histórico de Liberação', + 'pt': 'Consultar Liberações', 'en': 'Liberation History', }, '1skj43ye': { diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index e75d5676..c0ba0cda 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -1,3 +1,5 @@ +import 'dart:developer'; + import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/actions/actions.dart'; @@ -229,7 +231,7 @@ class _LiberationHistoryWidgetState extends State { ), icon: const Icon(Icons.done), onPressed: () async { - return answersRequest + answersRequest .call( context, liberationHistoryItem['NOT_ID'].toString(), @@ -237,8 +239,9 @@ class _LiberationHistoryWidgetState extends State { '', liberationHistoryItem['VTE_ID'].toString(), ) - .then((message) { - if (message.isEmpty) { + .then((value) { + log('test: $value'); + if (value) { showSnackbar( context, FFLocalizations.of(context).getVariableText( @@ -246,9 +249,14 @@ class _LiberationHistoryWidgetState extends State { ptText: 'Visita resolvida com sucesso'), false); } else { - showSnackbar(context, message, true); + showSnackbar( + context, + FFLocalizations.of(context).getVariableText( + enText: 'Error resolving visit', + ptText: 'Erro ao resolver visita'), + true); } - + }).whenComplete(() { safeSetState(() { _requestWrap = []; _requestFuture = _fetchRequests(); @@ -311,46 +319,7 @@ class _LiberationHistoryWidgetState extends State { ), ); }, - ).then((_) { - () {}(); - // PushNotificationManager _pushNotificationService = - // PushNotificationManager(); - - // _pushNotificationService.onMessageReceived.listen((received) { - // if (received.data['click_action'] == 'cancel_request') { - // _pushNotificationService.dispose(); - // showSnackbar( - // context, - // FFLocalizations.of(context).getVariableText( - // enText: 'Successfully resolved visit', - // ptText: 'Visita resolvida com sucesso'), - // false); - // context.pushReplacementNamed( - // 'liberationHistory', - // extra: { - // kTransitionInfoKey: const TransitionInfo( - // hasTransition: true, - // transitionType: PageTransitionType.scale, - // alignment: Alignment.bottomCenter, - // ), - // }, - // ); - // } - // }); - // }).whenComplete(() { - // safeSetState(() { - // _requestWrap = []; - // _requestFuture = _fetchRequests(); - // }); - // }).catchError((e, s) { - // DialogUtil.errorDefault(context); - // LogUtil.requestAPIFailed( - // "proccessRequest.php", "", "Consulta de Solitiações", e, s); - // safeSetState(() { - // _hasData = false; - // _loading = false; - // }); - }); + ).then((_) {}); }, ); } 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 84749623..817340ea 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -166,7 +166,7 @@ class _MessageHistoryPageWidgetState extends State title: Text( FFLocalizations.of(context).getVariableText( enText: 'Message History', - ptText: 'Histórico de Mensagens', + ptText: 'Consultar Mensagens', ), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Nunito', diff --git a/lib/pages/package_order_page/package_order_page.dart b/lib/pages/package_order_page/package_order_page.dart index 9d8def5c..83d28dc9 100644 --- a/lib/pages/package_order_page/package_order_page.dart +++ b/lib/pages/package_order_page/package_order_page.dart @@ -1,11 +1,8 @@ import 'dart:async'; -import 'dart:developer'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.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/molecular_components/order_filter_modal/order_filter_modal_widget.dart'; import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; import 'package:hub/components/templates_components/details_component/details_component_widget.dart'; @@ -25,7 +22,6 @@ class PackageOrderPage extends StatefulWidget { } class _PackageOrderPage extends State { - late ScrollController _scrollController; int _pageNumber = 1; final int _pageSize = 10; @@ -54,8 +50,10 @@ class _PackageOrderPage extends State { _orderFuture = _fetchOrders(); - _scrollController = ScrollController()..addListener(() { - if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { + _scrollController = ScrollController() + ..addListener(() { + if (_scrollController.position.atEdge && + _scrollController.position.pixels != 0) { _loadMoreOrders(); } }); @@ -87,15 +85,14 @@ class _PackageOrderPage extends State { setState(() => _loading = true); var response = await PhpGroup.buscaEnconcomendas.call( - devUUID: AppState().devUUID, - userUUID: AppState().userUUID, - cliID: AppState().cliUUID, - atividade: 'getEncomendas', - pageSize: _pageSize.toString(), - page: _pageNumber.toString(), - adresseeType: _adresseeType == '.*' ? 'TOD' : _adresseeType, - status: _status == '.*' ? 'all' : _status - ); + devUUID: AppState().devUUID, + userUUID: AppState().userUUID, + cliID: AppState().cliUUID, + atividade: 'getEncomendas', + pageSize: _pageSize.toString(), + page: _pageNumber.toString(), + adresseeType: _adresseeType == '.*' ? 'TOD' : _adresseeType, + status: _status == '.*' ? 'all' : _status); final List orders = response.jsonBody['value']['list'] ?? []; @@ -159,25 +156,29 @@ class _PackageOrderPage extends State { icon: const Icon(Icons.filter_list), onPressed: () async { final Map? selectedFilter = - await showModalBottomSheet>( - isScrollControlled: true, - backgroundColor: Colors.transparent, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => Navigator.of(context).pop(), - child: Container( - color: Colors.transparent, - child: GestureDetector( - onTap: () {}, - child: OrderFilterModalWidget( - defaultAdresseeType: _selectedTypeSubject.value['adresseeType'] ?? '.*', - defaultStatus: _selectedTypeSubject.value['status'] ?? '.*', + await showModalBottomSheet>( + isScrollControlled: true, + backgroundColor: Colors.transparent, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => Navigator.of(context).pop(), + child: Container( + color: Colors.transparent, + child: GestureDetector( + onTap: () {}, + child: OrderFilterModalWidget( + defaultAdresseeType: _selectedTypeSubject + .value['adresseeType'] ?? + '.*', + defaultStatus: + _selectedTypeSubject.value['status'] ?? + '.*', + ), + ), ), - ), - ), - ); - }); + ); + }); if (selectedFilter != null) { _updateFilterAction(selectedFilter); @@ -224,16 +225,16 @@ class _PackageOrderPage extends State { backgroundColor: FlutterFlowTheme.of(context).primaryBackground, automaticallyImplyLeading: false, title: Text( - FFLocalizations.of(context).getVariableText(enText: 'Orders', ptText: 'Encomendas'), + FFLocalizations.of(context).getVariableText( + enText: 'My Orders', ptText: 'Minhas Encomendas'), 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'), - ) - ), + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + )), leading: _backButton(context, FlutterFlowTheme.of(context)), centerTitle: true, elevation: 0.0, @@ -256,10 +257,10 @@ class _PackageOrderPage extends State { children: [ Center( child: Text( - FFLocalizations.of(context).getVariableText( - ptText: "Nenhuma encomenda encontrada!", - enText: "No orders found!"), - )), + FFLocalizations.of(context).getVariableText( + ptText: "Nenhuma encomenda encontrada!", + enText: "No orders found!"), + )), ], ), ) @@ -295,8 +296,7 @@ class _PackageOrderPage extends State { return _item(context, order); }, ); - } - ); + }); } String _imagePath(dynamic order) { @@ -306,36 +306,47 @@ class _PackageOrderPage extends State { Map _labelsHashMap(dynamic order) { return Map.from({ if (order['isPending'] == true) - '${FFLocalizations.of(context).getVariableText(ptText: 'Cód. Retirada', enText: 'Pickup Code')}:': order['id'].toString(), - '${FFLocalizations.of(context).getVariableText(ptText: 'Categoria', enText: 'Category')}:': order['customCategory'], - '${FFLocalizations.of(context).getVariableText(ptText: 'Recebido em', enText: 'Received on')}:': ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', order['dtReceive']), + '${FFLocalizations.of(context).getVariableText(ptText: 'Cód. Retirada', enText: 'Pickup Code')}:': + order['id'].toString(), + '${FFLocalizations.of(context).getVariableText(ptText: 'Categoria', enText: 'Category')}:': + order['customCategory'], + '${FFLocalizations.of(context).getVariableText(ptText: 'Recebido em', enText: 'Received on')}:': + ValidatorUtil.toLocalDateTime( + 'yyyy-MM-dd HH:mm:ss', order['dtReceive']), if (order['isPending'] == false) - '${FFLocalizations.of(context).getVariableText(ptText: 'Retirado em', enText: 'Picked up on')}:': ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', order['dtPickUp']), + '${FFLocalizations.of(context).getVariableText(ptText: 'Retirado em', enText: 'Picked up on')}:': + ValidatorUtil.toLocalDateTime( + 'yyyy-MM-dd HH:mm:ss', order['dtPickUp']), }); } Map _labelsHashMapDialog(dynamic order) { return Map.from({ if (order['isPending'] == true) - '${FFLocalizations.of(context).getVariableText(ptText: 'Cód. Retirada', enText: 'Pickup Code')}:': order['id'].toString(), - - '${FFLocalizations.of(context).getVariableText(ptText: 'Categoria', enText: 'Category')}:': order['customCategory'], - + '${FFLocalizations.of(context).getVariableText(ptText: 'Cód. Retirada', enText: 'Pickup Code')}:': + order['id'].toString(), + '${FFLocalizations.of(context).getVariableText(ptText: 'Categoria', enText: 'Category')}:': + order['customCategory'], if (order['code'] != null) - '${FFLocalizations.of(context).getVariableText(ptText: 'Cód. Objeto', enText: 'Object Code')}:': order['code'], - - '${FFLocalizations.of(context).getVariableText(ptText: 'Entregue por', enText: 'Delivered by')}:': order['sendedBy'], - - '${FFLocalizations.of(context).getVariableText(ptText: 'Recebido por', enText: 'Received by')}:': order['receivedBy'], - '${FFLocalizations.of(context).getVariableText(ptText: 'Recebido em', enText: 'Received on')}:': ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', order['dtReceive']), - + '${FFLocalizations.of(context).getVariableText(ptText: 'Cód. Objeto', enText: 'Object Code')}:': + order['code'], + '${FFLocalizations.of(context).getVariableText(ptText: 'Entregue por', enText: 'Delivered by')}:': + order['sendedBy'], + '${FFLocalizations.of(context).getVariableText(ptText: 'Recebido por', enText: 'Received by')}:': + order['receivedBy'], + '${FFLocalizations.of(context).getVariableText(ptText: 'Recebido em', enText: 'Received on')}:': + ValidatorUtil.toLocalDateTime( + 'yyyy-MM-dd HH:mm:ss', order['dtReceive']), if (order['isPending'] == false) - '${FFLocalizations.of(context).getVariableText(ptText: 'Retirado por', enText: 'Picked up by')}:': order['pickedUpBy'], + '${FFLocalizations.of(context).getVariableText(ptText: 'Retirado por', enText: 'Picked up by')}:': + order['pickedUpBy'], if (order['isPending'] == false) - '${FFLocalizations.of(context).getVariableText(ptText: 'Retirado em', enText: 'Picked up on')}:': ValidatorUtil.toLocalDateTime('yyyy-MM-dd HH:mm:ss', order['dtPickUp']), - + '${FFLocalizations.of(context).getVariableText(ptText: 'Retirado em', enText: 'Picked up on')}:': + ValidatorUtil.toLocalDateTime( + 'yyyy-MM-dd HH:mm:ss', order['dtPickUp']), if (order['message'] != null) - '${FFLocalizations.of(context).getVariableText(ptText: 'Mensagem', enText: 'Message')}:': order['message'] + '${FFLocalizations.of(context).getVariableText(ptText: 'Mensagem', enText: 'Message')}:': + order['message'] }); } @@ -343,13 +354,16 @@ class _PackageOrderPage extends State { return [ if (order['isPending'] == true) Map.from({ - FFLocalizations.of(context).getVariableText(ptText: 'Aguardando Retirada', enText: 'Waiting Pick up'): FlutterFlowTheme.of(context).warning, + FFLocalizations.of(context).getVariableText( + ptText: 'Aguardando Retirada', + enText: 'Waiting Pick up'): FlutterFlowTheme.of(context).warning, }) else Map.from({ - FFLocalizations.of(context).getVariableText(ptText: 'Retirado', enText: 'Picked up'): FlutterFlowTheme.of(context).primary, + FFLocalizations.of(context).getVariableText( + ptText: 'Retirado', + enText: 'Picked up'): FlutterFlowTheme.of(context).primary, }), - if (order['adresseeType'] == 'PRO') Map.from({ FFLocalizations.of(context).getVariableText( @@ -369,34 +383,38 @@ class _PackageOrderPage extends State { Widget _item(BuildContext context, dynamic order) { return CardItemTemplateComponentWidget( - imagePath: _imagePath(order), - labelsHashMap: _labelsHashMap(order), - statusHashMap: _statusHashMap(order), - onTapCardItemAction: () async { - showDialog( - useSafeArea: true, - context: context, - builder: (context) { - return Dialog( - child: DetailsComponentWidget( - imagePath: _imagePath(order), - labelsHashMap: _labelsHashMapDialog(order), - statusHashMap: [ - if (order['isPending'] == true) - Map.from({ - FFLocalizations.of(context).getVariableText(ptText: 'Aguardando Retirada', enText: 'Waiting Pick up'): FlutterFlowTheme.of(context).warning, - }) - else - Map.from({ - FFLocalizations.of(context).getVariableText(ptText: 'Retirado', enText: 'Picked up'): FlutterFlowTheme.of(context).primary, - }), - ], - buttons: [], - ), - ); - } - ); - }, + imagePath: _imagePath(order), + labelsHashMap: _labelsHashMap(order), + statusHashMap: _statusHashMap(order), + onTapCardItemAction: () async { + showDialog( + useSafeArea: true, + context: context, + builder: (context) { + return Dialog( + child: DetailsComponentWidget( + imagePath: _imagePath(order), + labelsHashMap: _labelsHashMapDialog(order), + statusHashMap: [ + if (order['isPending'] == true) + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Aguardando Retirada', + enText: 'Waiting Pick up'): + FlutterFlowTheme.of(context).warning, + }) + else + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Retirado', enText: 'Picked up'): + FlutterFlowTheme.of(context).primary, + }), + ], + buttons: [], + ), + ); + }); + }, ); } @@ -407,4 +425,4 @@ class _PackageOrderPage extends State { body: _appBody(context), ); } -} \ No newline at end of file +} diff --git a/lib/pages/preferences_settings_page/preferences_settings_widget.dart b/lib/pages/preferences_settings_page/preferences_settings_widget.dart index c2bbe6cc..f9817091 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_widget.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_widget.dart @@ -42,8 +42,8 @@ class PreferencesPageWidget extends StatelessWidget { ), title: Text( FFLocalizations.of(context).getVariableText( - enText: 'Preferences', - ptText: 'Preferências', + enText: 'System Settings', + ptText: 'Opções do Sistema', ), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Nunito', diff --git a/lib/pages/provisional_schedule_page/provisional_schedule_widget.dart b/lib/pages/provisional_schedule_page/provisional_schedule_widget.dart index a34d0397..0bb92f31 100644 --- a/lib/pages/provisional_schedule_page/provisional_schedule_widget.dart +++ b/lib/pages/provisional_schedule_page/provisional_schedule_widget.dart @@ -58,7 +58,7 @@ class _ProvisionalScheduleState extends State { ), title: Text( FFLocalizations.of(context).getVariableText( - enText: 'Provisional Schedule', + enText: 'Schedule Providers', ptText: 'Agendar Prestadores', ), style: FlutterFlowTheme.of(context).headlineMedium.override( diff --git a/lib/pages/reception_page/reception_page_widget.dart b/lib/pages/reception_page/reception_page_widget.dart index 82fe4d3f..97b6aeb9 100644 --- a/lib/pages/reception_page/reception_page_widget.dart +++ b/lib/pages/reception_page/reception_page_widget.dart @@ -1,11 +1,9 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:hub/app_state.dart'; import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.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/reception_page/reception_page_model.dart'; import 'package:provider/provider.dart'; @@ -120,8 +118,8 @@ class _ReceptionPageWidgetState extends State { .titleSmall .override( fontFamily: 'Nunito Sans', - color: FlutterFlowTheme.of(context) - .primaryBackground, + color: + FlutterFlowTheme.of(context).info, fontSize: 14.0, letterSpacing: 0.0, fontWeight: FontWeight.w500, 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 7b50d328..7da52036 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 @@ -3,8 +3,11 @@ 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:fluttertoast/fluttertoast.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/actions/actions.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; +import 'package:hub/components/atomic_components/shared_components_atoms/toast.dart'; import 'package:hub/components/templates_components/details_component/details_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'; @@ -1606,166 +1609,155 @@ Widget scheduleVisit(BuildContext context, ), onPressed: _model.isValid() ? () async { - await showDialog( - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Dialog( - alignment: Alignment.topCenter, - child: SizedBox( - // width: MediaQuery.of(context).size.width, - // height: MediaQuery.of(context).size.height * 0.7, - // child: VisitDetailsModalTemplateComponentWidget( - // visitStartDateStr: _model.textController1.text, - // visitEndDateStr: _model.textController2.text, - // visitReasonStr: _model.dropDownValue1, - // visitLevelStr: _model.dropDownValue2, - // visitTempStr: - // _model.switchValue == true ? 'Sim' : 'Não', - // visitObsStr: _model.textController3.text, - // visitorStrList: _model.visitorStrList, - // visitorJsonList: _model.visitorJsonList, - // updateToggleIdx: () async {}, - // repeatVisitSchedule: () async {}, - // ), - child: DetailsComponentWidget( - buttons: [ - FFButtonWidget( - text: FFLocalizations.of(context) - .getVariableText( - enText: 'Done', - ptText: 'Confirmar', - ), - icon: const Icon(Icons.done), - onPressed: () async { - showAlertDialog( - context, - FFLocalizations.of(context) - .getVariableText( - ptText: 'Ativar Visita', - enText: 'Activate Visit', - ), - FFLocalizations.of(context) - .getVariableText( - ptText: - 'Você tem certeza que deseja ativar essa visita?', - enText: - 'Are you sure you want to activate this visit?', - ), () async { - await PhpGroup.postScheduleVisitCall - .call( - devUUID: AppState().devUUID, - userUUID: AppState().userUUID, - atividade: 'putVisita', - devDesc: _model.textController3.text, - idVisitante: _model.visitorStrList, - dtInicio: _model.convertDateFormat( - _model.textController1.text ?? ''), - dtFim: _model.convertDateFormat( - _model.textController2.text ?? ''), - unica: _model.switchValue == true - ? 'Sim' - : 'Não', - idMotivo: extractIdToStr( - _model.dropDownValue1!), - idNAC: extractIdToStr( - _model.dropDownValue2!), - obs: _model.textController3.text, - cliID: AppState().cliUUID, - ) - .catchError((e) async { - await DialogUtil.errorDefault(context); - }).then((value) async { - if (PhpGroup.postScheduleVisitCall - .error( - (value.jsonBody ?? ''), - ) == - false) { - Navigator.pop(context); - Navigator.pop(context); - showSnackbar( - context, - FFLocalizations.of(context) - .getVariableText( - enText: - 'Success in scheduling visit', - ptText: - 'Succeso ao agendar a visita', - ), - false, - ); - } else { - await DialogUtil.errorDefault( - context); - Navigator.pop(context); - Navigator.pop(context); - } - }); + Future scheduleVisit() async { + await PhpGroup.postScheduleVisitCall + .call( + devUUID: AppState().devUUID, + userUUID: AppState().userUUID, + atividade: 'putVisita', + devDesc: _model.textController3.text, + idVisitante: _model.visitorStrList, + dtInicio: _model + .convertDateFormat(_model.textController1.text ?? ''), + dtFim: _model + .convertDateFormat(_model.textController2.text ?? ''), + unica: _model.switchValue == true ? 'Sim' : 'Não', + idMotivo: extractIdToStr(_model.dropDownValue1!), + idNAC: extractIdToStr(_model.dropDownValue2!), + obs: _model.textController3.text, + cliID: AppState().cliUUID, + ) + .catchError((e) async { + await DialogUtil.errorDefault(context); + }).then((value) async { + if (PhpGroup.postScheduleVisitCall.error( + (value.jsonBody ?? ''), + ) == + false) { + Navigator.pop(context); - safeSetState(() {}); - }); - }, - options: FFButtonOptions( - width: 130, - height: 40, - color: FlutterFlowTheme.of(context) - .primaryBackground, - elevation: 0, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context) - .primaryText, + //MILESTONE + _model.dropDownValue1 = null; + _model.dropDownValue2 = null; + _model.dropDownValueController1 = + FormFieldController(''); + _model.dropDownValueController2 = + FormFieldController(''); + _model.visitorStrList = ''; + _model.visitorJsonList = []; + + ToastUtil.showToast( + message: FFLocalizations.of(context) + .getVariableText( + ptText: 'Visitante já adicionado!', + enText: 'Visitor already added!'), + gravity: ToastGravity.TOP, + backgroundColor: Colors.green); + + await showShare(value.jsonBody); + } else { + await DialogUtil.errorDefault(context); + Navigator.pop(context); + } + }); + + safeSetState(() {}); + } + + if (_model.visitorJsonList.length > 1) { + final title = FFLocalizations.of(context).getVariableText( + ptText: 'Cadastrar Múltiplos Visitantes', + enText: 'Register Multiple Visitors', + ); + final content = FFLocalizations.of(context).getVariableText( + ptText: + 'Você deseja agendar uma visita para ${_model.visitorJsonList.length} visitantes?', + enText: + 'Do you want to schedule a visit for ${_model.visitorJsonList.length} visitors?', + ); + + showAlertDialog(context, title, content, scheduleVisit); + } else { + await showDialog( + context: context, + builder: (context) { + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Dialog( + alignment: Alignment.topCenter, + child: SizedBox( + child: DetailsComponentWidget( + buttons: [ + FFButtonWidget( + text: FFLocalizations.of(context) + .getVariableText( + enText: 'Done', + ptText: 'Confirmar', ), - borderSide: BorderSide( + icon: const Icon(Icons.done), + onPressed: scheduleVisit, + options: FFButtonOptions( + width: 130, + height: 40, color: FlutterFlowTheme.of(context) .primaryBackground, - width: 1, + elevation: 0, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context) + .primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, + width: 1, + ), + // borderRadius: 12, ), - // borderRadius: 12, ), - ), - ], - imagePath: - 'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${_model.visitorJsonList[0]['VTE_DOCUMENTO'] ?? ''}&tipo=E', - labelsHashMap: { - 'Nome': _model.visitorJsonList[0]['VTE_NOME'], - 'Start': _model.textController1.text, - 'End': _model.textController2.text ?? '', - 'Reason': (RegExp(r'MOT_DESCRICAO:\s*([^,]+)') - .firstMatch( - _model.dropDownValue1.toString()) - ?.group(1) - .toString()) ?? - '', - 'Level': (RegExp(r'NAC_DESCRICAO:\s*([^,]+)') - .firstMatch( - _model.dropDownValue2.toString()) - ?.group(1) - .toString()) ?? - '', - 'Single Visit': - _model.switchValue == true ? 'Sim' : 'Não', - if (_model.textController3.text.isNotEmpty) - 'Observation': _model.textController3.text, - }, - statusHashMap: [ - Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Inativo', - enText: 'Inactive', - ): FlutterFlowTheme.of(context).warning, - }), - ], - onTapCardItemAction: () async {}, + ], + imagePath: + 'https://freaccess.com.br/freaccess/getImage.php?cliID=${AppState().cliUUID}&atividade=getFoto&Documento=${_model.visitorJsonList[0]['VTE_DOCUMENTO'] ?? ''}&tipo=E', + labelsHashMap: { + 'Nome': _model.visitorJsonList[0]['VTE_NOME'], + 'Start': _model.textController1.text, + 'End': _model.textController2.text ?? '', + 'Reason': (RegExp(r'MOT_DESCRICAO:\s*([^,]+)') + .firstMatch( + _model.dropDownValue1.toString()) + ?.group(1) + .toString()) ?? + '', + 'Level': (RegExp(r'NAC_DESCRICAO:\s*([^,]+)') + .firstMatch( + _model.dropDownValue2.toString()) + ?.group(1) + .toString()) ?? + '', + 'Single Visit': _model.switchValue == true + ? 'Sim' + : 'Não', + if (_model.textController3.text.isNotEmpty) + 'Observation': _model.textController3.text, + }, + statusHashMap: [ + Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Inativo', + enText: 'Inactive', + ): FlutterFlowTheme.of(context).warning, + }), + ], + onTapCardItemAction: () async {}, + ), ), ), - ), - ); - }, - ).then((value) => safeSetState(() {})); + ); + }, + ).then((value) => safeSetState(() {})); + } } : null, options: FFButtonOptions( diff --git a/lib/shared/widgets/drawer_widget/drawer_widget.dart b/lib/shared/widgets/drawer_widget/drawer_widget.dart index 839e5c65..3a0127c3 100644 --- a/lib/shared/widgets/drawer_widget/drawer_widget.dart +++ b/lib/shared/widgets/drawer_widget/drawer_widget.dart @@ -87,7 +87,6 @@ class CustomDrawer extends StatelessWidget { fontWeight: FontWeight.normal, ), ), - SizedBox(height: 5), Text( AppState().email, style: FlutterFlowTheme.of(context).bodySmall.override( diff --git a/pubspec.lock b/pubspec.lock index 49fbc8b6..60aaa29c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -817,18 +817,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -905,10 +905,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" + material_symbols_icons: + dependency: "direct main" + description: + name: material_symbols_icons + sha256: b72bf7566d024d51627dce81b1b98539830a0e3ffbb5784989aa3e97c8493160 + url: "https://pub.dev" + source: hosted + version: "4.2784.0" maybe_just_nothing: dependency: transitive description: @@ -921,10 +929,10 @@ packages: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.15.0" mime: dependency: transitive description: @@ -1342,10 +1350,10 @@ packages: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.2" timeago: dependency: "direct main" description: @@ -1510,10 +1518,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "14.2.4" web: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 1f3c6a80..f14f3fd8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -86,6 +86,7 @@ dependencies: video_player_avfoundation: 2.6.1 video_player_platform_interface: 6.2.2 video_player_web: 2.3.1 + material_symbols_icons: ^4.2784.0 fluttertoast: ^8.2.8 cupertino_icons: ^1.0.0 @@ -132,18 +133,18 @@ flutter: - assets/lottie_animations/ - assets/rive_animations/ - assets/pdfs/ - fonts: - - family: "SF Pro" - fonts: - - asset: assets/fonts/SFPRODISPLAYREGULAR.OTF - - asset: assets/fonts/SFPRODISPLAYMEDIUM.OTF - weight: 500 - - asset: assets/fonts/SFPRODISPLAYBOLD.OTF - weight: 700 +fonts: + - family: "SF Pro" + fonts: + - asset: assets/fonts/SFPRODISPLAYREGULAR.OTF + - asset: assets/fonts/SFPRODISPLAYMEDIUM.OTF + weight: 500 + - asset: assets/fonts/SFPRODISPLAYBOLD.OTF + weight: 700 - - family: Icons - fonts: - - asset: assets/fonts/icons.ttf - - family: Menu - fonts: - - asset: assets/fonts/menu.ttf + - family: Icons + fonts: + - asset: assets/fonts/icons.ttf + - family: Menu + fonts: + - asset: assets/fonts/menu.ttf From 2742d7d9f62490c90224dfc1a08cd880b1f70e68 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Wed, 28 Aug 2024 16:45:21 -0300 Subject: [PATCH 2/2] WIP --- assets/images/home.png | Bin 7309 -> 8055 bytes .../order_filter_modal_widget.dart | 96 ++++--- .../menu_component/menu_component_widget.dart | 254 ++++++++---------- .../menu_list_view_component_widget.dart | 6 +- .../menu_staggered_view_component_widget.dart | 4 +- .../details_component_action.dart | 4 +- .../provisional_schedule_template_model.dart | 23 +- .../provisional_shcedule_template_widget.dart | 3 +- ...siter_vistor_template_component_model.dart | 19 +- ...iter_vistor_template_component_widget.dart | 184 ++++++------- lib/flutter_flow/internationalization.dart | 14 +- .../acess_history_page_widget.dart | 21 +- lib/pages/home_page/home_page_widget.dart | 21 +- .../preferences_settings_model.dart | 32 +-- .../schedule_complete_visit_page_widget.dart | 2 +- .../widgets/drawer_widget/drawer_widget.dart | 21 +- 16 files changed, 370 insertions(+), 334 deletions(-) diff --git a/assets/images/home.png b/assets/images/home.png index 6682503e6227b07b916e8de04c2fa2f35b4d304e..8e391e50fe876dd8dd4c216d2d2fc17b696638bf 100644 GIT binary patch literal 8055 zcmXY0c|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bk0c>h-Bbiq!_V3OS9y_=QS z!oq;}e__FYXl?u_*X{q>_CM&5{r?MA%3TETw1~nKSQhjODr~30h7*<-VbaXPN~P`a zqm(6mb_{|I2!>+|t1tW?YyPP9dpl2o2oE>}Kao6Nv?K`&=*NF!VOOw!G>Hc2>CWMF zmgJN(yd_Iy*roej_eDkE0iisC1B`MCp0KyY`sV-lnyEmW_-}@NQ zvr7}cUWRga-^T&E&=fXAxwQkyD=2`#B_7^{Mqfz?PKC1{Bi9>-*UMHXo$#1*zBOqU zRK#K*y!JH4`)VdEvyk4@;rm45TN72YyT?7+RUmqeDNdQ8qr^|yySP#u4| z^U*9(D8K)CT=;TB@TqLT@1H%eSIEqqFphIWz~uMGtM?t(MHKavFhf2Mhnld`CU~{! z+e}EeM$^wFoWI+F1^33`)CNtzWa&8JRp&|p>-Jh6!aRw^N>B9ce!0PD#0FTq=)iv@ zhMV`pM#0C%oTuigpQ|$p0Z;qmsnQY6Z>|T;Ev;Bgwa<-8&I>TDL)}#+lI0~TEGEU` zm6%2$U_48lLuyle&nUU1!PW#9Y2v>gEhjclZ+J7@zOabOVsZzQxt1;AL_k+9lnnTN zcC=9I!)A>$^BX444+KWd{}%_pxk)uG7iG6C$02w}d1_v*zrlzfzAyT%DA8N)TaelH zwredqeoIb_Oc-clKD>O?er@;t-=P_W6SJuW(@7=y0y(=0cTM>3A#k*Fv8`Zp`2Pi> CYSsh* 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, ), ); }