From b9d23b185c9159ad904cf1a7f4a6f3ce474eabc3 Mon Sep 17 00:00:00 2001 From: Lucas Date: Tue, 6 Aug 2024 17:25:19 -0300 Subject: [PATCH 01/14] Re-model modal --- lib/flutter_flow/upload_data.dart | 118 ++++++++++++++++++++---------- 1 file changed, 79 insertions(+), 39 deletions(-) diff --git a/lib/flutter_flow/upload_data.dart b/lib/flutter_flow/upload_data.dart index c7c4c597..7136765b 100644 --- a/lib/flutter_flow/upload_data.dart +++ b/lib/flutter_flow/upload_data.dart @@ -57,16 +57,25 @@ Future?> selectMediaWithSourceBottomSheet({ bool includeDimensions = false, bool includeBlurHash = false, }) async { - createUploadMediaListTile(String label, MediaSource mediaSource) => ListTile( - title: Text( - label, - textAlign: TextAlign.center, - style: GoogleFonts.getFont( - pickerFontFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontWeight: FontWeight.w600, - fontSize: 20, - ), + createUploadMediaListTile( + String label, MediaSource mediaSource, IconData icon) => + ListTile( + title: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(icon, color: FlutterFlowTheme.of(context).primaryText), + SizedBox(width: 5), + Text( + label, + textAlign: TextAlign.center, + style: GoogleFonts.getFont( + pickerFontFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontWeight: FontWeight.w600, + fontSize: 12, + ), + ), + ], ), tileColor: FlutterFlowTheme.of(context).primaryBackground, dense: false, @@ -83,11 +92,22 @@ Future?> selectMediaWithSourceBottomSheet({ mainAxisSize: MainAxisSize.min, children: [ if (!kIsWeb) ...[ + Container( + margin: const EdgeInsets.only(top: 10), + width: 40, + height: 5, + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + ), Padding( padding: const EdgeInsets.fromLTRB(0, 8, 0, 0), child: ListTile( title: Text( - 'Choose Source', + FFLocalizations.of(context).getVariableText( + ptText: "Escolha uma das opções", + enText: "Choose one of the options"), textAlign: TextAlign.center, style: GoogleFonts.getFont( pickerFontFamily, @@ -95,41 +115,61 @@ Future?> selectMediaWithSourceBottomSheet({ .primaryText .withOpacity(0.65), fontWeight: FontWeight.w500, - fontSize: 20, + fontSize: 14, ), ), tileColor: FlutterFlowTheme.of(context).primaryBackground, dense: true, ), ), - const Divider(), ], - if (allowPhoto && allowVideo) ...[ - createUploadMediaListTile( - 'Gallery (Photo)', - MediaSource.photoGallery, - ), - const Divider(), - createUploadMediaListTile( - 'Gallery (Video)', - MediaSource.videoGallery, - ), - ] else if (allowPhoto) - createUploadMediaListTile( - 'Gallery', - MediaSource.photoGallery, - ) - else - createUploadMediaListTile( - 'Gallery', - MediaSource.videoGallery, - ), - if (!kIsWeb) ...[ - const Divider(), - createUploadMediaListTile('Camera', MediaSource.camera), - const Divider(), - ], - const SizedBox(height: 10), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + if (allowPhoto && allowVideo) ...[ + Expanded( + child: createUploadMediaListTile( + FFLocalizations.of(context).getVariableText( + ptText: "Galeria (Foto)", + enText: "Gallery (Photo)"), + MediaSource.photoGallery, + Icons.camera), + ), + Expanded( + child: createUploadMediaListTile( + FFLocalizations.of(context).getVariableText( + ptText: "Galeria (Video)", + enText: "Gallery (Video)"), + MediaSource.videoGallery, + Icons.videocam), + ) + ] else if (allowPhoto) + Expanded( + child: createUploadMediaListTile( + FFLocalizations.of(context).getVariableText( + ptText: "Galeria", enText: "Gallery"), + MediaSource.photoGallery, + Icons.photo)) + else + Expanded( + child: createUploadMediaListTile( + FFLocalizations.of(context).getVariableText( + ptText: "Galeria", enText: "Gallery"), + MediaSource.videoGallery, + Icons.videocam), + ), + if (!kIsWeb) ...[ + Expanded( + child: createUploadMediaListTile( + FFLocalizations.of(context).getVariableText( + ptText: "Camera", enText: "Camera"), + MediaSource.camera, + Icons.camera_alt), + ) + ], + ], + ), + const SizedBox(height: 15), ], ); }); From 3061f755092ddc16203d465dc102e3820a426c26 Mon Sep 17 00:00:00 2001 From: Lucas Date: Tue, 6 Aug 2024 17:26:43 -0300 Subject: [PATCH 02/14] =?UTF-8?q?adi=C3=A7=C3=A3o=20de=20um=20const=20para?= =?UTF-8?q?=20o=20sizedbox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/flutter_flow/upload_data.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/flutter_flow/upload_data.dart b/lib/flutter_flow/upload_data.dart index 7136765b..0fecc1c0 100644 --- a/lib/flutter_flow/upload_data.dart +++ b/lib/flutter_flow/upload_data.dart @@ -64,7 +64,7 @@ Future?> selectMediaWithSourceBottomSheet({ mainAxisAlignment: MainAxisAlignment.center, children: [ Icon(icon, color: FlutterFlowTheme.of(context).primaryText), - SizedBox(width: 5), + const SizedBox(width: 5), Text( label, textAlign: TextAlign.center, From b89f8e2d27962231f426c84f1ddefc00fa87a3fc Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Wed, 7 Aug 2024 13:20:38 -0300 Subject: [PATCH 03/14] fix: Adicionado o Tratamento de Erro Pessoa Propriedade --- .../people_on_the_property_page_widget.dart | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart index 0dbfce20..a8a20a8c 100644 --- a/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart +++ b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart @@ -1,8 +1,11 @@ +import 'dart:developer'; + import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/flutter_flow/internationalization.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/people_on_the_property_page/people_on_the_property_page_model.dart'; @@ -13,6 +16,9 @@ import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; +import '../../shared/utils/dialog_util.dart'; +import '../../shared/utils/log_util.dart'; + class PeopleOnThePropertyPageWidget extends StatefulWidget { const PeopleOnThePropertyPageWidget({super.key}); @@ -106,9 +112,30 @@ class _PeopleOnThePropertyPageWidgetState ), ); } + + if (snapshot.hasError || snapshot.data?.exception != null) { + if (snapshot.error != null && snapshot.stackTrace != null) { + LogUtil.requestAPIFailed('getPessoasLocal.php', "", 'Busca Pessoas no Local', snapshot.error, snapshot.stackTrace!); + } + + return Center( + child: SizedBox( + width: double.infinity, + height: 100, + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: "Pessoas não encontradas", + enText: "Persons not found" + ), + textAlign: TextAlign.center, + ), + ), + ); + } + final columnGetPessoasLocalResponse = snapshot.data!; - final getPoepleProperty = PhpGroup.getPessoasLocalCall.pessoas(columnGetPessoasLocalResponse.jsonBody,)?.toList() ?? - []; + final getPoepleProperty = PhpGroup.getPessoasLocalCall.pessoas(columnGetPessoasLocalResponse.jsonBody,)?.toList() ?? []; + return ListView.builder( physics: const AlwaysScrollableScrollPhysics(), shrinkWrap: true, From cee23db0e9f3cb8c3760b8aa52bf98bf24a94855 Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Thu, 8 Aug 2024 13:41:12 +0000 Subject: [PATCH 04/14] =?UTF-8?q?fet:=20Altera=C3=A7=C3=B5es=20na=20Tela?= =?UTF-8?q?=20de=20Agendamento=20Provisorio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Runner.xcodeproj/project.pbxproj | 8 +- lib/actions/actions.dart | 2 +- .../details_component_model.dart} | 6 +- .../details_component_widget.dart} | 18 +- ...got_password_template_component_model.dart | 2 +- .../view_visit_detail_widget.dart | 2 +- lib/flutter_flow/internationalization.dart | 90 +- .../acess_history_page_model.dart | 10 +- .../acess_history_page_widget.dart | 9 +- lib/pages/home_page/home_page_model.dart | 2 - lib/pages/home_page/home_page_widget.dart | 8 +- .../liberation_history_model.dart | 2 - .../liberation_history_widget.dart | 4 +- .../people_on_the_property_page_model.dart | 8 +- .../people_on_the_property_page_widget.dart | 4 +- .../qr_code_page/qr_code_page_model.dart | 8 +- .../qr_code_page/qr_code_page_widget.dart | 11 +- .../register_visitor_page_model.dart | 2 - .../register_visitor_page_widget.dart | 18 +- .../schedule_complete_visit_page_model.dart | 2 - .../schedule_complete_visit_page_widget.dart | 53 +- ...schedule_provisional_visit_page_model.dart | 86 +- ...chedule_provisional_visit_page_widget.dart | 1527 +++++++++-------- .../sign_in_page/sign_in_page_model.dart | 2 - .../sign_in_page/sign_in_page_widget.dart | 4 +- .../sign_up_page/sign_up_page_model.dart | 2 - .../sign_up_page/sign_up_page_widget.dart | 4 +- .../welcome_page/welcome_page_model.dart | 2 - .../welcome_page/welcome_page_widget.dart | 4 +- 29 files changed, 982 insertions(+), 918 deletions(-) rename lib/components/templates_components/{visit_request_template_component/visit_request_template_component_model.dart => details_component/details_component_model.dart} (92%) rename lib/components/templates_components/{visit_request_template_component/visit_request_template_component_widget.dart => details_component/details_component_widget.dart} (97%) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index e089766f..46c8eb1b 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -44,8 +44,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6436409727A31CDC00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409027A31CD400820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409627A31CDB00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409827A31CDD00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -225,8 +225,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 6436409727A31CDC00820AF7 /* pt */, - 6436409027A31CD400820AF7 /* en */, + 6436409627A31CDB00820AF7 /* pt */, + 6436409827A31CDD00820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; diff --git a/lib/actions/actions.dart b/lib/actions/actions.dart index 30c1b6b9..32967b56 100644 --- a/lib/actions/actions.dart +++ b/lib/actions/actions.dart @@ -125,7 +125,7 @@ Future singInLoginAction( (loginCall.jsonBody ?? ''), )!; FFAppState().createdAt = dateTimeFormat( - 'd/M/y H:mm:ss', + "d/M/y H:mm:ss", getCurrentTimestamp, locale: FFLocalizations.of(context).languageCode, ); diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart b/lib/components/templates_components/details_component/details_component_model.dart similarity index 92% rename from lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart rename to lib/components/templates_components/details_component/details_component_model.dart index a783359b..0b6acefb 100644 --- a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_model.dart +++ b/lib/components/templates_components/details_component/details_component_model.dart @@ -1,11 +1,9 @@ import '/backend/api_requests/api_calls.dart'; import '/flutter_flow/flutter_flow_util.dart'; -import 'visit_request_template_component_widget.dart' - show VisitRequestTemplateComponentWidget; +import 'details_component_widget.dart' show DetailsComponentWidget; import 'package:flutter/material.dart'; -class VisitRequestTemplateComponentModel - extends FlutterFlowModel { +class DetailsComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. // State field(s) for TextField widget. diff --git a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart b/lib/components/templates_components/details_component/details_component_widget.dart similarity index 97% rename from lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart rename to lib/components/templates_components/details_component/details_component_widget.dart index 8e3dd830..293790fc 100644 --- a/lib/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart +++ b/lib/components/templates_components/details_component/details_component_widget.dart @@ -5,11 +5,11 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import 'visit_request_template_component_model.dart'; -export 'visit_request_template_component_model.dart'; +import 'details_component_model.dart'; +export 'details_component_model.dart'; -class VisitRequestTemplateComponentWidget extends StatefulWidget { - const VisitRequestTemplateComponentWidget({ +class DetailsComponentWidget extends StatefulWidget { + const DetailsComponentWidget({ super.key, required this.vteName, required this.vteReason, @@ -41,13 +41,11 @@ class VisitRequestTemplateComponentWidget extends StatefulWidget { final String? vawDate; @override - State createState() => - _VisitRequestTemplateComponentWidgetState(); + State createState() => _DetailsComponentWidgetState(); } -class _VisitRequestTemplateComponentWidgetState - extends State { - late VisitRequestTemplateComponentModel _model; +class _DetailsComponentWidgetState extends State { + late DetailsComponentModel _model; @override void setState(VoidCallback callback) { @@ -58,7 +56,7 @@ class _VisitRequestTemplateComponentWidgetState @override void initState() { super.initState(); - _model = createModel(context, () => VisitRequestTemplateComponentModel()); + _model = createModel(context, () => DetailsComponentModel()); _model.textController1 ??= TextEditingController(text: widget.vteName); _model.textFieldFocusNode1 ??= FocusNode(); diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart index c7fe19a6..ed840cc5 100644 --- a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart +++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_model.dart @@ -17,7 +17,7 @@ class ForgotPasswordTemplateComponentModel BuildContext context, String? val) { if (val == null || val.isEmpty) { return FFLocalizations.of(context).getText( - '3hqg8buh' /* E-mail é Obrigatório */, + 'snnmkbyc' /* E-mail é Obrigatório */, ); } diff --git a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart index 73f3e397..7dd2f57f 100644 --- a/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart +++ b/lib/components/templates_components/view_visit_detail/view_visit_detail_widget.dart @@ -858,7 +858,7 @@ class _ViewVisitDetailWidgetState extends State { queryParameters: { 'visitStartDateStr': serializeParam( dateTimeFormat( - 'd/M/y H:mm:ss', + "d/M/y H:mm:ss", getCurrentTimestamp, locale: FFLocalizations.of(context) .languageCode, diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index f27adf85..d73b4530 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -320,46 +320,74 @@ final kTranslationsMap = >>[ }, // scheduleProvisionalVisitPage { - 'x7at46ur': { - 'pt': 'Quais visitantes você deseja cadastrar?', - 'en': 'Which visitors do you want to register?', + 'uj8acuab': { + 'pt': 'Preencha os Campos Abaixo:', + 'en': 'Fill in the fields below:', }, - 'shj19b2o': { - 'pt': 'Qual o período de validade da visita?', - 'en': 'Visit Validity Period', + '8d3679lf': { + 'pt': 'Propriedade', + 'en': '', }, - '8zgsw5so': { - 'pt': 'Ínicio da Visita', - 'en': 'Start of the Visit', - }, - 'p16wm7kp': { - 'pt': 'Quando a visitas se inicia?', - 'en': 'When does the visit start?', - }, - '3zfd7uf9': { - 'pt': 'Qual o nome do visitante?', - 'en': 'What is the visitor\'s name?', + 'z6aawgqa': { + 'pt': 'Dados da Visita', + 'en': 'Visit Data', }, 'wehvxbz4': { - 'pt': 'Nome do Visitante', - 'en': 'Visitor Name', + 'pt': 'Nome / Apelido do Visitante', + 'en': 'Visitor\'s Name / Nickname', }, 'juh7f24w': { - 'pt': 'Escreva o nome do visitante aqui', - 'en': 'Write the visitor\'s name here', + 'pt': '', + 'en': '', }, - 'jhss056s': { - 'pt': 'Você tem alguma observação sobre está visita?', - 'en': 'Do you have any observations about this visit?', + '8zgsw5so': { + 'pt': 'Data / Hora Limite da Visita', + 'en': 'Visit Limit Date / Time', + }, + 'p16wm7kp': { + 'pt': '', + 'en': '', }, 'cw8b3tbb': { - 'pt': 'Observações da Visita', - 'en': 'Visit Observations', + 'pt': 'Observação da Visita', + 'en': 'Notes Visit', }, 'k4qkbv1f': { - 'pt': 'Escreva as suas observações aqui', + 'pt': '', 'en': 'Write your observations here', }, + 'bv5fg9sv': { + 'pt': 'Enviar', + 'en': 'Send', + }, + '3hqg8buh': { + 'pt': 'Nome é Obrigatório', + 'en': 'Name is Required', + }, + 'l0b0zr50': { + 'pt': 'Máximo 80 caracteres', + 'en': 'Maximum 80 characters', + }, + '1p76vmkn': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', + }, + 'uzefkuf9': { + 'pt': 'Data / Hora é Obrigatório', + 'en': 'Date / Time is Required', + }, + 'sn6pj4tx': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', + }, + 'j14it3wp': { + 'pt': 'Field is required', + 'en': '', + }, + 'ypo6pxie': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', + }, 'cifgwfxs': { 'pt': 'Agendamento Provisório', 'en': 'Provisional Scheduling', @@ -1017,15 +1045,15 @@ final kTranslationsMap = >>[ 'pt': '', 'en': '', }, - '3hqg8buh': { + 'snnmkbyc': { 'pt': 'E-mail é Obrigatório', - 'en': '', + 'en': 'Name is Required', }, 'jh5r2b1w': { 'pt': 'E-mail Inválido', 'en': '', }, - '1p76vmkn': { + 'ph22karc': { 'pt': 'Please choose an option from the dropdown', 'en': '', }, @@ -1034,7 +1062,7 @@ final kTranslationsMap = >>[ 'en': 'Send', }, }, - // visitRequestTemplateComponent + // detailsComponent { 'ivfw4j04': { 'pt': 'Nome', diff --git a/lib/pages/acess_history_page/acess_history_page_model.dart b/lib/pages/acess_history_page/acess_history_page_model.dart index 71a5824f..c3c0e12c 100644 --- a/lib/pages/acess_history_page/acess_history_page_model.dart +++ b/lib/pages/acess_history_page/acess_history_page_model.dart @@ -11,10 +11,6 @@ class AcessHistoryPageModel extends FlutterFlowModel { String pesType = 'T'; - /// State fields for stateful widgets in this page. - - final unfocusNode = FocusNode(); - /// Query cache managers for this widget. final _accessHistoryManager = FutureRequestManager(); @@ -37,8 +33,6 @@ class AcessHistoryPageModel extends FlutterFlowModel { @override void dispose() { - unfocusNode.dispose(); - /// Dispose query cache managers for this widget. clearAccessHistoryCache(); @@ -53,9 +47,7 @@ class AcessHistoryPageModel extends FlutterFlowModel { context: context, builder: (context) { return GestureDetector( - onTap: () => unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => FocusScope.of(context).unfocus(), child: Padding( padding: MediaQuery.viewInsetsOf(context), child: OptModalWidget( 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 8b4f8b03..cb723ce2 100644 --- a/lib/pages/acess_history_page/acess_history_page_widget.dart +++ b/lib/pages/acess_history_page/acess_history_page_widget.dart @@ -41,9 +41,7 @@ class _AcessHistoryPageWidgetState extends State { context.watch(); return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => FocusScope.of(context).unfocus(), child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, @@ -114,10 +112,7 @@ class _AcessHistoryPageWidgetState extends State { context: context, builder: (context) { return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => FocusScope.of(context).unfocus(), child: Padding( padding: MediaQuery.viewInsetsOf(context), child: OptModalWidget( diff --git a/lib/pages/home_page/home_page_model.dart b/lib/pages/home_page/home_page_model.dart index 01e742ae..ba23603a 100644 --- a/lib/pages/home_page/home_page_model.dart +++ b/lib/pages/home_page/home_page_model.dart @@ -12,7 +12,6 @@ class HomePageModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. - final unfocusNode = FocusNode(); // State field(s) for TextField widget. FocusNode? textFieldFocusNode; TextEditingController? textController; @@ -35,7 +34,6 @@ class HomePageModel extends FlutterFlowModel { @override void dispose() { - unfocusNode.dispose(); textFieldFocusNode?.dispose(); textController?.dispose(); diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index e28895db..7dea478e 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -40,9 +40,7 @@ class _HomePageWidgetState extends State { context: context, builder: (context) { return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => FocusScope.of(context).unfocus(), child: Padding( padding: MediaQuery.viewInsetsOf(context), child: const BottomArrowLinkedLocalsComponentWidget(), @@ -71,9 +69,7 @@ class _HomePageWidgetState extends State { context.watch(); return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => FocusScope.of(context).unfocus(), child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).secondaryBackground, diff --git a/lib/pages/liberation_history/liberation_history_model.dart b/lib/pages/liberation_history/liberation_history_model.dart index 71f5efef..9a574297 100644 --- a/lib/pages/liberation_history/liberation_history_model.dart +++ b/lib/pages/liberation_history/liberation_history_model.dart @@ -8,7 +8,6 @@ import 'package:flutter/material.dart'; class LiberationHistoryModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. - final unfocusNode = FocusNode(); // State field(s) for TextField widget. FocusNode? textFieldFocusNode; TextEditingController? textController; @@ -36,7 +35,6 @@ class LiberationHistoryModel extends FlutterFlowModel { @override void dispose() { - unfocusNode.dispose(); textFieldFocusNode?.dispose(); textController?.dispose(); diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index 40af9b56..32fa52a4 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -45,9 +45,7 @@ class _LiberationHistoryWidgetState extends State { context.watch(); return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => FocusScope.of(context).unfocus(), child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart index 31fed050..d6c7649f 100644 --- a/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart +++ b/lib/pages/people_on_the_property_page/people_on_the_property_page_model.dart @@ -5,15 +5,9 @@ import 'package:flutter/material.dart'; class PeopleOnThePropertyPageModel extends FlutterFlowModel { - /// State fields for stateful widgets in this page. - - final unfocusNode = FocusNode(); - @override void initState(BuildContext context) {} @override - void dispose() { - unfocusNode.dispose(); - } + void dispose() {} } diff --git a/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart index 8aca37f8..89e22433 100644 --- a/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart +++ b/lib/pages/people_on_the_property_page/people_on_the_property_page_widget.dart @@ -42,9 +42,7 @@ class _PeopleOnThePropertyPageWidgetState context.watch(); return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => FocusScope.of(context).unfocus(), child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, diff --git a/lib/pages/qr_code_page/qr_code_page_model.dart b/lib/pages/qr_code_page/qr_code_page_model.dart index 1c96dd84..de5d0e91 100644 --- a/lib/pages/qr_code_page/qr_code_page_model.dart +++ b/lib/pages/qr_code_page/qr_code_page_model.dart @@ -12,17 +12,11 @@ class QrCodePageModel extends FlutterFlowModel { DateTime? time; - /// State fields for stateful widgets in this page. - - final unfocusNode = FocusNode(); - @override void initState(BuildContext context) {} @override - void dispose() { - unfocusNode.dispose(); - } + void dispose() {} /// Action blocks. Future qrCodeEncoder( diff --git a/lib/pages/qr_code_page/qr_code_page_widget.dart b/lib/pages/qr_code_page/qr_code_page_widget.dart index 3d37a4c5..063d0fd1 100644 --- a/lib/pages/qr_code_page/qr_code_page_widget.dart +++ b/lib/pages/qr_code_page/qr_code_page_widget.dart @@ -76,9 +76,7 @@ class _QrCodePageWidgetState extends State @override Widget build(BuildContext context) { return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => FocusScope.of(context).unfocus(), child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, @@ -187,11 +185,8 @@ class _QrCodePageWidgetState extends State context: context, builder: (context) { return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => + FocusScope.of(context).unfocus(), child: Padding( padding: MediaQuery.viewInsetsOf(context), diff --git a/lib/pages/register_visitor_page/register_visitor_page_model.dart b/lib/pages/register_visitor_page/register_visitor_page_model.dart index 08de852d..708ada17 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_model.dart +++ b/lib/pages/register_visitor_page/register_visitor_page_model.dart @@ -8,7 +8,6 @@ class RegisterVisitorPageModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. - final unfocusNode = FocusNode(); bool isDataUploading = false; FFUploadedFile uploadedLocalFile = FFUploadedFile(bytes: Uint8List.fromList([])); @@ -42,7 +41,6 @@ class RegisterVisitorPageModel @override void dispose() { - unfocusNode.dispose(); textFieldFocusNode1?.dispose(); textController1?.dispose(); diff --git a/lib/pages/register_visitor_page/register_visitor_page_widget.dart b/lib/pages/register_visitor_page/register_visitor_page_widget.dart index 6f9e7722..2d149f2b 100644 --- a/lib/pages/register_visitor_page/register_visitor_page_widget.dart +++ b/lib/pages/register_visitor_page/register_visitor_page_widget.dart @@ -57,9 +57,7 @@ class _RegisterVisitorPageWidgetState extends State { context.watch(); return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => FocusScope.of(context).unfocus(), child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, @@ -794,11 +792,8 @@ class _RegisterVisitorPageWidgetState extends State { context: context, builder: (context) { return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => + FocusScope.of(context).unfocus(), child: Padding( padding: MediaQuery.viewInsetsOf(context), @@ -822,11 +817,8 @@ class _RegisterVisitorPageWidgetState extends State { context: context, builder: (context) { return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => + FocusScope.of(context).unfocus(), child: Padding( padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget( diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart index c9e5c9c0..8008b26c 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart @@ -25,7 +25,6 @@ class ScheduleCompleteVisitPageModel /// State fields for stateful widgets in this page. - final unfocusNode = FocusNode(); // State field(s) for TabBar widget. TabController? tabBarController; int get tabBarCurrentIndex => @@ -76,7 +75,6 @@ class ScheduleCompleteVisitPageModel @override void dispose() { - unfocusNode.dispose(); tabBarController?.dispose(); textFieldFocusNode1?.dispose(); textController1?.dispose(); 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 8643f7c6..01b802f0 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 @@ -110,9 +110,7 @@ class _ScheduleCompleteVisitPageWidgetState context.watch(); return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => FocusScope.of(context).unfocus(), child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, @@ -294,15 +292,8 @@ class _ScheduleCompleteVisitPageWidgetState context: context, builder: (context) { return GestureDetector( - onTap: () => _model - .unfocusNode - .canRequestFocus - ? FocusScope.of( - context) - .requestFocus( - _model - .unfocusNode) - : FocusScope.of( + onTap: () => + FocusScope.of( context) .unfocus(), child: Padding( @@ -449,15 +440,8 @@ class _ScheduleCompleteVisitPageWidgetState context: context, builder: (context) { return GestureDetector( - onTap: () => _model - .unfocusNode - .canRequestFocus - ? FocusScope.of( - context) - .requestFocus( - _model - .unfocusNode) - : FocusScope.of( + onTap: () => + FocusScope.of( context) .unfocus(), child: Padding( @@ -965,7 +949,7 @@ class _ScheduleCompleteVisitPageWidgetState _model.textController1 ?.text = dateTimeFormat( - 'd/M/y H:mm:ss', + "d/M/y H:mm:ss", _model .datePicked1, locale: FFLocalizations.of( @@ -1320,7 +1304,7 @@ class _ScheduleCompleteVisitPageWidgetState _model.textController2 ?.text = dateTimeFormat( - 'd/M/y H:mm:ss', + "d/M/y H:mm:ss", _model .datePicked2, locale: FFLocalizations.of( @@ -2001,11 +1985,8 @@ class _ScheduleCompleteVisitPageWidgetState context: context, builder: (context) { return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => + FocusScope.of(context).unfocus(), child: Padding( padding: MediaQuery.viewInsetsOf(context), @@ -2041,11 +2022,8 @@ class _ScheduleCompleteVisitPageWidgetState context: context, builder: (context) { return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => + FocusScope.of(context).unfocus(), child: Padding( padding: MediaQuery.viewInsetsOf(context), @@ -2174,13 +2152,8 @@ class _ScheduleCompleteVisitPageWidgetState context: context, builder: (context) { return GestureDetector( - onTap: () => _model - .unfocusNode - .canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model - .unfocusNode) - : FocusScope.of(context) + onTap: () => + FocusScope.of(context) .unfocus(), child: Padding( padding: diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart index 6166e387..36b816b6 100644 --- a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart +++ b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart @@ -29,36 +29,76 @@ class ScheduleProvisionalVisitPageModel /// State fields for stateful widgets in this page. - final unfocusNode = FocusNode(); - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode1; - TextEditingController? textController1; - String? Function(BuildContext, String?)? textController1Validator; + final formKey = GlobalKey(); + // State field(s) for personName widget. + FocusNode? personNameFocusNode; + TextEditingController? personNameTextController; + String? Function(BuildContext, String?)? personNameTextControllerValidator; + String? _personNameTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '3hqg8buh' /* Nome é Obrigatório */, + ); + } + + if (val.length > 80) { + return FFLocalizations.of(context).getText( + 'l0b0zr50' /* Máximo 80 caracteres */, + ); + } + + return null; + } + + // State field(s) for dateTime widget. + FocusNode? dateTimeFocusNode; + TextEditingController? dateTimeTextController; + String? Function(BuildContext, String?)? dateTimeTextControllerValidator; + String? _dateTimeTextControllerValidator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + 'uzefkuf9' /* Data / Hora é Obrigatório */, + ); + } + + return null; + } + DateTime? datePicked; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode2; - TextEditingController? textController2; - String? Function(BuildContext, String?)? textController2Validator; - // State field(s) for TextField widget. - FocusNode? textFieldFocusNode3; - TextEditingController? textController3; - String? Function(BuildContext, String?)? textController3Validator; - // Stores action output result for [Backend Call - API (postProvVisitScheduling)] action in sendContainer widget. - ApiCallResponse? provisionalVisitScheduling; + // State field(s) for notes widget. + FocusNode? notesFocusNode; + TextEditingController? notesTextController; + String? Function(BuildContext, String?)? notesTextControllerValidator; + String? _notesTextControllerValidator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + 'j14it3wp' /* Field is required */, + ); + } + + return null; + } + + // Stores action output result for [Backend Call - API (postProvVisitScheduling)] action in btnSend widget. + ApiCallResponse? provVisitSchedule; @override - void initState(BuildContext context) {} + void initState(BuildContext context) { + personNameTextControllerValidator = _personNameTextControllerValidator; + dateTimeTextControllerValidator = _dateTimeTextControllerValidator; + notesTextControllerValidator = _notesTextControllerValidator; + } @override void dispose() { - unfocusNode.dispose(); - textFieldFocusNode1?.dispose(); - textController1?.dispose(); + personNameFocusNode?.dispose(); + personNameTextController?.dispose(); - textFieldFocusNode2?.dispose(); - textController2?.dispose(); + dateTimeFocusNode?.dispose(); + dateTimeTextController?.dispose(); - textFieldFocusNode3?.dispose(); - textController3?.dispose(); + notesFocusNode?.dispose(); + notesTextController?.dispose(); } } diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart index b8528fa3..6cdf7977 100644 --- a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart +++ b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart @@ -1,12 +1,13 @@ import '/backend/api_requests/api_calls.dart'; import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; -import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import '/flutter_flow/flutter_flow_widgets.dart'; import 'package:cached_network_image/cached_network_image.dart'; +import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; import 'schedule_provisional_visit_page_model.dart'; @@ -31,14 +32,14 @@ class _ScheduleProvisionalVisitPageWidgetState super.initState(); _model = createModel(context, () => ScheduleProvisionalVisitPageModel()); - _model.textController1 ??= TextEditingController(); - _model.textFieldFocusNode1 ??= FocusNode(); + _model.personNameTextController ??= TextEditingController(); + _model.personNameFocusNode ??= FocusNode(); - _model.textController2 ??= TextEditingController(); - _model.textFieldFocusNode2 ??= FocusNode(); + _model.dateTimeTextController ??= TextEditingController(); + _model.dateTimeFocusNode ??= FocusNode(); - _model.textController3 ??= TextEditingController(); - _model.textFieldFocusNode3 ??= FocusNode(); + _model.notesTextController ??= TextEditingController(); + _model.notesFocusNode ??= FocusNode(); } @override @@ -53,9 +54,7 @@ class _ScheduleProvisionalVisitPageWidgetState context.watch(); return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => FocusScope.of(context).unfocus(), child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, @@ -100,389 +99,57 @@ class _ScheduleProvisionalVisitPageWidgetState mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container( - decoration: const BoxDecoration(), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 30.0), - child: Text( - FFLocalizations.of(context).getText( - 'x7at46ur' /* Quais visitantes você deseja c... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), + Form( + key: _model.formKey, + autovalidateMode: AutovalidateMode.always, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 24.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + 'uj8acuab' /* Preencha os Campos Abaixo: */, ), - Stack( - children: [ - FFButtonWidget( - onPressed: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model - .unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus( - _model.unfocusNode) - : FocusScope.of(context) - .unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf( - context), - child: - const BottomArrowLinkedLocalsComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - text: FFAppState().local, - options: FFButtonOptions( - width: 320.0, - height: 51.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: - FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primaryText, - width: 0.3, - ), - borderRadius: BorderRadius.circular(24.0), - ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 10.0, 0.0, 0.0), - child: Container( - width: 35.0, - height: 35.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 100), - fadeOutDuration: - const Duration(milliseconds: 100), - imageUrl: valueOrDefault( - 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - ), - fit: BoxFit.cover, - ), - ), - ), - ], - ), - ].addToEnd(const SizedBox(height: 20.0)), + ), ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'shj19b2o' /* Qual o período de validade da ... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Stack( - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 50.0, 24.0, 0.0), - child: TextFormField( - controller: _model.textController1, - focusNode: _model.textFieldFocusNode1, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: - FFLocalizations.of(context).getText( - '8zgsw5so' /* Ínicio da Visita */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - 'p16wm7kp' /* Quando a visitas se inicia? */, - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(8.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: FlutterFlowTheme.of(context) - .accent1, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.center, - validator: _model.textController1Validator - .asValidator(context), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 50.0, 24.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - final datePickedDate = - await showDatePicker( - context: context, - initialDate: getCurrentTimestamp, - firstDate: DateTime(1900), - lastDate: DateTime(2050), - builder: (context, child) { - return wrapInMaterialDatePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of(context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of(context) - .info, - headerTextStyle: - FlutterFlowTheme.of(context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: 0.0, - fontWeight: - FontWeight.w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of(context) - .secondaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of(context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of(context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of(context) - .info, - actionButtonForegroundColor: - FlutterFlowTheme.of(context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - - if (datePickedDate != null) { - safeSetState(() { - _model.datePicked = DateTime( - datePickedDate.year, - datePickedDate.month, - datePickedDate.day, - ); - }); - } - setState(() { - _model.textController1?.text = - dateTimeFormat( - 'd/M/y', - _model.datePicked, - locale: FFLocalizations.of(context) - .languageCode, - ); - _model.textController1?.selection = - TextSelection.collapsed( - offset: _model - .textController1! - .text - .length); - }); - }, - child: Container( - width: double.infinity, - height: 50.0, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(8.0), - ), - ), - ), - ), - ], - ), - ], + ), + Container( + width: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .secondaryBackground, ), - Column( + child: Column( mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Align( alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 30.0), + 24.0, 0.0, 0.0, 0.0), child: Text( FFLocalizations.of(context).getText( - '3zfd7uf9' /* Qual o nome do visitante? */, + '8d3679lf' /* Propriedade */, ), - textAlign: TextAlign.start, style: FlutterFlowTheme.of(context) .bodyMedium .override( @@ -490,161 +157,6 @@ class _ScheduleProvisionalVisitPageWidgetState FlutterFlowTheme.of(context) .bodyMediumFamily, letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Container( - height: 93.0, - decoration: const BoxDecoration(), - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 20.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model.textController2, - focusNode: _model.textFieldFocusNode2, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: - FFLocalizations.of(context).getText( - 'wehvxbz4' /* Nome do Visitante */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - 'juh7f24w' /* Escreva o nome do visitante aq... */, - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: - FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.person, - color: FlutterFlowTheme.of(context) - .accent1, - ), - ), - 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), - ), - textAlign: TextAlign.start, - maxLines: null, - validator: _model.textController2Validator - .asValidator(context), - ), - ), - ), - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 30.0), - child: Text( - FFLocalizations.of(context).getText( - 'jhss056s' /* Você tem alguma observação sob... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, useGoogleFonts: GoogleFonts.asMap() .containsKey( FlutterFlowTheme.of(context) @@ -655,200 +167,781 @@ class _ScheduleProvisionalVisitPageWidgetState ), Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 20.0), - child: SizedBox( + 24.0, 10.0, 24.0, 10.0), + child: Container( width: double.infinity, - child: TextFormField( - controller: _model.textController3, - focusNode: _model.textFieldFocusNode3, - autofocus: false, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: - FFLocalizations.of(context).getText( - 'cw8b3tbb' /* Observações da Visita */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - 'k4qkbv1f' /* Escreva as suas observações aq... */, - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.text_fields, - color: FlutterFlowTheme.of(context) - .accent1, - ), + height: 50.0, + decoration: BoxDecoration( + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(50.0), + bottomRight: Radius.circular(50.0), + topLeft: Radius.circular(50.0), + topRight: Radius.circular(50.0), ), - 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), + border: Border.all( + color: FlutterFlowTheme.of(context) + .customColor5, + ), + ), + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + ClipRRect( + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(50.0), + bottomRight: Radius.circular(50.0), + topLeft: Radius.circular(50.0), + topRight: Radius.circular(50.0), + ), + child: CachedNetworkImage( + fadeInDuration: + const Duration(milliseconds: 200), + fadeOutDuration: + const Duration(milliseconds: 200), + imageUrl: + 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', + width: 35.0, + height: 35.0, + fit: BoxFit.contain, + memCacheWidth: 35, + memCacheHeight: 35, + ), ), - textAlign: TextAlign.start, - maxLines: null, - maxLength: 100, - validator: _model.textController3Validator - .asValidator(context), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 15.0, 0.0, 0.0, 0.0), + child: Text( + FFAppState().local, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ), + ], + ), ), ), ), ], ), - ], - ), - ), - ), - InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - _model.provisionalVisitScheduling = - await PhpGroup.postProvVisitSchedulingCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'putAgendamentoProv', - data: _model.textController1.text, - motivo: _model.textController3.text, - nome: _model.textController2.text, - proID: FFAppState().ownerUUID, - ); - - if (PhpGroup.postProvVisitSchedulingCall.error( - (_model.provisionalVisitScheduling?.jsonBody ?? ''), - ) == - false) { - setState(() { - _model.textController1?.clear(); - _model.textController2?.clear(); - _model.textController3?.clear(); - }); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup.postProvVisitSchedulingCall.msg( - (_model.provisionalVisitScheduling - ?.jsonBody ?? - ''), - )!, + ), + Container( + decoration: const BoxDecoration(), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'z6aawgqa' /* Dados da Visita */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Container( + height: 80.0, + decoration: const BoxDecoration(), + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: + _model.personNameTextController, + focusNode: + _model.personNameFocusNode, + onChanged: (_) => + EasyDebounce.debounce( + '_model.personNameTextController', + const Duration(milliseconds: 500), + () => setState(() {}), + ), + autofocus: false, + textInputAction: + TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: false, + labelText: + FFLocalizations.of(context) + .getText( + 'wehvxbz4' /* Nome / Apelido do Visitante */, + ), + hintStyle: + FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .labelMediumFamily, + color: + FlutterFlowTheme.of( + context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( + context) + .customColor5, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( + context) + .primary, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( + context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(10.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( + context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.person, + color: + FlutterFlowTheme.of(context) + .accent1, + ), + ), + 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), + ), + textAlign: TextAlign.start, + maxLines: null, + validator: _model + .personNameTextControllerValidator + .asValidator(context), + ), + ), + ), + ), + ], + ), + Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 80.0, + child: Stack( + alignment: + const AlignmentDirectional(0.0, 0.0), + children: [ + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: + _model.dateTimeTextController, + focusNode: + _model.dateTimeFocusNode, + onChanged: (_) => + EasyDebounce.debounce( + '_model.dateTimeTextController', + const Duration(milliseconds: 500), + () => setState(() {}), + ), + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: false, + labelText: + FFLocalizations.of(context) + .getText( + '8zgsw5so' /* Data / Hora Limite da Visita */, + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( + context) + .customColor5, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 8.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( + context) + .primary, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( + context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 8.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( + context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 8.0), + ), + suffixIcon: Icon( + Icons.date_range, + color: FlutterFlowTheme.of( + context) + .accent1, + ), + ), + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + textAlign: TextAlign.center, + validator: _model + .dateTimeTextControllerValidator + .asValidator(context), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: + Colors.transparent, + onTap: () async { + final datePickedDate = + await showDatePicker( + context: context, + initialDate: + getCurrentTimestamp, + firstDate: + (getCurrentTimestamp ?? + DateTime(1900)), + lastDate: DateTime(2050), + builder: (context, child) { + return wrapInMaterialDatePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of( + context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of( + context) + .info, + headerTextStyle: + FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: FlutterFlowTheme.of( + context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of(context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of( + context) + .secondaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of( + context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of( + context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of( + context) + .info, + actionButtonForegroundColor: + FlutterFlowTheme.of( + context) + .primaryText, + iconSize: 24.0, + ); + }, + ); - setState(() {}); - }, - child: Container( - width: 100.0, - height: 40.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primary, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), + TimeOfDay? datePickedTime; + if (datePickedDate != null) { + datePickedTime = + await showTimePicker( + context: context, + initialTime: + TimeOfDay.fromDateTime( + getCurrentTimestamp), + builder: (context, child) { + return wrapInMaterialTimePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of( + context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of( + context) + .info, + headerTextStyle: + FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: FlutterFlowTheme.of( + context) + .headlineLargeFamily, + fontSize: + 32.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of(context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of( + context) + .secondaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of( + context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of( + context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of( + context) + .info, + actionButtonForegroundColor: + FlutterFlowTheme.of( + context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + } + + if (datePickedDate != null && + datePickedTime != null) { + safeSetState(() { + _model.datePicked = + DateTime( + datePickedDate.year, + datePickedDate.month, + datePickedDate.day, + datePickedTime!.hour, + datePickedTime.minute, + ); + }); + } + setState(() { + _model.dateTimeTextController + ?.text = dateTimeFormat( + "dd/MM/yyyy HH:mm:ss", + _model.datePicked, + locale: FFLocalizations.of( + context) + .languageCode, + ); + _model.dateTimeTextController + ?.selection = + TextSelection.collapsed( + offset: _model + .dateTimeTextController! + .text + .length); + }); + }, + child: Container( + width: double.infinity, + height: 50.0, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular( + 8.0), + ), + alignment: const AlignmentDirectional( + 0.0, 0.0), + ), + ), + ), + ], + ), + ), + ], + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Container( + height: 80.0, + decoration: const BoxDecoration(), + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: + _model.notesTextController, + focusNode: + _model.notesFocusNode, + autofocus: false, + textInputAction: + TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: false, + labelText: FFLocalizations.of( + context) + .getText( + 'cw8b3tbb' /* Observação da Visita */, + ), + hintStyle: FlutterFlowTheme + .of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .labelMediumFamily, + color: + FlutterFlowTheme.of( + context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .labelMediumFamily), + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .customColor5, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 10.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .primary, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 10.0), + ), + errorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 10.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 10.0), + ), + suffixIcon: Icon( + Icons.text_fields, + color: FlutterFlowTheme.of( + context) + .accent1, + ), + ), + 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), + ), + textAlign: TextAlign.start, + maxLines: null, + maxLength: 100, + maxLengthEnforcement: + MaxLengthEnforcement + .enforced, + validator: _model + .notesTextControllerValidator + .asValidator(context), + ), + ), + ), + ), + ), + ), + ], + ), + ], + ), + ), ), - ), - alignment: const AlignmentDirectional(0.0, 1.0), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Icon( - Icons.save_alt, - color: FlutterFlowTheme.of(context).info, - size: 24.0, + FFButtonWidget( + onPressed: () async { + _model.provVisitSchedule = + await PhpGroup.postProvVisitSchedulingCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'putAgendamentoProv', + data: _model.dateTimeTextController.text, + motivo: _model.notesTextController.text, + nome: _model.personNameTextController.text, + proID: FFAppState().ownerUUID, + ); + + if (PhpGroup.postProvVisitSchedulingCall.error( + (_model.provVisitSchedule?.jsonBody ?? ''), + ) == + false) { + setState(() { + _model.dateTimeTextController?.clear(); + _model.personNameTextController?.clear(); + _model.notesTextController?.clear(); + }); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => + FocusScope.of(context).unfocus(), + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: ThrowExceptionWidget( + msg: PhpGroup + .postProvVisitSchedulingCall + .msg( + (_model.provVisitSchedule?.jsonBody ?? + ''), + )!, + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + } + + setState(() {}); + }, + text: FFLocalizations.of(context).getText( + 'bv5fg9sv' /* Enviar */, + ), + options: FFButtonOptions( + height: 40.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context).primary, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .titleSmallFamily, + color: Colors.white, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .titleSmallFamily), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: BorderRadius.circular(8.0), + ), ), - ), + ], ), ), ], diff --git a/lib/pages/sign_in_page/sign_in_page_model.dart b/lib/pages/sign_in_page/sign_in_page_model.dart index e8b945bd..b80163a2 100644 --- a/lib/pages/sign_in_page/sign_in_page_model.dart +++ b/lib/pages/sign_in_page/sign_in_page_model.dart @@ -6,7 +6,6 @@ import 'package:flutter/material.dart'; class SignInPageModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. - final unfocusNode = FocusNode(); // Model for signInTemplateComponent component. late SignInTemplateComponentModel signInTemplateComponentModel; @@ -18,7 +17,6 @@ class SignInPageModel extends FlutterFlowModel { @override void dispose() { - unfocusNode.dispose(); signInTemplateComponentModel.dispose(); } } diff --git a/lib/pages/sign_in_page/sign_in_page_widget.dart b/lib/pages/sign_in_page/sign_in_page_widget.dart index da1727c7..dcfe3ba9 100644 --- a/lib/pages/sign_in_page/sign_in_page_widget.dart +++ b/lib/pages/sign_in_page/sign_in_page_widget.dart @@ -34,9 +34,7 @@ class _SignInPageWidgetState extends State { @override Widget build(BuildContext context) { return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => FocusScope.of(context).unfocus(), child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, diff --git a/lib/pages/sign_up_page/sign_up_page_model.dart b/lib/pages/sign_up_page/sign_up_page_model.dart index 938a3b46..9c46f506 100644 --- a/lib/pages/sign_up_page/sign_up_page_model.dart +++ b/lib/pages/sign_up_page/sign_up_page_model.dart @@ -6,7 +6,6 @@ import 'package:flutter/material.dart'; class SignUpPageModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. - final unfocusNode = FocusNode(); // Model for signUpTemplateComponent component. late SignUpTemplateComponentModel signUpTemplateComponentModel; @@ -18,7 +17,6 @@ class SignUpPageModel extends FlutterFlowModel { @override void dispose() { - unfocusNode.dispose(); signUpTemplateComponentModel.dispose(); } } diff --git a/lib/pages/sign_up_page/sign_up_page_widget.dart b/lib/pages/sign_up_page/sign_up_page_widget.dart index 18c575ec..4a57767c 100644 --- a/lib/pages/sign_up_page/sign_up_page_widget.dart +++ b/lib/pages/sign_up_page/sign_up_page_widget.dart @@ -34,9 +34,7 @@ class _SignUpPageWidgetState extends State { @override Widget build(BuildContext context) { return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => FocusScope.of(context).unfocus(), child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, diff --git a/lib/pages/welcome_page/welcome_page_model.dart b/lib/pages/welcome_page/welcome_page_model.dart index b8a54a7e..253632a5 100644 --- a/lib/pages/welcome_page/welcome_page_model.dart +++ b/lib/pages/welcome_page/welcome_page_model.dart @@ -10,7 +10,6 @@ class WelcomePageModel extends FlutterFlowModel { /// State fields for stateful widgets in this page. - final unfocusNode = FocusNode(); // Model for welcomeTemplateComponent component. late WelcomeTemplateComponentModel welcomeTemplateComponentModel; @@ -22,7 +21,6 @@ class WelcomePageModel extends FlutterFlowModel { @override void dispose() { - unfocusNode.dispose(); welcomeTemplateComponentModel.dispose(); } } diff --git a/lib/pages/welcome_page/welcome_page_widget.dart b/lib/pages/welcome_page/welcome_page_widget.dart index 6089703a..8ad35bfb 100644 --- a/lib/pages/welcome_page/welcome_page_widget.dart +++ b/lib/pages/welcome_page/welcome_page_widget.dart @@ -52,9 +52,7 @@ class _WelcomePageWidgetState extends State { context.watch(); return GestureDetector( - onTap: () => _model.unfocusNode.canRequestFocus - ? FocusScope.of(context).requestFocus(_model.unfocusNode) - : FocusScope.of(context).unfocus(), + onTap: () => FocusScope.of(context).unfocus(), child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, From 3862671e82cd572ab51dc3002d8fa40887966739 Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:23:49 +0000 Subject: [PATCH 05/14] fix: Cores da Labels Visita Prov --- ios/Runner.xcodeproj/project.pbxproj | 8 +- lib/flutter_flow/internationalization.dart | 2 +- ...schedule_provisional_visit_page_model.dart | 11 - ...chedule_provisional_visit_page_widget.dart | 1441 +++++++++-------- 4 files changed, 769 insertions(+), 693 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 46c8eb1b..210068af 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -44,8 +44,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6436409627A31CDB00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409827A31CDD00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409727A31CD700820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409927A31CD900820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -225,8 +225,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 6436409627A31CDB00820AF7 /* pt */, - 6436409827A31CDD00820AF7 /* en */, + 6436409727A31CD700820AF7 /* pt */, + 6436409927A31CD900820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index d73b4530..8baf5051 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -326,7 +326,7 @@ final kTranslationsMap = >>[ }, '8d3679lf': { 'pt': 'Propriedade', - 'en': '', + 'en': 'Property', }, 'z6aawgqa': { 'pt': 'Dados da Visita', diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart index 36b816b6..91213bf1 100644 --- a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart +++ b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_model.dart @@ -70,16 +70,6 @@ class ScheduleProvisionalVisitPageModel FocusNode? notesFocusNode; TextEditingController? notesTextController; String? Function(BuildContext, String?)? notesTextControllerValidator; - String? _notesTextControllerValidator(BuildContext context, String? val) { - if (val == null || val.isEmpty) { - return FFLocalizations.of(context).getText( - 'j14it3wp' /* Field is required */, - ); - } - - return null; - } - // Stores action output result for [Backend Call - API (postProvVisitScheduling)] action in btnSend widget. ApiCallResponse? provVisitSchedule; @@ -87,7 +77,6 @@ class ScheduleProvisionalVisitPageModel void initState(BuildContext context) { personNameTextControllerValidator = _personNameTextControllerValidator; dateTimeTextControllerValidator = _dateTimeTextControllerValidator; - notesTextControllerValidator = _notesTextControllerValidator; } @override diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart index 6cdf7977..bd8805b0 100644 --- a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart +++ b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart @@ -102,152 +102,45 @@ class _ScheduleProvisionalVisitPageWidgetState Form( key: _model.formKey, autovalidateMode: AutovalidateMode.always, - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - 'uj8acuab' /* Preencha os Campos Abaixo: */, + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 24.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + 'uj8acuab' /* Preencha os Campos Abaixo: */, + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), ), ), - ), - Container( - width: double.infinity, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .secondaryBackground, - ), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - '8d3679lf' /* Propriedade */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 10.0, 24.0, 10.0), - child: Container( - width: double.infinity, - height: 50.0, - decoration: BoxDecoration( - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(50.0), - bottomRight: Radius.circular(50.0), - topLeft: Radius.circular(50.0), - topRight: Radius.circular(50.0), - ), - border: Border.all( - color: FlutterFlowTheme.of(context) - .customColor5, - ), - ), - child: Padding( - padding: const EdgeInsets.all(5.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - ClipRRect( - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(50.0), - bottomRight: Radius.circular(50.0), - topLeft: Radius.circular(50.0), - topRight: Radius.circular(50.0), - ), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 200), - fadeOutDuration: - const Duration(milliseconds: 200), - imageUrl: - 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', - width: 35.0, - height: 35.0, - fit: BoxFit.contain, - memCacheWidth: 35, - memCacheHeight: 35, - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 15.0, 0.0, 0.0, 0.0), - child: Text( - FFAppState().local, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), - ), - ), - ], - ), - ), - ), - ), - ], - ), - ), - Container( - decoration: const BoxDecoration(), - child: SingleChildScrollView( + Container( + width: double.infinity, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .secondaryBackground, + ), child: Column( mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Align( alignment: const AlignmentDirectional(-1.0, 0.0), @@ -256,7 +149,7 @@ class _ScheduleProvisionalVisitPageWidgetState 24.0, 0.0, 0.0, 0.0), child: Text( FFLocalizations.of(context).getText( - 'z6aawgqa' /* Dados da Visita */, + '8d3679lf' /* Propriedade */, ), style: FlutterFlowTheme.of(context) .bodyMedium @@ -273,225 +166,59 @@ class _ScheduleProvisionalVisitPageWidgetState ), ), ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Container( - height: 80.0, - decoration: const BoxDecoration(), - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: - _model.personNameTextController, - focusNode: - _model.personNameFocusNode, - onChanged: (_) => - EasyDebounce.debounce( - '_model.personNameTextController', - const Duration(milliseconds: 500), - () => setState(() {}), - ), - autofocus: false, - textInputAction: - TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: false, - labelText: - FFLocalizations.of(context) - .getText( - 'wehvxbz4' /* Nome / Apelido do Visitante */, - ), - hintStyle: - FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .labelMediumFamily, - color: - FlutterFlowTheme.of( - context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .customColor5, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(10.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.person, - color: - FlutterFlowTheme.of(context) - .accent1, - ), - ), - 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), - ), - textAlign: TextAlign.start, - maxLines: null, - validator: _model - .personNameTextControllerValidator - .asValidator(context), - ), - ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 10.0, 24.0, 10.0), + child: Container( + width: double.infinity, + height: 50.0, + decoration: BoxDecoration( + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(50.0), + bottomRight: Radius.circular(50.0), + topLeft: Radius.circular(50.0), + topRight: Radius.circular(50.0), + ), + border: Border.all( + color: FlutterFlowTheme.of(context) + .customColor5, ), ), - ], - ), - Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 80.0, - child: Stack( - alignment: - const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.start, children: [ + ClipRRect( + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(50.0), + bottomRight: + Radius.circular(50.0), + topLeft: Radius.circular(50.0), + topRight: Radius.circular(50.0), + ), + child: CachedNetworkImage( + fadeInDuration: + const Duration(milliseconds: 200), + fadeOutDuration: + const Duration(milliseconds: 200), + imageUrl: + 'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png', + width: 35.0, + height: 35.0, + fit: BoxFit.contain, + memCacheWidth: 35, + memCacheHeight: 35, + ), + ), Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: - _model.dateTimeTextController, - focusNode: - _model.dateTimeFocusNode, - onChanged: (_) => - EasyDebounce.debounce( - '_model.dateTimeTextController', - const Duration(milliseconds: 500), - () => setState(() {}), - ), - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: false, - labelText: - FFLocalizations.of(context) - .getText( - '8zgsw5so' /* Data / Hora Limite da Visita */, - ), - enabledBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .customColor5, - width: 0.5, - ), - borderRadius: - BorderRadius.circular( - 8.0), - ), - focusedBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular( - 8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular( - 8.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular( - 8.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: FlutterFlowTheme.of( - context) - .accent1, - ), - ), + 15.0, 0.0, 0.0, 0.0), + child: Text( + FFAppState().local, style: FlutterFlowTheme.of(context) .bodyMedium @@ -508,99 +235,363 @@ class _ScheduleProvisionalVisitPageWidgetState context) .bodyMediumFamily), ), - textAlign: TextAlign.center, + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + Container( + decoration: const BoxDecoration(), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'z6aawgqa' /* Dados da Visita */, + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), + ), + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Container( + height: 80.0, + decoration: const BoxDecoration(), + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model + .personNameTextController, + focusNode: + _model.personNameFocusNode, + onChanged: (_) => + EasyDebounce.debounce( + '_model.personNameTextController', + const Duration(milliseconds: 500), + () => setState(() {}), + ), + autofocus: false, + textInputAction: + TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: false, + labelText: + FFLocalizations.of(context) + .getText( + 'wehvxbz4' /* Nome / Apelido do Visitante */, + ), + labelStyle: + 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), + ), + hintStyle: + FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .labelMediumFamily, + color: FlutterFlowTheme + .of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .labelMediumFamily), + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( + context) + .customColor5, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 10.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( + context) + .primary, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( + context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 10.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( + context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 10.0), + ), + suffixIcon: Icon( + Icons.person, + color: FlutterFlowTheme.of( + context) + .accent1, + ), + ), + 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), + ), + textAlign: TextAlign.start, + maxLines: null, validator: _model - .dateTimeTextControllerValidator + .personNameTextControllerValidator .asValidator(context), ), ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: - Colors.transparent, - onTap: () async { - final datePickedDate = - await showDatePicker( - context: context, - initialDate: - getCurrentTimestamp, - firstDate: - (getCurrentTimestamp ?? - DateTime(1900)), - lastDate: DateTime(2050), - builder: (context, child) { - return wrapInMaterialDatePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of( - context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of( - context) - .info, - headerTextStyle: - FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: FlutterFlowTheme.of( + ), + ), + ], + ), + Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 80.0, + child: Stack( + alignment: + const AlignmentDirectional(0.0, 0.0), + children: [ + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: _model + .dateTimeTextController, + focusNode: + _model.dateTimeFocusNode, + onChanged: (_) => + EasyDebounce.debounce( + '_model.dateTimeTextController', + const Duration(milliseconds: 500), + () => setState(() {}), + ), + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: false, + labelText: FFLocalizations.of( + context) + .getText( + '8zgsw5so' /* Data / Hora Limite da Visita */, + ), + labelStyle: + FlutterFlowTheme.of( + context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: - 0.0, - fontWeight: - FontWeight - .w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of(context) - .headlineLargeFamily), - ), - pickerBackgroundColor: + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( context) - .secondaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of( - context) - .primaryText, - selectedDateTimeBackgroundColor: + .customColor5, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 8.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( context) .primary, - selectedDateTimeForegroundColor: + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 8.0), + ), + errorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( context) - .info, - actionButtonForegroundColor: + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 8.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of( context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - - TimeOfDay? datePickedTime; - if (datePickedDate != null) { - datePickedTime = - await showTimePicker( + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 8.0), + ), + suffixIcon: Icon( + Icons.date_range, + color: FlutterFlowTheme.of( + context) + .accent1, + ), + ), + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + textAlign: TextAlign.start, + validator: _model + .dateTimeTextControllerValidator + .asValidator(context), + ), + ), + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: + Colors.transparent, + onTap: () async { + final datePickedDate = + await showDatePicker( context: context, - initialTime: - TimeOfDay.fromDateTime( - getCurrentTimestamp), + initialDate: + getCurrentTimestamp, + firstDate: + (getCurrentTimestamp ?? + DateTime(1900)), + lastDate: DateTime(2050), builder: (context, child) { - return wrapInMaterialTimePickerTheme( + return wrapInMaterialDatePickerTheme( context, child!, headerBackgroundColor: @@ -656,173 +647,165 @@ class _ScheduleProvisionalVisitPageWidgetState ); }, ); - } - if (datePickedDate != null && - datePickedTime != null) { - safeSetState(() { - _model.datePicked = - DateTime( - datePickedDate.year, - datePickedDate.month, - datePickedDate.day, - datePickedTime!.hour, - datePickedTime.minute, + TimeOfDay? datePickedTime; + if (datePickedDate != null) { + datePickedTime = + await showTimePicker( + context: context, + initialTime: TimeOfDay + .fromDateTime( + getCurrentTimestamp), + builder: + (context, child) { + return wrapInMaterialTimePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of( + context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of( + context) + .info, + headerTextStyle: + FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: + FlutterFlowTheme.of(context) + .headlineLargeFamily, + fontSize: + 32.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of(context).headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of( + context) + .secondaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of( + context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of( + context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of( + context) + .info, + actionButtonForegroundColor: + FlutterFlowTheme.of( + context) + .primaryText, + iconSize: 24.0, + ); + }, ); + } + + if (datePickedDate != null && + datePickedTime != null) { + safeSetState(() { + _model.datePicked = + DateTime( + datePickedDate.year, + datePickedDate.month, + datePickedDate.day, + datePickedTime!.hour, + datePickedTime.minute, + ); + }); + } + setState(() { + _model + .dateTimeTextController + ?.text = dateTimeFormat( + "dd/MM/yyyy HH:mm:ss", + _model.datePicked, + locale: + FFLocalizations.of( + context) + .languageCode, + ); + _model.dateTimeTextController + ?.selection = + TextSelection.collapsed( + offset: _model + .dateTimeTextController! + .text + .length); }); - } - setState(() { - _model.dateTimeTextController - ?.text = dateTimeFormat( - "dd/MM/yyyy HH:mm:ss", - _model.datePicked, - locale: FFLocalizations.of( - context) - .languageCode, - ); - _model.dateTimeTextController - ?.selection = - TextSelection.collapsed( - offset: _model - .dateTimeTextController! - .text - .length); - }); - }, - child: Container( - width: double.infinity, - height: 50.0, - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular( - 8.0), + }, + child: Container( + width: double.infinity, + height: 50.0, + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular( + 8.0), + ), + alignment: + const AlignmentDirectional( + 0.0, 0.0), ), - alignment: const AlignmentDirectional( - 0.0, 0.0), ), ), - ), - ], + ], + ), ), - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Container( - height: 80.0, - decoration: const BoxDecoration(), + ], + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( alignment: const AlignmentDirectional(0.0, 0.0), - child: Align( + child: Container( + height: 80.0, + decoration: const BoxDecoration(), alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: - _model.notesTextController, - focusNode: - _model.notesFocusNode, - autofocus: false, - textInputAction: - TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: false, - labelText: FFLocalizations.of( - context) - .getText( - 'cw8b3tbb' /* Observação da Visita */, - ), - hintStyle: FlutterFlowTheme - .of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .labelMediumFamily, - color: - FlutterFlowTheme.of( - context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - enabledBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .customColor5, - width: 0.5, + child: Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model + .notesTextController, + focusNode: + _model.notesFocusNode, + autofocus: false, + textInputAction: + TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: false, + labelText: + FFLocalizations.of( + context) + .getText( + 'cw8b3tbb' /* Observação da Visita */, ), - borderRadius: - BorderRadius.circular( - 10.0), - ), - focusedBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular( - 10.0), - ), - errorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular( - 10.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular( - 10.0), - ), - suffixIcon: Icon( - Icons.text_fields, - color: FlutterFlowTheme.of( - context) - .accent1, - ), - ), - style: - FlutterFlowTheme.of(context) + labelStyle: FlutterFlowTheme + .of(context) .bodyMedium .override( fontFamily: @@ -840,108 +823,212 @@ class _ScheduleProvisionalVisitPageWidgetState context) .bodyMediumFamily), ), - textAlign: TextAlign.start, - maxLines: null, - maxLength: 100, - maxLengthEnforcement: - MaxLengthEnforcement - .enforced, - validator: _model - .notesTextControllerValidator - .asValidator(context), + hintStyle: FlutterFlowTheme + .of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .labelMediumFamily, + color: FlutterFlowTheme + .of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .labelMediumFamily), + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .customColor5, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 10.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .primary, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 10.0), + ), + errorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 10.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius.circular( + 10.0), + ), + suffixIcon: Icon( + Icons.text_fields, + color: + FlutterFlowTheme.of( + context) + .accent1, + ), + ), + 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), + ), + textAlign: TextAlign.start, + maxLines: 5, + maxLength: 100, + maxLengthEnforcement: + MaxLengthEnforcement + .enforced, + validator: _model + .notesTextControllerValidator + .asValidator(context), + ), ), ), ), ), ), - ), - ], - ), - ], + ], + ), + ], + ), ), ), - ), - FFButtonWidget( - onPressed: () async { - _model.provVisitSchedule = - await PhpGroup.postProvVisitSchedulingCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'putAgendamentoProv', - data: _model.dateTimeTextController.text, - motivo: _model.notesTextController.text, - nome: _model.personNameTextController.text, - proID: FFAppState().ownerUUID, - ); + FFButtonWidget( + onPressed: () async { + _model.provVisitSchedule = await PhpGroup + .postProvVisitSchedulingCall + .call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'putAgendamentoProv', + data: _model.dateTimeTextController.text, + motivo: _model.notesTextController.text, + nome: _model.personNameTextController.text, + proID: FFAppState().ownerUUID, + ); - if (PhpGroup.postProvVisitSchedulingCall.error( - (_model.provVisitSchedule?.jsonBody ?? ''), - ) == - false) { - setState(() { - _model.dateTimeTextController?.clear(); - _model.personNameTextController?.clear(); - _model.notesTextController?.clear(); - }); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => - FocusScope.of(context).unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup - .postProvVisitSchedulingCall - .msg( - (_model.provVisitSchedule?.jsonBody ?? - ''), - )!, + if (PhpGroup.postProvVisitSchedulingCall.error( + (_model.provVisitSchedule?.jsonBody ?? ''), + ) == + false) { + setState(() { + _model.dateTimeTextController?.clear(); + _model.personNameTextController?.clear(); + _model.notesTextController?.clear(); + }); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => + FocusScope.of(context).unfocus(), + child: Padding( + padding: + MediaQuery.viewInsetsOf(context), + child: ThrowExceptionWidget( + msg: PhpGroup + .postProvVisitSchedulingCall + .msg( + (_model.provVisitSchedule + ?.jsonBody ?? + ''), + )!, + ), ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } + ); + }, + ).then((value) => safeSetState(() {})); + } - setState(() {}); - }, - text: FFLocalizations.of(context).getText( - 'bv5fg9sv' /* Enviar */, - ), - options: FFButtonOptions( - height: 40.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).primary, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .titleSmallFamily, - color: Colors.white, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, + setState(() {}); + }, + text: FFLocalizations.of(context).getText( + 'bv5fg9sv' /* Enviar */, + ), + options: FFButtonOptions( + height: 40.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context).primary, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .titleSmallFamily, + color: Colors.white, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + borderRadius: BorderRadius.circular(8.0), ), - borderRadius: BorderRadius.circular(8.0), ), - ), - ], + ], + ), ), ), ], From 9947e6dc3e37c66ecd2e2d3ca13fbc2d7108d144 Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Thu, 8 Aug 2024 11:24:03 -0300 Subject: [PATCH 06/14] fix: Componente Liberation History --- lib/pages/liberation_history/liberation_history_widget.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index 3627c1b4..098afd5e 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -7,7 +7,7 @@ import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/backend/push_notification/pushNotificationService.dart'; import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; -import 'package:hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart'; +import 'package:hub/components/templates_components/details_component/details_component_widget.dart'; import 'package:hub/flutter_flow/custom_functions.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; @@ -337,7 +337,7 @@ Widget liberationHistoryItemCard( useSafeArea: true, context: context, builder: (context) { - return VisitRequestTemplateComponentWidget( + return DetailsComponentWidget( vteName: liberationHistoryItem['VTE_NOME'], vteReason: liberationHistoryItem['NOT_MOTIVO'], vawDate: liberationHistoryItem['NOT_STATUS'] == 'S' From 07f8dfe1e6291a690185d41763894c010a2e357e Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:32:18 +0000 Subject: [PATCH 07/14] fix: Layout and Validation Visita Prov --- ios/Runner.xcodeproj/project.pbxproj | 8 +- ...chedule_provisional_visit_page_widget.dart | 401 +++++++++--------- 2 files changed, 210 insertions(+), 199 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 210068af..6fd55041 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -44,8 +44,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6436409727A31CD700820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409927A31CD900820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409327A31CD900820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409027A31CD700820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -225,8 +225,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 6436409727A31CD700820AF7 /* pt */, - 6436409927A31CD900820AF7 /* en */, + 6436409327A31CD900820AF7 /* pt */, + 6436409027A31CD700820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart index bd8805b0..d81d91e1 100644 --- a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart +++ b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart @@ -767,45 +767,141 @@ class _ScheduleProvisionalVisitPageWidgetState ), ], ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: - const AlignmentDirectional(0.0, 0.0), - child: Container( - height: 80.0, - decoration: const BoxDecoration(), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 10.0, 0.0, 0.0), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( alignment: const AlignmentDirectional(0.0, 0.0), - child: Align( + child: Container( + decoration: const BoxDecoration(), alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional - .fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .notesTextController, - focusNode: - _model.notesFocusNode, - autofocus: false, - textInputAction: - TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: false, - labelText: - FFLocalizations.of( - context) - .getText( - 'cw8b3tbb' /* Observação da Visita */, + child: Align( + alignment: const AlignmentDirectional( + 0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model + .notesTextController, + focusNode: + _model.notesFocusNode, + autofocus: false, + textInputAction: + TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: false, + labelText: + FFLocalizations.of( + context) + .getText( + 'cw8b3tbb' /* Observação da Visita */, + ), + labelStyle: + 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), + ), + hintStyle: + FlutterFlowTheme.of( + context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of( + context) + .labelMediumFamily, + color: FlutterFlowTheme.of( + context) + .primaryText, + letterSpacing: + 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme + .of(context) + .customColor5, + width: 0.5, + ), + borderRadius: + BorderRadius + .circular(10.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme + .of(context) + .primary, + width: 0.5, + ), + borderRadius: + BorderRadius + .circular(10.0), + ), + errorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme + .of(context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius + .circular(10.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme + .of(context) + .error, + width: 0.5, + ), + borderRadius: + BorderRadius + .circular(10.0), + ), + suffixIcon: Icon( + Icons.text_fields, + color: + FlutterFlowTheme.of( + context) + .accent1, + ), ), - labelStyle: FlutterFlowTheme - .of(context) + style: FlutterFlowTheme.of( + context) .bodyMedium .override( fontFamily: @@ -823,185 +919,97 @@ class _ScheduleProvisionalVisitPageWidgetState context) .bodyMediumFamily), ), - hintStyle: FlutterFlowTheme - .of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .labelMediumFamily, - color: FlutterFlowTheme - .of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .labelMediumFamily), - ), - enabledBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .customColor5, - width: 0.5, - ), - borderRadius: - BorderRadius.circular( - 10.0), - ), - focusedBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .primary, - width: 0.5, - ), - borderRadius: - BorderRadius.circular( - 10.0), - ), - errorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular( - 10.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular( - 10.0), - ), - suffixIcon: Icon( - Icons.text_fields, - color: - FlutterFlowTheme.of( - context) - .accent1, - ), + textAlign: TextAlign.start, + maxLines: 3, + maxLength: 100, + maxLengthEnforcement: + MaxLengthEnforcement + .enforced, + validator: _model + .notesTextControllerValidator + .asValidator(context), ), - 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), - ), - textAlign: TextAlign.start, - maxLines: 5, - maxLength: 100, - maxLengthEnforcement: - MaxLengthEnforcement - .enforced, - validator: _model - .notesTextControllerValidator - .asValidator(context), ), ), ), ), ), - ), - ], + ], + ), ), ], ), ), ), FFButtonWidget( - onPressed: () async { - _model.provVisitSchedule = await PhpGroup - .postProvVisitSchedulingCall - .call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'putAgendamentoProv', - data: _model.dateTimeTextController.text, - motivo: _model.notesTextController.text, - nome: _model.personNameTextController.text, - proID: FFAppState().ownerUUID, - ); - - if (PhpGroup.postProvVisitSchedulingCall.error( - (_model.provVisitSchedule?.jsonBody ?? ''), - ) == - false) { - setState(() { - _model.dateTimeTextController?.clear(); - _model.personNameTextController?.clear(); - _model.notesTextController?.clear(); - }); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => - FocusScope.of(context).unfocus(), - child: Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: ThrowExceptionWidget( - msg: PhpGroup - .postProvVisitSchedulingCall - .msg( - (_model.provVisitSchedule - ?.jsonBody ?? - ''), - )!, - ), - ), + onPressed: ((_model.personNameTextController.text == + '') || + (_model.dateTimeTextController.text == + '')) + ? null + : () async { + _model.provVisitSchedule = await PhpGroup + .postProvVisitSchedulingCall + .call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'putAgendamentoProv', + data: _model.dateTimeTextController.text, + motivo: _model.notesTextController.text, + nome: + _model.personNameTextController.text, + proID: FFAppState().ownerUUID, ); - }, - ).then((value) => safeSetState(() {})); - } - setState(() {}); - }, + if (PhpGroup.postProvVisitSchedulingCall + .error( + (_model.provVisitSchedule?.jsonBody ?? + ''), + ) == + false) { + setState(() { + _model.dateTimeTextController?.clear(); + _model.personNameTextController + ?.clear(); + _model.notesTextController?.clear(); + }); + } else { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => FocusScope.of(context) + .unfocus(), + child: Padding( + padding: MediaQuery.viewInsetsOf( + context), + child: ThrowExceptionWidget( + msg: PhpGroup + .postProvVisitSchedulingCall + .msg( + (_model.provVisitSchedule + ?.jsonBody ?? + ''), + )!, + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + } + + setState(() {}); + }, text: FFLocalizations.of(context).getText( 'bv5fg9sv' /* Enviar */, ), options: FFButtonOptions( - height: 40.0, + width: 150.0, + height: 50.0, padding: const EdgeInsetsDirectional.fromSTEB( 24.0, 0.0, 24.0, 0.0), iconPadding: const EdgeInsetsDirectional.fromSTEB( @@ -1025,6 +1033,9 @@ class _ScheduleProvisionalVisitPageWidgetState width: 1.0, ), borderRadius: BorderRadius.circular(8.0), + disabledColor: + FlutterFlowTheme.of(context).customColor5, + disabledTextColor: Colors.white, ), ), ], From 3af9ab2845dc8438c402860528a23fdd8b7d4db0 Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:35:42 +0000 Subject: [PATCH 08/14] fix: Layout --- ios/Runner.xcodeproj/project.pbxproj | 8 ++++---- .../schedule_provisional_visit_page_widget.dart | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 6fd55041..42891d6c 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -44,8 +44,8 @@ 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6436409327A31CD900820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409027A31CD700820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409227A31CDD00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409B27A31CD600820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -225,8 +225,8 @@ 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 6436409327A31CD900820AF7 /* pt */, - 6436409027A31CD700820AF7 /* en */, + 6436409227A31CDD00820AF7 /* pt */, + 6436409B27A31CD600820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart index d81d91e1..51cd64f3 100644 --- a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart +++ b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart @@ -257,7 +257,7 @@ class _ScheduleProvisionalVisitPageWidgetState alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 0.0, 0.0), + 24.0, 10.0, 0.0, 10.0), child: Text( FFLocalizations.of(context).getText( 'z6aawgqa' /* Dados da Visita */, @@ -769,7 +769,7 @@ class _ScheduleProvisionalVisitPageWidgetState ), Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 10.0, 0.0, 0.0), + 0.0, 10.0, 0.0, 10.0), child: Column( mainAxisSize: MainAxisSize.max, children: [ From cfd7e0e4ae4eca4c487d51821dabe7f6b1178461 Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Thu, 8 Aug 2024 14:22:50 -0300 Subject: [PATCH 09/14] fix: Provisional Schedule --- ...chedule_provisional_visit_page_widget.dart | 128 +++++++++--------- 1 file changed, 63 insertions(+), 65 deletions(-) diff --git a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart index 6f655ea4..b84d75e9 100644 --- a/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart +++ b/lib/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart @@ -1,3 +1,8 @@ +import 'dart:developer'; + +import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/log_util.dart'; + import '/backend/api_requests/api_calls.dart'; import '/components/molecular_components/throw_exception/throw_exception_widget.dart'; import '/flutter_flow/flutter_flow_icon_button.dart'; @@ -49,6 +54,18 @@ class _ScheduleProvisionalVisitPageWidgetState super.dispose(); } + bool _isFormValid() { + if (_model.personNameTextController.text == '' || _model.personNameTextController.text.length > 80) { + return false; + } + + if (_model.dateTimeTextController.text == '') { + return false; + } + + return true; + } + @override Widget build(BuildContext context) { context.watch(); @@ -72,7 +89,7 @@ class _ScheduleProvisionalVisitPageWidgetState size: 30.0, ), onPressed: () async { - // context.pop(); + Navigator.pop(context); }, ), title: Text( @@ -102,7 +119,7 @@ class _ScheduleProvisionalVisitPageWidgetState children: [ Form( key: _model.formKey, - autovalidateMode: AutovalidateMode.always, + autovalidateMode: AutovalidateMode.onUserInteraction, child: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.max, @@ -464,6 +481,7 @@ class _ScheduleProvisionalVisitPageWidgetState const Duration(milliseconds: 500), () => setState(() {}), ), + readOnly: true, autofocus: false, obscureText: false, decoration: InputDecoration( @@ -943,71 +961,51 @@ class _ScheduleProvisionalVisitPageWidgetState ), ), FFButtonWidget( - onPressed: ((_model.personNameTextController.text == - '') || - (_model.dateTimeTextController.text == - '')) - ? null - : () async { - _model.provVisitSchedule = await PhpGroup - .postProvVisitSchedulingCall - .call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'putAgendamentoProv', - data: _model.dateTimeTextController.text, - motivo: _model.notesTextController.text, - nome: - _model.personNameTextController.text, - proID: FFAppState().ownerUUID, - ); + onPressed: !_isFormValid() ? null : () async { - if (PhpGroup.postProvVisitSchedulingCall - .error( - (_model.provVisitSchedule?.jsonBody ?? - ''), - ) == - false) { - setState(() { - _model.dateTimeTextController?.clear(); - _model.personNameTextController - ?.clear(); - _model.notesTextController?.clear(); - }); - } else { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - enableDrag: false, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => FocusScope.of(context) - .unfocus(), - child: Padding( - padding: MediaQuery.viewInsetsOf( - context), - child: ThrowExceptionWidget( - msg: PhpGroup - .postProvVisitSchedulingCall - .msg( - (_model.provVisitSchedule - ?.jsonBody ?? - ''), - )!, - ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - } + try { + _model.provVisitSchedule = await PhpGroup.postProvVisitSchedulingCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'putAgendamentoProv', + data: _model.dateTimeTextController.text, + motivo: _model.notesTextController.text, + nome: _model.personNameTextController.text, + proID: FFAppState().ownerUUID, + ); - setState(() {}); - }, - text: FFLocalizations.of(context).getText( - 'bv5fg9sv' /* Enviar */, - ), + if (PhpGroup.postProvVisitSchedulingCall.error((_model.provVisitSchedule?.jsonBody ?? '')) == false) { + DialogUtil.success( + context, + FFLocalizations.of(context).getVariableText( + ptText: "Agendamento Provisório Realizado com Sucesso!", + enText: "Provisional Scheduling Successfully Completed" + ) + ); + setState(() { + _model.dateTimeTextController?.clear(); + _model.personNameTextController?.clear(); + _model.notesTextController?.clear(); + }); + } else { + var message = PhpGroup.postProvVisitSchedulingCall.msg((_model.provVisitSchedule?.jsonBody ?? '')); + if (message != null) { + DialogUtil.error(context, message); + } else { + DialogUtil.errorDefault(context); + } + } + + setState(() {}); + } catch (e, s) { + DialogUtil.errorDefault(context); + LogUtil.requestAPIFailed("processRequest.php", "", "Cadastrar Visita Provisória", e, s); + } + + }, + showLoadingIndicator: true, + text: FFLocalizations.of(context).getText('bv5fg9sv' /* Enviar */), options: FFButtonOptions( width: 150.0, height: 50.0, From 5d6f4209d632070d025e290e8215530142ca84aa Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 9 Aug 2024 11:25:25 -0300 Subject: [PATCH 10/14] Ajuste de responsividade, do modal e tratamento de erro --- .../message_opt_modal/opt_modal_widget.dart | 285 +++++++------ .../card_item_template_component_widget.dart | 107 +++-- lib/flutter_flow/internationalization.dart | 4 +- lib/main.dart | 3 +- .../acess_history_page_widget.dart | 374 ++++++------------ 5 files changed, 320 insertions(+), 453 deletions(-) diff --git a/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart index 6b2df897..7dfaf73c 100644 --- a/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart +++ b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart @@ -1,3 +1,4 @@ +import 'dart:ffi'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -7,7 +8,6 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/internationalization.dart'; - class OptModalWidget extends StatefulWidget { final String defaultPersonType; final String defaultAccessType; @@ -65,7 +65,7 @@ class _OptModalWidgetState extends State { Map filterResult = { 'personType': '', 'accessType': '', - 'search': _model.textController?.text == '' + 'search': _model.textController?.text == '' ? '.*' : _model.textController!.text.toLowerCase(), }; @@ -89,7 +89,8 @@ class _OptModalWidgetState extends State { Navigator.pop(context, filterResult); } - Widget _buildCheckboxListTile(String key, List> options) { + Widget _buildCheckboxListTile( + String key, List> options, double fontsize) { return Column( children: [ Row( @@ -97,14 +98,13 @@ class _OptModalWidgetState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 3.0, 0.0, 0.0), child: Text( FFLocalizations.of(context).getText('l7tw8b92'), - textAlign: TextAlign - .left, // Adiciona esta linha para alinhar o texto à esquerda + 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), @@ -115,6 +115,7 @@ class _OptModalWidgetState extends State { ], ), ListView.builder( + physics: const NeverScrollableScrollPhysics(), shrinkWrap: true, itemCount: options.length, itemBuilder: (context, index) { @@ -125,6 +126,7 @@ class _OptModalWidgetState extends State { 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, @@ -148,9 +150,10 @@ class _OptModalWidgetState extends State { checkboxShape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(100), ), + enableFeedback: true, side: BorderSide( - width: 10, + width: 5, color: FlutterFlowTheme.of(context).secondaryText, ), controlAffinity: @@ -178,157 +181,153 @@ class _OptModalWidgetState extends State { @override Widget build(BuildContext context) { - return SafeArea( - child: Align( - alignment: const AlignmentDirectional(1.0, -1.0), + double screenWidth = MediaQuery.of(context).size.width; + double screenHeight = MediaQuery.of(context).size.height; + + return Center( + child: Container( + width: screenWidth * 0.75, + height: screenHeight * 0.70, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: BorderRadius.circular(24.0), + ), child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 50.0, 50.0, 0.0), - child: Container( - width: 300.0, - height: 450.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: BorderRadius.circular(24.0), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( + padding: const EdgeInsets.all(4.0), + child: Column( + children: [ + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, children: [ - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 10.0, 10.0, 0.0, 10.0), - child: Text( - FFLocalizations.of(context) - .getText('yfj9pd6k'), // Filtros - style: FlutterFlowTheme.of(context) - .headlineMedium - .override( + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 10.0, 10.0, 0.0, 10.0), + child: Text( + FFLocalizations.of(context) + .getText('yfj9pd6k'), // Filtros + style: + FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: FlutterFlowTheme.of(context) .headlineMediumFamily, color: FlutterFlowTheme.of(context).primaryText, - fontSize: 16.0, + fontSize: 18.0, letterSpacing: 0.0, + fontWeight: FontWeight.bold, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) .headlineMediumFamily), ), - ), - ), - ], - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController, - focusNode: _model.textFieldFocusNode, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - '0enrtljz' /* Pesquise aqui..... */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).alternate, - width: 1, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 1, - ), - borderRadius: BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 1, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 1, - ), - borderRadius: BorderRadius.circular(8.0), - ), - filled: true, - fillColor: FlutterFlowTheme.of(context).alternate, - suffixIcon: const Icon( - Icons.search_outlined, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - validator: - _model.textControllerValidator.asValidator(context), - ), - ), - SingleChildScrollView( - child: Container( - padding: const EdgeInsets.all(20), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - _buildCheckboxListTile( - 'personType', personTypeOptions), - _buildCheckboxListTile( - 'accessType', accessTypeOptions), - ], - ), - ), - ), - ElevatedButton( - onPressed: _applyFilter, - child: - Text(FFLocalizations.of(context).getText('88kshkph')), - style: ElevatedButton.styleFrom( - foregroundColor: FlutterFlowTheme.of(context).info, - backgroundColor: FlutterFlowTheme.of(context).primary, ), ), ], ), - ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController, + focusNode: _model.textFieldFocusNode, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context).getText( + '0enrtljz' /* Pesquise aqui... */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).alternate, + width: 1, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 1, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 1, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 1, + ), + borderRadius: BorderRadius.circular(8.0), + ), + filled: true, + fillColor: FlutterFlowTheme.of(context).alternate, + suffixIcon: const Icon( + Icons.search_outlined, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + ), + validator: + _model.textControllerValidator.asValidator(context), + ), + ), + Expanded( + child: SingleChildScrollView( + child: Container( + padding: const EdgeInsets.all(10), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + _buildCheckboxListTile('personType', personTypeOptions, + screenHeight * 0.025), + _buildCheckboxListTile('accessType', accessTypeOptions, + screenHeight * 0.025), + ], + ), + ), + ), + ), + ElevatedButton( + onPressed: _applyFilter, + style: ElevatedButton.styleFrom( + foregroundColor: FlutterFlowTheme.of(context).info, + backgroundColor: FlutterFlowTheme.of(context).primary, + ), + child: Text(FFLocalizations.of(context).getText('88kshkph')), + ), + ], ), ), ), ); } -} \ No newline at end of file +} diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart index a1e4cfc6..9550f897 100644 --- a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart +++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart @@ -1,6 +1,8 @@ import 'dart:collection'; import 'dart:developer'; +import 'package:auto_size_text/auto_size_text.dart'; + import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'package:cached_network_image/cached_network_image.dart'; @@ -12,8 +14,6 @@ export 'card_item_template_component_model.dart'; /// - - class CardItemTemplateComponentWidget extends StatefulWidget { const CardItemTemplateComponentWidget({ super.key, @@ -25,7 +25,7 @@ class CardItemTemplateComponentWidget extends StatefulWidget { final Map? labelsHashMap; final List?> statusHashMap; - final Map imageHashMap; + final Map imageHashMap; final Future Function()? onTapCardItemAction; @override @@ -40,7 +40,9 @@ class _CardItemTemplateComponentWidgetState LinkedHashMap.from(widget.labelsHashMap ?? {}); List> get statusLinkedHashMap => - widget.statusHashMap.map((map) => LinkedHashMap.from(map ?? {})).toList(); + widget.statusHashMap + .map((map) => LinkedHashMap.from(map ?? {})) + .toList(); @override void setState(VoidCallback callback) { @@ -71,12 +73,18 @@ class _CardItemTemplateComponentWidgetState } } + String truncate(int cutoff, String mytext) { + return (mytext.length <= cutoff) + ? mytext + : '${mytext.substring(0, cutoff)}...'; + } + @override Widget build(BuildContext context) { + double screenWidth = MediaQuery.of(context).size.width; + double screenHeight = MediaQuery.of(context).size.height; context.watch(); - - return InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, @@ -123,7 +131,8 @@ class _CardItemTemplateComponentWidgetState labelsLinkedHashMap.keys.elementAt(index); String value = labelsLinkedHashMap[key]!; return Padding( - padding: const EdgeInsets.only(bottom: 5.0), + padding: + const EdgeInsets.fromLTRB(0, 5, 0, 3), child: Padding( padding: const EdgeInsets.fromLTRB(20, 0, 0, 0), @@ -140,7 +149,7 @@ class _CardItemTemplateComponentWidgetState fontFamily: FlutterFlowTheme.of(context) .bodyMediumFamily, - fontSize: 12.5, + fontSize: screenWidth * 0.025, letterSpacing: 0.0, fontWeight: FontWeight.bold, useGoogleFonts: GoogleFonts @@ -151,21 +160,23 @@ class _CardItemTemplateComponentWidgetState .bodyMediumFamily), color: FlutterFlowTheme.of(context) - .primaryText, + .customColor6, ), ), const SizedBox( width: 5.0), // Espaçamento entre o label e o valor Text( - value, + truncate(20, value), + overflow: TextOverflow.ellipsis, + maxLines: 1, style: FlutterFlowTheme.of(context) .bodyMedium .override( fontFamily: FlutterFlowTheme.of(context) .bodyMediumFamily, - fontSize: 12.5, + fontSize: screenWidth * 0.030, letterSpacing: 0.0, fontWeight: FontWeight.bold, useGoogleFonts: GoogleFonts @@ -183,40 +194,52 @@ class _CardItemTemplateComponentWidgetState }, ), ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: statusLinkedHashMap.expand((linkedHashMap) { - return linkedHashMap.entries.map((MapEntry item) { - return Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 1.0, vertical: 3.0), - child: Container( - width: 100.0, - height: 27.0, - decoration: BoxDecoration( - color: item.value, // Usa a cor do item atual - borderRadius: BorderRadius.circular(5.0), - ), - child: Align( - alignment: Alignment.center, - child: Text( - item.key, // Usa a chave do item atual como texto - style: TextStyle( - color: FlutterFlowTheme.of(context).info, // Ajuste conforme necessário + Padding( + padding: const EdgeInsets.fromLTRB(20, 0, 0, 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: + statusLinkedHashMap.expand((linkedHashMap) { + return linkedHashMap.entries + .map((MapEntry item) { + return Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 1.0, vertical: 3.0), + child: Container( + width: screenWidth * 0.20, + height: 27.0, + decoration: BoxDecoration( + color: item + .value, // Usa a cor do item atual + borderRadius: + BorderRadius.circular(5.0), + ), + child: Align( + alignment: Alignment.center, + child: Text( + item.key, // Usa a chave do item atual como texto + style: TextStyle( + fontSize: screenWidth * 0.03, + color: FlutterFlowTheme.of( + context) + .info, // Ajuste conforme necessário + ), ), ), ), ), - ), - ], - ), - ); - }).toList(); - }).toList(), + ], + ), + ); + }).toList(); + }).toList(), + ), ), ]), ), @@ -245,4 +268,4 @@ class _CardItemTemplateComponentWidgetState ), ); } -} \ No newline at end of file +} diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index ca57ae4a..ba266723 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -518,8 +518,8 @@ final kTranslationsMap = >>[ // optModal { '0enrtljz': { - 'pt': 'Pesquise aqui.....', - 'en': 'Search here.....', + 'pt': 'Pesquise aqui...', + 'en': 'Search here...', }, 'l7tw8b92': { 'pt': 'Tipo de Pessoa', diff --git a/lib/main.dart b/lib/main.dart index 2590c721..642f9e0b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,3 @@ - import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:hub/app_state.dart'; @@ -141,4 +140,4 @@ class _MyAppState extends State { routerConfig: _router, ); } -} \ No newline at end of file +} diff --git a/lib/pages/acess_history_page/acess_history_page_widget.dart b/lib/pages/acess_history_page/acess_history_page_widget.dart index 58976eb6..ddd65809 100644 --- a/lib/pages/acess_history_page/acess_history_page_widget.dart +++ b/lib/pages/acess_history_page/acess_history_page_widget.dart @@ -19,9 +19,6 @@ import 'package:hub/flutter_flow/internationalization.dart'; import 'package:hub/pages/acess_history_page/acess_history_page_model.dart'; import 'package:rxdart/rxdart.dart'; - - - @immutable class AcessHistoryPageWidget extends StatefulWidget { late Map opt = { @@ -43,8 +40,8 @@ class AccessHistoryItemWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.all(8.0), + return const Padding( + padding: EdgeInsets.all(8.0), child: Column(), ); } @@ -66,6 +63,7 @@ class _AcessHistoryPageWidgetState extends State { @override void initState() { super.initState(); + _model = createModel(context, () => AcessHistoryPageModel()); log("initState called in _AcessHistoryPageWidgetState"); } @@ -138,28 +136,44 @@ class _AcessHistoryPageWidgetState extends State { return Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - IconButton( - icon: const Icon(Icons.filter_list), - padding: EdgeInsets.fromLTRB(0, 0, 10, 0), - onPressed: () async { - final Map? selectedFilter = - await showModalBottomSheet>( - isScrollControlled: true, - backgroundColor: Colors.transparent, - context: context, - builder: (context) => OptModalWidget( - defaultAccessType: - selectedTypeSubject.value['accessType'] ?? '.*', - defaultPersonType: - selectedTypeSubject.value['personType'] ?? '.*', - ), - ); + Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 10, 0), + child: IconButton( + 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: OptModalWidget( + defaultAccessType: + selectedTypeSubject.value['accessType'] ?? + '.*', + defaultPersonType: + selectedTypeSubject.value['personType'] ?? + '.*', + ), + ), + ), + ); + }); - if (selectedFilter != null) { - log('Selected Filter: $selectedFilter'); - _updateAccessHistoryAction(selectedFilter); - } - }, + if (selectedFilter != null) { + log('Selected Filter: $selectedFilter'); + _updateAccessHistoryAction(selectedFilter); + } + }, + ), ), ], ); @@ -227,20 +241,22 @@ class _AcessHistoryPageWidgetState extends State { } Widget _accessHistoryListOrganismWidget(BuildContext context) { - return SingleChildScrollView( - child: Column( - children: [ - StreamBuilder>( - stream: selectedTypeSubject.stream, - builder: (context, snapshot) { - if (!snapshot.hasData) { - return Center(child: CircularProgressIndicator()); - } - final selected = snapshot.data!; - return _cardListViewOrganismWidget(selected); - }, - ), - ], + return Center( + child: SingleChildScrollView( + child: Column( + children: [ + StreamBuilder>( + stream: selectedTypeSubject.stream, + builder: (context, snapshot) { + if (!snapshot.hasData) { + return Center(child: CircularProgressIndicator()); + } + final selected = snapshot.data!; + return _cardListViewOrganismWidget(selected); + }, + ), + ], + ), ), ); } @@ -253,8 +269,7 @@ class _AcessHistoryPageWidgetState extends State { log('Response: ${response.jsonBody}'); final List accessHistory = response.jsonBody['acessos'] ?? []; log('Access History Before Filtering: $accessHistory'); - log( - 'Filtering for: Person Type - ${select['personType']}, Access Type - ${select['accessType']}, Search - ${select['search']}'); + log('Filtering for: Person Type - ${select['personType']}, Access Type - ${select['accessType']}, Search - ${select['search']}'); return accessHistory.where((item) { final personTypeMatches = select['personType'] == '.*' || @@ -272,8 +287,7 @@ class _AcessHistoryPageWidgetState extends State { } Widget _cardListViewOrganismWidget(Map selected) { - log( - 'Selected types in Card: ${selected['personType']}, ${selected['accessType']}'); + log('Selected types in Card: ${selected['personType']}, ${selected['accessType']}'); log('_buildAccessHistoryList called'); return FutureBuilder>( future: fetchCardListViewService(selected), @@ -290,8 +304,18 @@ class _AcessHistoryPageWidgetState extends State { ), ), ); + } else if (snapshot.hasData && snapshot.data!.isEmpty) { + return Center( + child: Text(FFLocalizations.of(context).getVariableText( + ptText: "Nenhum histórico encontrado!", + enText: "No history found!")), + ); } else if (snapshot.hasError) { - return Text('Error: ${snapshot.error}'); + return Center( + child: Text(FFLocalizations.of(context).getVariableText( + ptText: "Falha ao efetuar operação!", + enText: "Failed to perform operation!")), + ); } else { final accessHistory = snapshot.data!; log('Access History: $accessHistory'); @@ -301,8 +325,7 @@ class _AcessHistoryPageWidgetState extends State { itemCount: accessHistory.length, itemBuilder: (context, index) { final accessHistoryItem = accessHistory[index]; - log( - 'Access History Item: ${accessHistoryItem['PES_TIPO']}'); + log('Access History Item: ${accessHistoryItem['PES_TIPO']}'); return _accessHistoryCardMoleculeWidget( context, accessHistoryItem); }, @@ -314,7 +337,7 @@ class _AcessHistoryPageWidgetState extends State { Widget _accessHistoryCardMoleculeWidget( BuildContext context, dynamic accessHistoryItem) { - log('Access History Item: $accessHistoryItem'); + log('Access History Item: $accessHistoryItem'); return CardItemTemplateComponentWidget( imageHashMap: Map.from({ 'key': accessHistoryItem['PES_ID'] ?? '', @@ -327,230 +350,53 @@ class _AcessHistoryPageWidgetState extends State { }), statusHashMap: [ accessHistoryItem['PES_TIPO'] == 'O' - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Morador', - enText: 'Resident', - ): FlutterFlowTheme.of(context).alternate2, - }) - : accessHistoryItem['PES_TIPO'] == 'E' - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Visitante', - enText: 'Visitor', - ): FlutterFlowTheme.of(context).alternate2, - }) - : Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Desconhecido', - enText: 'Unknown', - ): FlutterFlowTheme.of(context).alternate2, - }), + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Morador', + enText: 'Resident', + ): FlutterFlowTheme.of(context).alternate2, + }) + : accessHistoryItem['PES_TIPO'] == 'E' + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Visitante', + enText: 'Visitor', + ): FlutterFlowTheme.of(context).alternate2, + }) + : Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Desconhecido', + enText: 'Unknown', + ): FlutterFlowTheme.of(context).alternate2, + }), accessHistoryItem['ACE_TIPO'] == '0' - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Entrada', - enText: 'Entrance', - ): FlutterFlowTheme.of(context).success, - }) - : accessHistoryItem['ACE_TIPO'] == '1' - ? Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Saída', - enText: 'Exit', - ): FlutterFlowTheme.of(context).error, - }) - : Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Desconhecido', - enText: 'Unknown', - ): FlutterFlowTheme.of(context).warning, - }) + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Entrada', + enText: 'Entrance', + ): FlutterFlowTheme.of(context).success, + }) + : accessHistoryItem['ACE_TIPO'] == '1' + ? Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Saída', + enText: 'Exit', + ): FlutterFlowTheme.of(context).error, + }) + : Map.from({ + FFLocalizations.of(context).getVariableText( + ptText: 'Desconhecido', + enText: 'Unknown', + ): FlutterFlowTheme.of(context).warning, + }) ], onTapCardItemAction: () async {}); } } -Widget _cardHeaderAtomWidget(BuildContext context, String urlImagem, - String tipoPessoa, Color corFundoTipo, accessHistoryItem) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsets.all(10.0), - child: ClipRRect( - borderRadius: BorderRadius.circular(100.0), - child: Image.network( - urlImagem, - width: 60.0, - height: 60.0, - fit: BoxFit.cover, - ), - ), - ), - Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - getJsonField( - accessHistoryItem, - r'''$.PES_NOME''', - ).toString(), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - Container( - width: 100.0, - height: 25.0, - decoration: BoxDecoration( - color: (() { - // Extrai o valor de PES_TIPO, converte para String, remove espaços em branco e aspas - final pesTipo = - jsonToStr(getJsonField( - accessHistoryItem, - r'''$.PES_TIPO''', - )) - .trim() - .replaceAll('"', ''); // Remove aspas - - // Debug: Imprime o valor de PES_TIPO ajustado - log('PES_TIPO FOR COLORING: $pesTipo'); - - // Retorna a cor baseada na condição ajustada - return pesTipo == 'E' - ? FlutterFlowTheme.of(context).warning - : FlutterFlowTheme.of(context).primary; - })(), - borderRadius: BorderRadius.circular(24.0), - ), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - getJsonField( - accessHistoryItem, - r'''$.PES_TIPO''', - ).toString() == - 'E' - ? FFLocalizations.of(context).getText( - 'zok7lu4w', - ) - : FFLocalizations.of(context).getText( - 'oonqk812', - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).info, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ), - ), - ], - ), - ] - .divide(const SizedBox(width: 20.0)) - .addToStart(const SizedBox(width: 5.0)) - .addToEnd(const SizedBox(width: 5.0)), - ); -} - -Widget _cardDetailsMoleculeWidget( - BuildContext context, dynamic accessHistoryItem) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - FFLocalizations.of(context).getText( - '2odgr6hg', - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - Text( - getJsonField( - accessHistoryItem, - r'''$.ACE_DATAHORA''', - ).toString(), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ].addToStart(const SizedBox(width: 10.0)), - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - FFLocalizations.of(context).getText( - 'zrde3fke', - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - Text( - getJsonField( - accessHistoryItem, - r'''$.ACI_DESCRICAO''', - ).toString(), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: 12.5, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ].addToStart(const SizedBox(width: 10.0)), - ), - ].divide(const SizedBox(height: 3.0)), - ), - ), - ] - .addToStart(const SizedBox(width: 5.0)) - .addToEnd(const SizedBox(width: 5.0)), - ); -} - String imageUrlAtomWidget(String document, String type) { return valueOrDefault( "https://freaccess.com.br/freaccess/getImage.php?&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=$document&tipo=$type", "https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg", ); -} \ No newline at end of file +} From f1c6686c662fbdc915a28e28b5bbf7b92f44cc16 Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Mon, 12 Aug 2024 09:22:20 -0300 Subject: [PATCH 11/14] =?UTF-8?q?fix:=20Corre=C3=A7=C3=A3o=20da=20convers?= =?UTF-8?q?=C3=A3o=20data/hora=20para=20iso?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/backend/api_requests/api_calls.dart | 3 ++- lib/shared/utils/validator_util.dart | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index 2a8838ec..e2db37fd 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'dart:developer'; import 'package:flutter/foundation.dart'; +import 'package:hub/shared/utils/validator_util.dart'; import '/flutter_flow/flutter_flow_util.dart'; import 'api_manager.dart'; @@ -1271,7 +1272,7 @@ class PostProvVisitSchedulingCall { 'userUUID': userUUID, 'cliID': cliID, 'atividade': atividade, - 'data': data, + 'data': ValidatorUtil.toISO8601("dd/MM/yyyy HH:mm:ss", data!), 'motivo': motivo, 'nome': nome, 'proID': proID, diff --git a/lib/shared/utils/validator_util.dart b/lib/shared/utils/validator_util.dart index 3188c18e..d0888545 100644 --- a/lib/shared/utils/validator_util.dart +++ b/lib/shared/utils/validator_util.dart @@ -1,3 +1,5 @@ +import 'package:intl/intl.dart'; + class ValidatorUtil { static bool isValidEmail(String email) { if (RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$').hasMatch(email)) { @@ -14,4 +16,11 @@ class ValidatorUtil { return false; } } + + static String toISO8601(String format, String value) { + DateFormat dateFormat = DateFormat(format); + DateTime dateTime = dateFormat.parse(value); + + return dateTime.toIso8601String(); + } } From b678ed514294e0d643d248a057d290af270e3212 Mon Sep 17 00:00:00 2001 From: Ivan Antunes Date: Mon, 12 Aug 2024 13:02:27 -0300 Subject: [PATCH 12/14] =?UTF-8?q?fix:=20Pagina=C3=A7=C3=A3o=20do=20Histori?= =?UTF-8?q?co=20de=20Acesso?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/backend/api_requests/api_calls.dart | 62 ++-- .../acess_history_page_model.dart | 6 +- .../acess_history_page_widget.dart | 290 +++++++++--------- 3 files changed, 173 insertions(+), 185 deletions(-) diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index 2a8838ec..1649576f 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -1715,7 +1715,7 @@ class RespondeSolicitacaoCall { } class GetAccessCall { - Stream call({ + Future call({ String? devUUID = '', String? userUUID = '', String? cliID = '', @@ -1725,43 +1725,31 @@ class GetAccessCall { String? pesTipo = '', }) { final baseUrl = PhpGroup.getBaseUrl(); - final StreamController controller = StreamController(); - Future.microtask(() async { - try { - final response = await ApiManager.instance.makeApiCall( - callName: 'getAccess', - apiUrl: '$baseUrl/processRequest.php', - callType: ApiCallType.POST, - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - }, - params: { - 'devUUID': devUUID, - 'userUUID': userUUID, - 'cliID': cliID, - 'atividade': atividade, - 'pageSize': pageSize, - 'pageNumber': pageNumber, - 'pesTipo': pesTipo, - }, - bodyType: BodyType.X_WWW_FORM_URL_ENCODED, - returnBody: true, - encodeBodyUtf8: false, - decodeUtf8: false, - cache: false, - isStreamingApi: false, - alwaysAllowBody: false, - ); - controller.add(response); - await controller.close(); - } catch (e) { - controller.addError(e); - await controller.close(); - } - }); - - return controller.stream; + return ApiManager.instance.makeApiCall( + callName: 'getAccess', + apiUrl: '$baseUrl/processRequest.php', + callType: ApiCallType.POST, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + params: { + 'devUUID': devUUID, + 'userUUID': userUUID, + 'cliID': cliID, + 'atividade': atividade, + 'pageSize': pageSize, + 'pageNumber': pageNumber, + 'pesTipo': pesTipo, + }, + bodyType: BodyType.X_WWW_FORM_URL_ENCODED, + returnBody: true, + encodeBodyUtf8: false, + decodeUtf8: false, + cache: false, + isStreamingApi: false, + alwaysAllowBody: false, + ); } bool? error(dynamic response) => castToType(getJsonField( diff --git a/lib/pages/acess_history_page/acess_history_page_model.dart b/lib/pages/acess_history_page/acess_history_page_model.dart index 4d633ac2..ea6e2115 100644 --- a/lib/pages/acess_history_page/acess_history_page_model.dart +++ b/lib/pages/acess_history_page/acess_history_page_model.dart @@ -11,11 +11,11 @@ import 'package:hub/pages/liberation_history/liberation_history_model.dart'; class AcessHistoryPageModel extends FlutterFlowModel { final unfocusNode = FocusNode(); - final _accessHistoryManager = StreamRequestManager(); - Stream accessHistory({ + final _accessHistoryManager = FutureRequestManager(); + Future accessHistory({ String? uniqueQueryKey, bool? overrideCache, - required Stream Function() requestFn, + required Future Function() requestFn, }) => _accessHistoryManager.performRequest( uniqueQueryKey: uniqueQueryKey, 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 ddd65809..4fa801d7 100644 --- a/lib/pages/acess_history_page/acess_history_page_widget.dart +++ b/lib/pages/acess_history_page/acess_history_page_widget.dart @@ -1,5 +1,6 @@ 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'; @@ -7,9 +8,7 @@ import 'package:hub/app_state.dart'; import 'package:hub/backend/api_requests/api_calls.dart'; import 'package:hub/backend/api_requests/api_manager.dart'; import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_widget.dart'; -import 'package:hub/components/molecular_components/option_selection_modal/option_selection_modal_widget.dart'; import 'package:hub/components/templates_components/card_item_template_component/card_item_template_component_widget.dart'; -import 'package:hub/flutter_flow/custom_functions.dart'; import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_model.dart'; @@ -17,6 +16,8 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/internationalization.dart'; import 'package:hub/pages/acess_history_page/acess_history_page_model.dart'; +import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/log_util.dart'; import 'package:rxdart/rxdart.dart'; @immutable @@ -53,19 +54,34 @@ class _AcessHistoryPageWidgetState extends State { bool _isSubjectClosed = false; final scaffoldKey = GlobalKey(); - _AcessHistoryPageWidgetState(Map opt) - : selectedTypeSubject = BehaviorSubject.seeded(opt) { - selectedTypeSubject.listen((value) { - log("selectedTypeSubject changed: $value"); - }); + late ScrollController _scrollController; + int _pageNumber = 1; + final int _pageSize = 10; + bool _hasData = false; + bool _loading = false; + + String _personType = '.*'; + String _accessType = '.*'; + String _search = '.*'; + + late Future _accessFuture; + List _accessWrap = []; + + _AcessHistoryPageWidgetState(Map opt) : selectedTypeSubject = BehaviorSubject.seeded(opt) { + selectedTypeSubject.listen((value) {}); } @override void initState() { super.initState(); - _model = createModel(context, () => AcessHistoryPageModel()); - log("initState called in _AcessHistoryPageWidgetState"); + _accessFuture = fetchAccessHistoryService(); + + _scrollController = ScrollController()..addListener(() { + if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { + _loadMoreAccess(); + } + }); } @override @@ -77,31 +93,31 @@ class _AcessHistoryPageWidgetState extends State { @override Widget build(BuildContext context) { + final theme = FlutterFlowTheme.of(context); + return Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - appBar: _appBarOrganismWidget(context), - body: _accessHistoryListOrganismWidget(context)); + appBar: _appBar(context, theme), + body: _body(context)); } -// AppBar Widgets - PreferredSizeWidget _appBarOrganismWidget(BuildContext context) { - final theme = FlutterFlowTheme.of(context); + + PreferredSizeWidget _appBar(BuildContext context, FlutterFlowTheme theme) { return AppBar( backgroundColor: theme.primaryBackground, automaticallyImplyLeading: false, - leading: _appBarBackButtonAtomWidget(context, theme), - title: _appBarTitleMoleculeWidget(context, theme), + leading: _backButton(context, theme), + title: _title(context, theme), centerTitle: true, elevation: 0.0, actions: [ - _appBarFilterButtonAtomWidget(context), + _filterButton(context) ], ); } - Widget _appBarBackButtonAtomWidget( - BuildContext context, FlutterFlowTheme theme) { + Widget _backButton(BuildContext context, FlutterFlowTheme theme) { return FlutterFlowIconButton( borderColor: Colors.transparent, borderRadius: 30.0, @@ -116,8 +132,7 @@ class _AcessHistoryPageWidgetState extends State { ); } - Widget _appBarTitleMoleculeWidget( - BuildContext context, FlutterFlowTheme theme) { + Widget _title(BuildContext context, FlutterFlowTheme theme) { return Text( FFLocalizations.of(context).getText('ch8qymga'), style: theme.headlineMedium.override( @@ -126,13 +141,12 @@ class _AcessHistoryPageWidgetState extends State { fontSize: 16.0, letterSpacing: 0.0, useGoogleFonts: - GoogleFonts.asMap().containsKey(theme.headlineMediumFamily), + GoogleFonts.asMap().containsKey(theme.headlineMediumFamily), ), ); } - Widget _appBarFilterButtonAtomWidget(BuildContext context) { - log('selectedTypeSubject: ${selectedTypeSubject.value}'); + Widget _filterButton(BuildContext context) { return Row( mainAxisAlignment: MainAxisAlignment.end, children: [ @@ -141,27 +155,20 @@ class _AcessHistoryPageWidgetState extends State { child: IconButton( icon: const Icon(Icons.filter_list), onPressed: () async { - final Map? selectedFilter = - await showModalBottomSheet>( + final Map? selectedFilter = await showModalBottomSheet>( isScrollControlled: true, backgroundColor: Colors.transparent, context: context, builder: (context) { return GestureDetector( - onTap: () { - Navigator.of(context).pop(); - }, + onTap: () => Navigator.of(context).pop(), child: Container( color: Colors.transparent, child: GestureDetector( onTap: () {}, child: OptModalWidget( - defaultAccessType: - selectedTypeSubject.value['accessType'] ?? - '.*', - defaultPersonType: - selectedTypeSubject.value['personType'] ?? - '.*', + defaultAccessType: selectedTypeSubject.value['accessType'] ?? '.*', + defaultPersonType: selectedTypeSubject.value['personType'] ?? '.*', ), ), ), @@ -169,7 +176,6 @@ class _AcessHistoryPageWidgetState extends State { }); if (selectedFilter != null) { - log('Selected Filter: $selectedFilter'); _updateAccessHistoryAction(selectedFilter); } }, @@ -192,108 +198,112 @@ class _AcessHistoryPageWidgetState extends State { }); if (needsUpdate) { selectedTypeSubject.add(updatedType); - log("updateAccessHistory called with newType: $newType"); + fetchCardListViewService(updatedType); safeSetState(() {}); } } } - Stream fetchAccessHistoryService(String selectedType) { - log('Calling API with type: $selectedType'); - switch (selectedType) { - case 'E': - return _model.accessHistory( - requestFn: () => PhpGroup.getAccessCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getAcessos', - pageSize: '100', - pageNumber: '1', - pesTipo: 'E', - ), - ); - case 'O': - return _model.accessHistory( - requestFn: () => PhpGroup.getAccessCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getAcessos', - pageSize: '100', - pageNumber: '1', - pesTipo: 'O', - ), - ); - default: - return _model.accessHistory( - requestFn: () => PhpGroup.getAccessCall.call( - devUUID: FFAppState().devUUID, - userUUID: FFAppState().userUUID, - cliID: FFAppState().cliUUID, - atividade: 'getAcessos', - pageSize: '100', - pageNumber: '1', - pesTipo: 'T', - ), - ); + Future fetchAccessHistoryService() async { + try { + setState(() => _loading = true); + var response = await PhpGroup.getAccessCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getAcessos', + pageSize: _pageSize.toString(), + pageNumber: _pageNumber.toString(), + pesTipo: _personType != 'E' && _personType != 'O' ? 'T' : _personType, + ); + + final List accessHistory = response.jsonBody['acessos'] ?? []; + + List filteredAccess = accessHistory.where((item) { + final personTypeMatches = _personType == '.*' || item["PES_TIPO"].toString() == _personType; + final accessTypeMatches = _accessType == '.*' || item["ACE_TIPO"].toString() == _accessType; + final searchMatches = _search == '.*' || item["PES_NOME"].toString().toLowerCase().contains(_search.toLowerCase()); + return personTypeMatches && accessTypeMatches && searchMatches; + }).toList(); + + if (filteredAccess != null && filteredAccess.isNotEmpty) { + setState(() { + _accessWrap.addAll(filteredAccess); + _hasData = true; + _loading = false; + }); + return response; + } + + setState(() { + _hasData = false; + _loading = false; + }); + return null; + } catch (e, s) { + DialogUtil.errorDefault(context); + LogUtil.requestAPIFailed('processRequest', "", "Busca Acesso", e, s); + setState(() { + _hasData = false; + _loading = false; + }); } } - Widget _accessHistoryListOrganismWidget(BuildContext context) { - return Center( - child: SingleChildScrollView( - child: Column( - children: [ - StreamBuilder>( - stream: selectedTypeSubject.stream, - builder: (context, snapshot) { - if (!snapshot.hasData) { - return Center(child: CircularProgressIndicator()); - } - final selected = snapshot.data!; - return _cardListViewOrganismWidget(selected); - }, + Widget _body(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(child: _cardListViewOrganismWidget()), + if (_loading) Container( + padding: const EdgeInsets.only(top: 15, bottom: 15), + color: FlutterFlowTheme.of(context).primary, + child: Center( + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation( + FlutterFlowTheme.of(context).info, + ), ), - ], + ), ), - ), + if (_hasData == false) Container( + padding: const EdgeInsets.only(top: 15, bottom: 15), + color: FlutterFlowTheme.of(context).primary, + child: Center( + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: "Não há mais dados.", + enText: "No more data." + ), + style: TextStyle(color: FlutterFlowTheme.of(context).info), + ) + ), + ), + ], ); } - Future> fetchCardListViewService( - Map select) async { - log('Fetching access history'); - final response = - await fetchAccessHistoryService(select['personType']!).first; - log('Response: ${response.jsonBody}'); - final List accessHistory = response.jsonBody['acessos'] ?? []; - log('Access History Before Filtering: $accessHistory'); - log('Filtering for: Person Type - ${select['personType']}, Access Type - ${select['accessType']}, Search - ${select['search']}'); - - return accessHistory.where((item) { - final personTypeMatches = select['personType'] == '.*' || - item["PES_TIPO"].toString() == select['personType']; - final accessTypeMatches = select['accessType'] == '.*' || - item["ACE_TIPO"].toString() == select['accessType']; - final searchMatches = select['search'] == '.*' || - item["PES_NOME"] - .toString() - .toLowerCase() - .contains(select['search']!.toLowerCase()); - log('NOMES: ${item["PES_NOME"].toString().toLowerCase()}'); - return personTypeMatches && accessTypeMatches && searchMatches; - }).toList(); + void _loadMoreAccess() { + if (_hasData == true) { + _pageNumber++; + _accessFuture = fetchAccessHistoryService(); + } } - Widget _cardListViewOrganismWidget(Map selected) { - log('Selected types in Card: ${selected['personType']}, ${selected['accessType']}'); - log('_buildAccessHistoryList called'); - return FutureBuilder>( - future: fetchCardListViewService(selected), + void fetchCardListViewService(Map select) { + _personType = select['personType']!; + _accessType = select['accessType']!; + _search = select['search']!; + _accessWrap = []; + _pageNumber = 1; + _accessFuture = fetchAccessHistoryService(); + } + + Widget _cardListViewOrganismWidget() { + return FutureBuilder( + future: _accessFuture, builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - log('Waiting for data'); + if (snapshot.connectionState == ConnectionState.waiting && _accessWrap.isEmpty) { return Center( child: SizedBox( width: 50.0, @@ -304,40 +314,30 @@ class _AcessHistoryPageWidgetState extends State { ), ), ); - } else if (snapshot.hasData && snapshot.data!.isEmpty) { - return Center( - child: Text(FFLocalizations.of(context).getVariableText( - ptText: "Nenhum histórico encontrado!", - enText: "No history found!")), - ); } else if (snapshot.hasError) { return Center( child: Text(FFLocalizations.of(context).getVariableText( ptText: "Falha ao efetuar operação!", enText: "Failed to perform operation!")), ); - } else { - final accessHistory = snapshot.data!; - log('Access History: $accessHistory'); - return ListView.builder( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemCount: accessHistory.length, - itemBuilder: (context, index) { - final accessHistoryItem = accessHistory[index]; - log('Access History Item: ${accessHistoryItem['PES_TIPO']}'); - return _accessHistoryCardMoleculeWidget( - context, accessHistoryItem); - }, - ); } + + return ListView.builder( + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + controller: _scrollController, + itemCount: _accessWrap.length, + itemBuilder: (context, index) { + final accessHistoryItem = _accessWrap[index]; + return _accessHistoryCardMoleculeWidget(context, accessHistoryItem); + }, + ); }, ); } - Widget _accessHistoryCardMoleculeWidget( - BuildContext context, dynamic accessHistoryItem) { - log('Access History Item: $accessHistoryItem'); + Widget _accessHistoryCardMoleculeWidget(BuildContext context, dynamic accessHistoryItem) { + return CardItemTemplateComponentWidget( imageHashMap: Map.from({ 'key': accessHistoryItem['PES_ID'] ?? '', From 4d45de2890ebfd52a2ecb9ac28c79ac6869d3490 Mon Sep 17 00:00:00 2001 From: Lucas Date: Mon, 12 Aug 2024 16:46:35 -0300 Subject: [PATCH 13/14] =?UTF-8?q?Adicionado=20tratamento=20de=20erro,=20co?= =?UTF-8?q?rrigido=20modal,=20corrigido=20erro=20de=20espa=C3=A7amento=20d?= =?UTF-8?q?o=20card=20e=20adicionado=20Snackbar.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../message_opt_modal/opt_modal_widget.dart | 90 +------------ .../card_item_template_component_widget.dart | 2 +- .../acess_history_page_widget.dart | 126 +++++++++++------- 3 files changed, 85 insertions(+), 133 deletions(-) diff --git a/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart index 7dfaf73c..bd40eb5a 100644 --- a/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart +++ b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart @@ -30,10 +30,6 @@ class _OptModalWidgetState extends State { {'title': 'zok7lu4w', 'value': 'E'}, {'title': 'oonqk812', 'value': 'O'}, ]; - final List> accessTypeOptions = [ - {'title': '580z80ct', 'value': '0'}, - {'title': '1nbwqtzs', 'value': '1'}, - ]; @override void setState(VoidCallback callback) { @@ -187,7 +183,7 @@ class _OptModalWidgetState extends State { return Center( child: Container( width: screenWidth * 0.75, - height: screenHeight * 0.70, + height: screenHeight * 0.35, decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, borderRadius: BorderRadius.circular(24.0), @@ -222,84 +218,6 @@ class _OptModalWidgetState extends State { ), ], ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0), - child: TextFormField( - controller: _model.textController, - focusNode: _model.textFieldFocusNode, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText( - '0enrtljz' /* Pesquise aqui... */, - ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context).labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).alternate, - width: 1, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 1, - ), - borderRadius: BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 1, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 1, - ), - borderRadius: BorderRadius.circular(8.0), - ), - filled: true, - fillColor: FlutterFlowTheme.of(context).alternate, - suffixIcon: const Icon( - Icons.search_outlined, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - validator: - _model.textControllerValidator.asValidator(context), - ), - ), Expanded( child: SingleChildScrollView( child: Container( @@ -307,10 +225,8 @@ class _OptModalWidgetState extends State { child: Column( mainAxisSize: MainAxisSize.min, children: [ - _buildCheckboxListTile('personType', personTypeOptions, - screenHeight * 0.025), - _buildCheckboxListTile('accessType', accessTypeOptions, - screenHeight * 0.025), + _buildCheckboxListTile( + 'personType', personTypeOptions, 14), ], ), ), diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart index 9550f897..a315e2cc 100644 --- a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart +++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart @@ -132,7 +132,7 @@ class _CardItemTemplateComponentWidgetState String value = labelsLinkedHashMap[key]!; return Padding( padding: - const EdgeInsets.fromLTRB(0, 5, 0, 3), + const EdgeInsets.fromLTRB(0, 2, 0, 5), child: Padding( padding: const EdgeInsets.fromLTRB(20, 0, 0, 0), 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 4fa801d7..358b70c0 100644 --- a/lib/pages/acess_history_page/acess_history_page_widget.dart +++ b/lib/pages/acess_history_page/acess_history_page_widget.dart @@ -1,3 +1,4 @@ +import 'dart:async'; import 'dart:developer'; import 'package:flutter/cupertino.dart'; @@ -67,7 +68,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) {}); } @@ -77,11 +79,20 @@ class _AcessHistoryPageWidgetState extends State { _model = createModel(context, () => AcessHistoryPageModel()); _accessFuture = fetchAccessHistoryService(); - _scrollController = ScrollController()..addListener(() { - if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { - _loadMoreAccess(); - } - }); + _scrollController = ScrollController() + ..addListener(() { + if (_scrollController.position.atEdge && + _scrollController.position.pixels != 0) { + _loadMoreAccess(); + WidgetsBinding.instance.addPostFrameCallback((_) { + Timer(const Duration(seconds: 3), () { + if (!_hasData && _pageNumber > 1) { + _showNoMoreDataSnackbar(context); + } + }); + }); + } + }); } @override @@ -102,7 +113,6 @@ class _AcessHistoryPageWidgetState extends State { body: _body(context)); } - PreferredSizeWidget _appBar(BuildContext context, FlutterFlowTheme theme) { return AppBar( backgroundColor: theme.primaryBackground, @@ -111,9 +121,7 @@ class _AcessHistoryPageWidgetState extends State { title: _title(context, theme), centerTitle: true, elevation: 0.0, - actions: [ - _filterButton(context) - ], + actions: [_filterButton(context)], ); } @@ -141,7 +149,7 @@ class _AcessHistoryPageWidgetState extends State { fontSize: 16.0, letterSpacing: 0.0, useGoogleFonts: - GoogleFonts.asMap().containsKey(theme.headlineMediumFamily), + GoogleFonts.asMap().containsKey(theme.headlineMediumFamily), ), ); } @@ -155,7 +163,8 @@ class _AcessHistoryPageWidgetState extends State { child: IconButton( icon: const Icon(Icons.filter_list), onPressed: () async { - final Map? selectedFilter = await showModalBottomSheet>( + final Map? selectedFilter = + await showModalBottomSheet>( isScrollControlled: true, backgroundColor: Colors.transparent, context: context, @@ -167,8 +176,12 @@ class _AcessHistoryPageWidgetState extends State { child: GestureDetector( onTap: () {}, child: OptModalWidget( - defaultAccessType: selectedTypeSubject.value['accessType'] ?? '.*', - defaultPersonType: selectedTypeSubject.value['personType'] ?? '.*', + defaultAccessType: + selectedTypeSubject.value['accessType'] ?? + '.*', + defaultPersonType: + selectedTypeSubject.value['personType'] ?? + '.*', ), ), ), @@ -220,9 +233,15 @@ class _AcessHistoryPageWidgetState extends State { final List accessHistory = response.jsonBody['acessos'] ?? []; List filteredAccess = accessHistory.where((item) { - final personTypeMatches = _personType == '.*' || item["PES_TIPO"].toString() == _personType; - final accessTypeMatches = _accessType == '.*' || item["ACE_TIPO"].toString() == _accessType; - final searchMatches = _search == '.*' || item["PES_NOME"].toString().toLowerCase().contains(_search.toLowerCase()); + final personTypeMatches = + _personType == '.*' || item["PES_TIPO"].toString() == _personType; + final accessTypeMatches = + _accessType == '.*' || item["ACE_TIPO"].toString() == _accessType; + final searchMatches = _search == '.*' || + item["PES_NOME"] + .toString() + .toLowerCase() + .contains(_search.toLowerCase()); return personTypeMatches && accessTypeMatches && searchMatches; }).toList(); @@ -250,35 +269,51 @@ class _AcessHistoryPageWidgetState extends State { } } + void _showNoMoreDataSnackbar(BuildContext context) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + FFLocalizations.of(context).getVariableText( + ptText: "Não há mais dados.", enText: "No more data."), + ), + duration: const Duration(seconds: 3), + backgroundColor: FlutterFlowTheme.of(context).primary, + ), + ); + } + Widget _body(BuildContext context) { return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded(child: _cardListViewOrganismWidget()), - if (_loading) Container( - padding: const EdgeInsets.only(top: 15, bottom: 15), - color: FlutterFlowTheme.of(context).primary, - child: Center( - child: CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation( - FlutterFlowTheme.of(context).info, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + if (_hasData == false && _pageNumber <= 1 && _loading == false) + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Center( + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: "Nenhum histórico encontrado!", + enText: "No history found!"), + )), + ], + ), + ) + else if (_hasData || _pageNumber >= 1) + Expanded(child: _cardListViewOrganismWidget()), + if (_hasData == true && _loading) + Container( + padding: const EdgeInsets.only(top: 15, bottom: 15), + child: Center( + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation( + FlutterFlowTheme.of(context).primary, + ), ), ), - ), - ), - if (_hasData == false) Container( - padding: const EdgeInsets.only(top: 15, bottom: 15), - color: FlutterFlowTheme.of(context).primary, - child: Center( - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: "Não há mais dados.", - enText: "No more data." - ), - style: TextStyle(color: FlutterFlowTheme.of(context).info), - ) - ), - ), + ) ], ); } @@ -303,7 +338,8 @@ class _AcessHistoryPageWidgetState extends State { return FutureBuilder( future: _accessFuture, builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting && _accessWrap.isEmpty) { + if (snapshot.connectionState == ConnectionState.waiting && + _accessWrap.isEmpty) { return Center( child: SizedBox( width: 50.0, @@ -336,8 +372,8 @@ class _AcessHistoryPageWidgetState extends State { ); } - Widget _accessHistoryCardMoleculeWidget(BuildContext context, dynamic accessHistoryItem) { - + Widget _accessHistoryCardMoleculeWidget( + BuildContext context, dynamic accessHistoryItem) { return CardItemTemplateComponentWidget( imageHashMap: Map.from({ 'key': accessHistoryItem['PES_ID'] ?? '', From 61e23044d978572ce1789ab012cff5cdeb98561a Mon Sep 17 00:00:00 2001 From: Lucas Date: Mon, 12 Aug 2024 17:32:07 -0300 Subject: [PATCH 14/14] =?UTF-8?q?Remo=C3=A7=C3=A3o=20de=20lixo=20de=20c?= =?UTF-8?q?=C3=B3digo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acess_history_page_widget.dart | 25 ++----------------- 1 file changed, 2 insertions(+), 23 deletions(-) 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 358b70c0..7150cba4 100644 --- a/lib/pages/acess_history_page/acess_history_page_widget.dart +++ b/lib/pages/acess_history_page/acess_history_page_widget.dart @@ -62,8 +62,6 @@ class _AcessHistoryPageWidgetState extends State { bool _loading = false; String _personType = '.*'; - String _accessType = '.*'; - String _search = '.*'; late Future _accessFuture; List _accessWrap = []; @@ -84,13 +82,6 @@ class _AcessHistoryPageWidgetState extends State { if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { _loadMoreAccess(); - WidgetsBinding.instance.addPostFrameCallback((_) { - Timer(const Duration(seconds: 3), () { - if (!_hasData && _pageNumber > 1) { - _showNoMoreDataSnackbar(context); - } - }); - }); } }); } @@ -176,9 +167,6 @@ class _AcessHistoryPageWidgetState extends State { child: GestureDetector( onTap: () {}, child: OptModalWidget( - defaultAccessType: - selectedTypeSubject.value['accessType'] ?? - '.*', defaultPersonType: selectedTypeSubject.value['personType'] ?? '.*', @@ -235,14 +223,7 @@ class _AcessHistoryPageWidgetState extends State { List filteredAccess = accessHistory.where((item) { final personTypeMatches = _personType == '.*' || item["PES_TIPO"].toString() == _personType; - final accessTypeMatches = - _accessType == '.*' || item["ACE_TIPO"].toString() == _accessType; - final searchMatches = _search == '.*' || - item["PES_NOME"] - .toString() - .toLowerCase() - .contains(_search.toLowerCase()); - return personTypeMatches && accessTypeMatches && searchMatches; + return personTypeMatches; }).toList(); if (filteredAccess != null && filteredAccess.isNotEmpty) { @@ -253,7 +234,7 @@ class _AcessHistoryPageWidgetState extends State { }); return response; } - + _showNoMoreDataSnackbar(context); setState(() { _hasData = false; _loading = false; @@ -327,8 +308,6 @@ class _AcessHistoryPageWidgetState extends State { void fetchCardListViewService(Map select) { _personType = select['personType']!; - _accessType = select['accessType']!; - _search = select['search']!; _accessWrap = []; _pageNumber = 1; _accessFuture = fetchAccessHistoryService();