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 1/2] 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 2/2] 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: [