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,