From 162d3729a00bd4984b782fce601ea87a8932c32e Mon Sep 17 00:00:00 2001 From: FlutterFlow <140657486+FlutterFlowEng@users.noreply.github.com> Date: Fri, 21 Jun 2024 13:55:35 +0000 Subject: [PATCH] Updating to latest --- ios/Runner.xcodeproj/project.pbxproj | 8 +- lib/backend/api_requests/api_calls.dart | 4 + ...ot_password_template_component_widget.dart | 7 + .../sign_in_template_component_model.dart | 26 + .../sign_in_template_component_widget.dart | 556 +++--- .../sign_up_template_component_model.dart | 46 + .../sign_up_template_component_widget.dart | 871 +++++---- lib/flutter_flow/internationalization.dart | 118 ++ lib/flutter_flow/nav/nav.dart | 14 +- lib/index.dart | 4 + .../acess_history_page_model.dart | 22 + .../acess_history_page_widget.dart | 1718 +++++++++++++++++ .../liberation_history_model.dart | 23 + .../liberation_history_widget.dart | 680 +++++++ .../schedule_complete_visit_page_widget.dart | 14 +- ...chedule_provisional_visit_page_widget.dart | 1 + 16 files changed, 3481 insertions(+), 631 deletions(-) create mode 100644 lib/pages/acess_history_page/acess_history_page_model.dart create mode 100644 lib/pages/acess_history_page/acess_history_page_widget.dart create mode 100644 lib/pages/liberation_history/liberation_history_model.dart create mode 100644 lib/pages/liberation_history/liberation_history_widget.dart diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 49e2fbad..800cda29 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 = ""; }; - 6436409627A31CD500820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; - 6436409C27A31CD700820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409227A31CD100820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; + 6436409227A31CD000820AF7 /* 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 = ( - 6436409627A31CD500820AF7 /* pt */, - 6436409C27A31CD700820AF7 /* en */, + 6436409227A31CD100820AF7 /* pt */, + 6436409227A31CD000820AF7 /* en */, ); name = InfoPlist.strings; sourceTree = ""; diff --git a/lib/backend/api_requests/api_calls.dart b/lib/backend/api_requests/api_calls.dart index c53d0181..17bf988e 100644 --- a/lib/backend/api_requests/api_calls.dart +++ b/lib/backend/api_requests/api_calls.dart @@ -1140,6 +1140,8 @@ class GetVisitsCall { String? userUUID = '', String? cliID = '', String? atividade = '', + int? pageSize, + int? pageNumber, }) async { final baseUrl = PhpGroup.getBaseUrl(); @@ -1155,6 +1157,8 @@ class GetVisitsCall { 'userUUID': userUUID, 'cliID': cliID, 'atividade': atividade, + 'pageSize': pageSize, + 'pageNumber': pageNumber, }, bodyType: BodyType.X_WWW_FORM_URL_ENCODED, returnBody: true, diff --git a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart index 246668f3..f395e2cd 100644 --- a/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart +++ b/lib/components/templates_components/forgot_password_template_component/forgot_password_template_component_widget.dart @@ -53,6 +53,12 @@ class _ForgotPasswordTemplateComponentWidgetState ), decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0.0), + bottomRight: Radius.circular(0.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), ), child: Column( mainAxisSize: MainAxisSize.max, @@ -151,6 +157,7 @@ class _ForgotPasswordTemplateComponentWidgetState autofillHints: const [AutofillHints.email], obscureText: false, decoration: InputDecoration( + isDense: true, labelText: FFLocalizations.of(context).getText( 'mtz8l7ft' /* Email */, ), diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart index 6ef3aefa..5c89397f 100644 --- a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart +++ b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_model.dart @@ -7,19 +7,45 @@ class SignInTemplateComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. + final formKey = GlobalKey(); // State field(s) for emailAddress widget. FocusNode? emailAddressFocusNode; TextEditingController? emailAddressTextController; String? Function(BuildContext, String?)? emailAddressTextControllerValidator; + String? _emailAddressTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + 'xhnawzcb' /* Campo é necessário */, + ); + } + + if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { + return 'Has to be a valid email address.'; + } + return null; + } + // State field(s) for password widget. FocusNode? passwordFocusNode; TextEditingController? passwordTextController; late bool passwordVisibility; String? Function(BuildContext, String?)? passwordTextControllerValidator; + String? _passwordTextControllerValidator(BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '9cs5wlmc' /* Campo é necessário */, + ); + } + + return null; + } @override void initState(BuildContext context) { + emailAddressTextControllerValidator = _emailAddressTextControllerValidator; passwordVisibility = false; + passwordTextControllerValidator = _passwordTextControllerValidator; } @override diff --git a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart index d1db2a44..3cb6420d 100644 --- a/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart +++ b/lib/components/templates_components/sign_in_template_component/sign_in_template_component_widget.dart @@ -202,236 +202,288 @@ class _SignInTemplateComponentWidgetState crossAxisAlignment: CrossAxisAlignment.center, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .emailAddressTextController, - focusNode: - _model.emailAddressFocusNode, - autofocus: false, - textCapitalization: - TextCapitalization.none, - textInputAction: - TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context) - .getText( - '1ltg0ylb' /* Email */, - ), - labelStyle: FlutterFlowTheme.of( - context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), + Form( + key: _model.formKey, + autovalidateMode: + AutovalidateMode.always, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model + .emailAddressTextController, + focusNode: _model + .emailAddressFocusNode, + autofocus: false, + textCapitalization: + TextCapitalization.none, + textInputAction: + TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of( + context) + .getText( + '1ltg0ylb' /* Email */, + ), + labelStyle: FlutterFlowTheme + .of(context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .customColor1, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .success, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + errorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .error, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .error, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + suffixIcon: Icon( + Icons.email, + color: + FlutterFlowTheme.of( + context) + .accent1, + size: 22.0, + ), ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( + style: FlutterFlowTheme.of( context) - .customColor1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .success, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - suffixIcon: Icon( - Icons.email, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 22.0, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - keyboardType: - TextInputType.emailAddress, - validator: _model - .emailAddressTextControllerValidator - .asValidator(context), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: - _model.passwordTextController, - focusNode: _model.passwordFocusNode, - autofocus: false, - textInputAction: - TextInputAction.send, - obscureText: - !_model.passwordVisibility, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context) - .getText( - '2x19ce8k' /* Senha */, - ), - labelStyle: FlutterFlowTheme.of( - context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .customColor1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: const BorderSide( - color: Color(0xFF1AAB5F), - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: const BorderSide( - color: Color(0xFFFF5963), - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: const BorderSide( - color: Color(0xFFFF5963), - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - filled: true, - fillColor: - FlutterFlowTheme.of(context) - .primaryBackground, - suffixIcon: InkWell( - onTap: () => setState( - () => _model - .passwordVisibility = - !_model - .passwordVisibility, - ), - focusNode: FocusNode( - skipTraversal: true), - child: Icon( - _model.passwordVisibility - ? Icons - .visibility_outlined - : Icons - .visibility_off_outlined, - color: FlutterFlowTheme.of( - context) - .accent1, - size: 24.0, + .bodyLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + keyboardType: TextInputType + .emailAddress, + validator: _model + .emailAddressTextControllerValidator + .asValidator(context), ), ), ), - style: FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model + .passwordTextController, + focusNode: + _model.passwordFocusNode, + autofocus: false, + textInputAction: + TextInputAction.send, + obscureText: !_model + .passwordVisibility, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of( + context) + .getText( + '2x19ce8k' /* Senha */, + ), + labelStyle: FlutterFlowTheme + .of(context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .customColor1, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: const BorderSide( + color: + Color(0xFF1AAB5F), + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + errorBorder: + OutlineInputBorder( + borderSide: const BorderSide( + color: + Color(0xFFFF5963), + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: const BorderSide( + color: + Color(0xFFFF5963), + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + filled: true, + fillColor: + FlutterFlowTheme.of( + context) + .primaryBackground, + suffixIcon: InkWell( + onTap: () => setState( + () => _model + .passwordVisibility = + !_model + .passwordVisibility, + ), + focusNode: FocusNode( + skipTraversal: true), + child: Icon( + _model.passwordVisibility + ? Icons + .visibility_outlined + : Icons + .visibility_off_outlined, + color: + FlutterFlowTheme.of( + context) + .accent1, + size: 24.0, + ), + ), + ), + style: FlutterFlowTheme.of( context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), + .bodyLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + validator: _model + .passwordTextControllerValidator + .asValidator(context), ), - validator: _model - .passwordTextControllerValidator - .asValidator(context), - ), + ), + ), + ], ), ), Builder( @@ -448,12 +500,21 @@ class _SignInTemplateComponentWidgetState .fromSTEB( 0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - onPressed: ((_model.emailAddressTextController - .text == - '') && - (_model.passwordTextController - .text == - '')) + onPressed: (((_model.emailAddressTextController + .text == + '') || + ((_model.emailAddressFocusNode + ?.hasFocus ?? + false) != + null)) && + ((_model.emailAddressTextController + .text == + '') || + ((_model.passwordTextController.text == + '') || + ((_model.passwordFocusNode?.hasFocus ?? + false) != + null)))) ? null : () async { await action_blocks @@ -525,7 +586,7 @@ class _SignInTemplateComponentWidgetState BorderRadius.circular( 12.0), disabledColor: - const Color(0x951AAB5F), + const Color(0xE81AAB5F), ), showLoadingIndicator: false, ), @@ -617,10 +678,35 @@ class _SignInTemplateComponentWidgetState .fromSTEB(0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - onPressed: () { - print( - 'signInButtonLoginForm pressed ...'); - }, + onPressed: (((_model.emailAddressTextController + .text == + '') || + ((_model.emailAddressFocusNode + ?.hasFocus ?? + false) != + null)) && + ((_model.emailAddressTextController + .text == + '') || + ((_model.passwordTextController.text == + '') || + ((_model.passwordFocusNode?.hasFocus ?? + false) != + null)))) + ? null + : () async { + await action_blocks + .singInActionApp( + context, + emailAdress: _model + .emailAddressTextController + .text, + password: _model + .passwordTextController + .text, + ); + setState(() {}); + }, text: FFLocalizations.of( context) .getText( @@ -678,6 +764,8 @@ class _SignInTemplateComponentWidgetState borderRadius: BorderRadius .circular(12.0), + disabledColor: + const Color(0xE81AAB5F), ), showLoadingIndicator: false, diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart index 8c8d3913..cbad33f8 100644 --- a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart +++ b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_model.dart @@ -7,28 +7,74 @@ class SignUpTemplateComponentModel extends FlutterFlowModel { /// State fields for stateful widgets in this component. + final formKey = GlobalKey(); // State field(s) for nameRegisterForm widget. FocusNode? nameRegisterFormFocusNode; TextEditingController? nameRegisterFormTextController; String? Function(BuildContext, String?)? nameRegisterFormTextControllerValidator; + String? _nameRegisterFormTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '3bs10dfq' /* Campo é necessário */, + ); + } + + if (!RegExp(kTextValidatorUsernameRegex).hasMatch(val)) { + return 'Must start with a letter and can only contain letters, digits and - or _.'; + } + return null; + } + // State field(s) for emailRegisterForm widget. FocusNode? emailRegisterFormFocusNode; TextEditingController? emailRegisterFormTextController; String? Function(BuildContext, String?)? emailRegisterFormTextControllerValidator; + String? _emailRegisterFormTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + 'mlvw63yj' /* Campo é necessário */, + ); + } + + if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) { + return 'Has to be a valid email address.'; + } + return null; + } + // State field(s) for passwordRegisterForm widget. FocusNode? passwordRegisterFormFocusNode; TextEditingController? passwordRegisterFormTextController; late bool passwordRegisterFormVisibility; String? Function(BuildContext, String?)? passwordRegisterFormTextControllerValidator; + String? _passwordRegisterFormTextControllerValidator( + BuildContext context, String? val) { + if (val == null || val.isEmpty) { + return FFLocalizations.of(context).getText( + '6nn79lmh' /* Campo é necessário */, + ); + } + + return null; + } + // Stores action output result for [Action Block - signUpActionApp] action in SignUpButtonRegisterForm widget. bool? signUp; @override void initState(BuildContext context) { + nameRegisterFormTextControllerValidator = + _nameRegisterFormTextControllerValidator; + emailRegisterFormTextControllerValidator = + _emailRegisterFormTextControllerValidator; passwordRegisterFormVisibility = false; + passwordRegisterFormTextControllerValidator = + _passwordRegisterFormTextControllerValidator; } @override diff --git a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart index b3c7d018..960199f3 100644 --- a/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart +++ b/lib/components/templates_components/sign_up_template_component/sign_up_template_component_widget.dart @@ -206,411 +206,512 @@ class _SignUpTemplateComponentWidgetState crossAxisAlignment: CrossAxisAlignment.center, children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .nameRegisterFormTextController, - focusNode: _model - .nameRegisterFormFocusNode, - onChanged: (_) => - EasyDebounce.debounce( - '_model.nameRegisterFormTextController', - const Duration(milliseconds: 2000), - () => setState(() {}), - ), - autofocus: false, - autofillHints: const [AutofillHints.name], - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context) - .getText( - '3corpwhd' /* Nome */, - ), - labelStyle: FlutterFlowTheme.of( - context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), + Form( + key: _model.formKey, + autovalidateMode: + AutovalidateMode.disabled, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model + .nameRegisterFormTextController, + focusNode: _model + .nameRegisterFormFocusNode, + onChanged: (_) => + EasyDebounce.debounce( + '_model.nameRegisterFormTextController', + const Duration( + milliseconds: 2000), + () => setState(() {}), ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .customColor1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .success, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - filled: true, - fillColor: - FlutterFlowTheme.of(context) - .primaryBackground, - suffixIcon: Icon( - Icons.person, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 22.0, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - keyboardType: TextInputType.name, - validator: _model - .nameRegisterFormTextControllerValidator - .asValidator(context), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .emailRegisterFormTextController, - focusNode: _model - .emailRegisterFormFocusNode, - onChanged: (_) => - EasyDebounce.debounce( - '_model.emailRegisterFormTextController', - const Duration(milliseconds: 2000), - () => setState(() {}), - ), - autofocus: false, - autofillHints: const [ - AutofillHints.email - ], - obscureText: false, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context) - .getText( - '80wonb69' /* Email */, - ), - labelStyle: FlutterFlowTheme.of( - context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), + autofocus: false, + autofillHints: const [ + AutofillHints.name + ], + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of( + context) + .getText( + '3corpwhd' /* Nome */, + ), + labelStyle: FlutterFlowTheme + .of(context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .customColor1, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .success, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + errorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .error, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .error, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + filled: true, + fillColor: + FlutterFlowTheme.of( + context) + .primaryBackground, + suffixIcon: Icon( + Icons.person, + color: + FlutterFlowTheme.of( + context) + .accent1, + size: 22.0, + ), ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( + style: FlutterFlowTheme.of( context) - .primaryText, - width: 0.5, + .bodyLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + keyboardType: + TextInputType.name, + validator: _model + .nameRegisterFormTextControllerValidator + .asValidator(context), ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .success, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( - context) - .error, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - filled: true, - fillColor: - FlutterFlowTheme.of(context) - .primaryBackground, - suffixIcon: Icon( - Icons.email, - color: - FlutterFlowTheme.of(context) - .accent1, - size: 22.0, ), ), - style: FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .customColor1, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), - ), - keyboardType: - TextInputType.emailAddress, - validator: _model - .emailRegisterFormTextControllerValidator - .asValidator(context), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 16.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: _model - .passwordRegisterFormTextController, - focusNode: _model - .passwordRegisterFormFocusNode, - onChanged: (_) => - EasyDebounce.debounce( - '_model.passwordRegisterFormTextController', - const Duration(milliseconds: 2000), - () => setState(() {}), - ), - autofocus: false, - autofillHints: const [ - AutofillHints.password - ], - obscureText: !_model - .passwordRegisterFormVisibility, - decoration: InputDecoration( - labelText: - FFLocalizations.of(context) - .getText( - '0firji8l' /* Senha */, - ), - labelStyle: FlutterFlowTheme.of( - context) - .labelLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( - context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model + .emailRegisterFormTextController, + focusNode: _model + .emailRegisterFormFocusNode, + onChanged: (_) => + EasyDebounce.debounce( + '_model.emailRegisterFormTextController', + const Duration( + milliseconds: 2000), + () => setState(() {}), ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of( + autofocus: false, + autofillHints: const [ + AutofillHints.email + ], + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of( + context) + .getText( + '80wonb69' /* Email */, + ), + labelStyle: FlutterFlowTheme + .of(context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .primaryText, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .success, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + errorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .error, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .error, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + filled: true, + fillColor: + FlutterFlowTheme.of( + context) + .primaryBackground, + suffixIcon: Icon( + Icons.email, + color: + FlutterFlowTheme.of( + context) + .accent1, + size: 22.0, + ), + ), + style: FlutterFlowTheme.of( context) - .customColor1, - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: const BorderSide( - color: Color(0xFF1AAB5F), - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: const BorderSide( - color: Color(0xFFFF5963), - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - focusedErrorBorder: - OutlineInputBorder( - borderSide: const BorderSide( - color: Color(0xFFFF5963), - width: 0.5, - ), - borderRadius: - BorderRadius.circular(12.0), - ), - filled: true, - fillColor: - FlutterFlowTheme.of(context) - .primaryBackground, - suffixIcon: InkWell( - onTap: () => setState( - () => _model - .passwordRegisterFormVisibility = - !_model - .passwordRegisterFormVisibility, - ), - focusNode: FocusNode( - skipTraversal: true), - child: Icon( - _model.passwordRegisterFormVisibility - ? Icons - .visibility_outlined - : Icons - .visibility_off_outlined, - color: FlutterFlowTheme.of( - context) - .accent1, - size: 24.0, + .bodyLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .customColor1, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + keyboardType: TextInputType + .emailAddress, + validator: _model + .emailRegisterFormTextControllerValidator + .asValidator(context), ), ), ), - style: FlutterFlowTheme.of(context) - .bodyLarge - .override( - fontFamily: - 'Plus Jakarta Sans', - color: FlutterFlowTheme.of( + Padding( + padding: const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: _model + .passwordRegisterFormTextController, + focusNode: _model + .passwordRegisterFormFocusNode, + onChanged: (_) => + EasyDebounce.debounce( + '_model.passwordRegisterFormTextController', + const Duration( + milliseconds: 2000), + () => setState(() {}), + ), + autofocus: false, + autofillHints: const [ + AutofillHints.password + ], + obscureText: !_model + .passwordRegisterFormVisibility, + decoration: InputDecoration( + isDense: true, + labelText: + FFLocalizations.of( + context) + .getText( + '0firji8l' /* Senha */, + ), + labelStyle: FlutterFlowTheme + .of(context) + .labelLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .customColor1, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + focusedBorder: + OutlineInputBorder( + borderSide: const BorderSide( + color: + Color(0xFF1AAB5F), + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + errorBorder: + OutlineInputBorder( + borderSide: const BorderSide( + color: + Color(0xFFFF5963), + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + focusedErrorBorder: + OutlineInputBorder( + borderSide: const BorderSide( + color: + Color(0xFFFF5963), + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), + ), + filled: true, + fillColor: + FlutterFlowTheme.of( + context) + .primaryBackground, + suffixIcon: InkWell( + onTap: () => setState( + () => _model + .passwordRegisterFormVisibility = + !_model + .passwordRegisterFormVisibility, + ), + focusNode: FocusNode( + skipTraversal: true), + child: Icon( + _model.passwordRegisterFormVisibility + ? Icons + .visibility_outlined + : Icons + .visibility_off_outlined, + color: + FlutterFlowTheme.of( + context) + .accent1, + size: 24.0, + ), + ), + ), + style: FlutterFlowTheme.of( context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - 'Plus Jakarta Sans'), + .bodyLarge + .override( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .primaryText, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + validator: _model + .passwordRegisterFormTextControllerValidator + .asValidator(context), ), - validator: _model - .passwordRegisterFormTextControllerValidator - .asValidator(context), - ), + ), + ), + ], ), ), Padding( padding: const EdgeInsetsDirectional.fromSTEB( 0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - onPressed: () async { - var shouldSetState = false; - _model.signUp = await action_blocks - .signUpActionApp( - context, - name: _model - .nameRegisterFormTextController - .text, - passwd: _model - .passwordRegisterFormTextController - .text, - email: _model - .emailRegisterFormTextController - .text, - device: FFAppState().device, - ); - shouldSetState = true; - if (_model.signUp == true) { - await widget - .toggleOnBoardingPageAction - ?.call( - 'SignIn', - ); - } else { - if (shouldSetState) { - setState(() {}); - } - return; - } + onPressed: (((_model.nameRegisterFormTextController + .text != + '') || + ((_model.nameRegisterFormFocusNode?.hasFocus ?? + false) != + null)) && + ((_model.emailRegisterFormTextController + .text != + '') || + ((_model.emailRegisterFormFocusNode + ?.hasFocus ?? + false) != + null)) && + ((_model.passwordRegisterFormTextController + .text != + '') || + ((_model.passwordRegisterFormFocusNode + ?.hasFocus ?? + false) != + null))) + ? null + : () async { + var shouldSetState = false; + _model.signUp = + await action_blocks + .signUpActionApp( + context, + name: _model + .nameRegisterFormTextController + .text, + passwd: _model + .passwordRegisterFormTextController + .text, + email: _model + .emailRegisterFormTextController + .text, + device: FFAppState().device, + ); + shouldSetState = true; + if (_model.signUp == true) { + await widget + .toggleOnBoardingPageAction + ?.call( + 'SignIn', + ); + } else { + if (shouldSetState) { + setState(() {}); + } + return; + } - if (shouldSetState) { - setState(() {}); - } - }, + if (shouldSetState) { + setState(() {}); + } + }, text: FFLocalizations.of(context) .getText( 'rnvdwzei' /* Cadastrar-se */, diff --git a/lib/flutter_flow/internationalization.dart b/lib/flutter_flow/internationalization.dart index aefab2b9..fce3cfaa 100644 --- a/lib/flutter_flow/internationalization.dart +++ b/lib/flutter_flow/internationalization.dart @@ -414,6 +414,84 @@ final kTranslationsMap = >>[ 'en': '', }, }, + // acessHistoryPage + { + 'rjdp7j73': { + 'pt': 'Visitantes', + 'en': 'Visitors', + }, + 'nhxs49l9': { + 'pt': 'Visitante: ', + 'en': 'Visitor:', + }, + 'x9jg3kfx': { + 'pt': 'Início em: ', + 'en': 'Beginning in:', + }, + 'dh8ib64e': { + 'pt': 'Fim em: ', + 'en': 'End in:', + }, + '1qa1ok6g': { + 'pt': 'Todos', + 'en': 'All', + }, + 'ftl6katl': { + 'pt': 'Visitante: ', + 'en': 'Visitor:', + }, + 'dbquxozy': { + 'pt': 'Início em: ', + 'en': 'Beginning in:', + }, + 'gjw5vcc6': { + 'pt': 'Fim em: ', + 'en': 'End in:', + }, + 'rvac7h59': { + 'pt': 'Moradores', + 'en': 'Residents', + }, + '0xbh5f3a': { + 'pt': 'Visitante: ', + 'en': 'Visitor:', + }, + 'gq3pp39j': { + 'pt': 'Início em: ', + 'en': 'Beginning in:', + }, + '7iaxwb8o': { + 'pt': 'Fim em: ', + 'en': 'End in:', + }, + '5uzkio93': { + 'pt': 'Home', + 'en': '', + }, + }, + // liberationHistory + { + 'dy0mx15f': { + 'pt': 'Label here...', + 'en': '', + }, + 'f77je6tr': { + 'pt': 'Visitante: ', + 'en': 'Visitor:', + }, + 'dkzewokx': { + 'pt': 'Início em: ', + 'en': 'Beginning in:', + }, + 'qi4mjhtw': { + 'pt': 'Fim em: ', + 'en': 'End in:', + }, + '1skj43ye': { + 'pt': 'Home', + 'en': '', + }, + }, // visitorDetailsModalTemplateComponent { 'kqzf7nx2': { @@ -723,6 +801,22 @@ final kTranslationsMap = >>[ 'pt': 'Senha', 'en': 'Password', }, + 'xhnawzcb': { + 'pt': 'Campo é necessário', + 'en': 'Field is required', + }, + '2ib9bf67': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', + }, + '9cs5wlmc': { + 'pt': 'Campo é necessário', + 'en': 'Field is required', + }, + 'rkxwb0sg': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', + }, 'k44tm7wo': { 'pt': 'Entrar', 'en': 'Sign-In', @@ -774,6 +868,30 @@ final kTranslationsMap = >>[ 'pt': 'Senha', 'en': 'Password', }, + '3bs10dfq': { + 'pt': 'Campo é necessário', + 'en': 'Field is required', + }, + 'ph22karc': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', + }, + 'mlvw63yj': { + 'pt': 'Campo é necessário', + 'en': 'Field is required', + }, + 'z0bv6wi2': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', + }, + '6nn79lmh': { + 'pt': 'Campo é necessário', + 'en': 'Field is required', + }, + 'rcikqhf1': { + 'pt': 'Please choose an option from the dropdown', + 'en': '', + }, 'rnvdwzei': { 'pt': 'Cadastrar-se', 'en': 'Sign-Up', diff --git a/lib/flutter_flow/nav/nav.dart b/lib/flutter_flow/nav/nav.dart index 7683f4b7..96587bc2 100644 --- a/lib/flutter_flow/nav/nav.dart +++ b/lib/flutter_flow/nav/nav.dart @@ -42,7 +42,7 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( ), ), ) - : const PeopleOnThePropertyPageWidget(), + : const LiberationHistoryWidget(), routes: [ FFRoute( name: '_initialize', @@ -57,7 +57,7 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( ), ), ) - : const PeopleOnThePropertyPageWidget(), + : const LiberationHistoryWidget(), ), FFRoute( name: 'homePage', @@ -127,6 +127,16 @@ GoRouter createRouter(AppStateNotifier appStateNotifier) => GoRouter( name: 'peopleOnThePropertyPage', path: '/peopleOnThePropertyPage', builder: (context, params) => const PeopleOnThePropertyPageWidget(), + ), + FFRoute( + name: 'acessHistoryPage', + path: '/acessHistoryPage', + builder: (context, params) => const AcessHistoryPageWidget(), + ), + FFRoute( + name: 'liberationHistory', + path: '/liberationHistory', + builder: (context, params) => const LiberationHistoryWidget(), ) ].map((r) => r.toRoute(appStateNotifier)).toList(), ); diff --git a/lib/index.dart b/lib/index.dart index b7cda167..80625c94 100644 --- a/lib/index.dart +++ b/lib/index.dart @@ -12,3 +12,7 @@ export '/pages/fast_pass_page/fast_pass_page_widget.dart' show FastPassPageWidget; export '/pages/people_on_the_property_page/people_on_the_property_page_widget.dart' show PeopleOnThePropertyPageWidget; +export '/pages/acess_history_page/acess_history_page_widget.dart' + show AcessHistoryPageWidget; +export '/pages/liberation_history/liberation_history_widget.dart' + show LiberationHistoryWidget; diff --git a/lib/pages/acess_history_page/acess_history_page_model.dart b/lib/pages/acess_history_page/acess_history_page_model.dart new file mode 100644 index 00000000..79f51b52 --- /dev/null +++ b/lib/pages/acess_history_page/acess_history_page_model.dart @@ -0,0 +1,22 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'acess_history_page_widget.dart' show AcessHistoryPageWidget; +import 'package:flutter/material.dart'; + +class AcessHistoryPageModel extends FlutterFlowModel { + /// State fields for stateful widgets in this page. + + final unfocusNode = FocusNode(); + // State field(s) for TabBar widget. + TabController? tabBarController; + int get tabBarCurrentIndex => + tabBarController != null ? tabBarController!.index : 0; + + @override + void initState(BuildContext context) {} + + @override + void dispose() { + unfocusNode.dispose(); + tabBarController?.dispose(); + } +} diff --git a/lib/pages/acess_history_page/acess_history_page_widget.dart b/lib/pages/acess_history_page/acess_history_page_widget.dart new file mode 100644 index 00000000..395663af --- /dev/null +++ b/lib/pages/acess_history_page/acess_history_page_widget.dart @@ -0,0 +1,1718 @@ +import '/backend/api_requests/api_calls.dart'; +import '/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/custom_functions.dart' as functions; +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_spinkit/flutter_spinkit.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:provider/provider.dart'; +import 'acess_history_page_model.dart'; +export 'acess_history_page_model.dart'; + +class AcessHistoryPageWidget extends StatefulWidget { + const AcessHistoryPageWidget({super.key}); + + @override + State createState() => _AcessHistoryPageWidgetState(); +} + +class _AcessHistoryPageWidgetState extends State + with TickerProviderStateMixin { + late AcessHistoryPageModel _model; + + final scaffoldKey = GlobalKey(); + + @override + void initState() { + super.initState(); + _model = createModel(context, () => AcessHistoryPageModel()); + + _model.tabBarController = TabController( + vsync: this, + length: 3, + initialIndex: 0, + )..addListener(() => setState(() {})); + } + + @override + void dispose() { + _model.dispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + context.watch(); + + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + body: SafeArea( + top: true, + child: Column( + children: [ + Align( + alignment: const Alignment(0.0, 0), + child: TabBar( + labelColor: FlutterFlowTheme.of(context).primaryText, + unselectedLabelColor: + FlutterFlowTheme.of(context).primaryText, + labelStyle: FlutterFlowTheme.of(context).titleMedium.override( + fontFamily: + FlutterFlowTheme.of(context).titleMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).titleMediumFamily), + ), + unselectedLabelStyle: const TextStyle(), + indicatorColor: FlutterFlowTheme.of(context).primary, + padding: const EdgeInsets.all(4.0), + tabs: [ + Tab( + text: FFLocalizations.of(context).getText( + 'rjdp7j73' /* Visitantes */, + ), + ), + Tab( + text: FFLocalizations.of(context).getText( + '1qa1ok6g' /* Todos */, + ), + ), + Tab( + text: FFLocalizations.of(context).getText( + 'rvac7h59' /* Moradores */, + ), + ), + ], + controller: _model.tabBarController, + onTap: (i) async { + [() async {}, () async {}, () async {}][i](); + }, + ), + ), + Expanded( + child: TabBarView( + controller: _model.tabBarController, + children: [ + Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: Container( + width: double.infinity, + height: double.infinity, + decoration: const BoxDecoration(), + child: FutureBuilder( + future: PhpGroup.getVisitsCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitas', + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context) + .primary, + size: 50.0, + ), + ), + ); + } + final wrapGetVisitsResponse = snapshot.data!; + return Builder( + builder: (context) { + final visitaWrap = PhpGroup.getVisitsCall + .visitasList( + wrapGetVisitsResponse.jsonBody, + ) + ?.toList() ?? + []; + return Wrap( + spacing: 2.0, + runSpacing: 1.0, + alignment: WrapAlignment.start, + crossAxisAlignment: + WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: List.generate(visitaWrap.length, + (visitaWrapIndex) { + final visitaWrapItem = + visitaWrap[visitaWrapIndex]; + return Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: + Colors.transparent, + enableDrag: false, + useSafeArea: true, + 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: + VisitDetailsModalTemplateComponentWidget( + visitStatusStr: + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + ).toString(), + visitStartDateStr: + getJsonField( + visitaWrapItem, + r'''$.VAW_DTINICIO''', + ).toString(), + visitEndDateStr: + getJsonField( + visitaWrapItem, + r'''$.VAW_DTFIM''', + ).toString(), + visitReasonStr: + getJsonField( + visitaWrapItem, + r'''$.MOT_DESCRICAO''', + ).toString(), + visitLevelStr: + getJsonField( + visitaWrapItem, + r'''$.NAC_DESCRICAO''', + ).toString(), + visitTempStr: + getJsonField( + visitaWrapItem, + r'''$.VTE_UNICA''', + ).toString(), + visitObsStr: + getJsonField( + visitaWrapItem, + r'''$.VAW_OBS''', + ).toString(), + visitorImgPath: + valueOrDefault< + String>( + 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitaWrapItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E', + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + visitorStrList: + getJsonField( + visitaWrapItem, + r'''$.VTE_DOCUMENTO''', + ).toString(), + visitIdStr: + getJsonField( + visitaWrapItem, + r'''$.VAW_ID''', + ).toString(), + visitorJsonList: + PhpGroup + .getVisitsCall + .visitasList( + wrapGetVisitsResponse + .jsonBody, + ), + updateToggleIdx: + () async {}, + repeatVisitSchedule: + () async {}, + ), + ), + ); + }, + ).then((value) => + safeSetState(() {})); + }, + child: Card( + clipBehavior: + Clip.antiAliasWithSaveLayer, + color: + FlutterFlowTheme.of(context) + .secondaryBackground, + elevation: 5.0, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(8.0), + ), + child: Container( + width: 350.0, + height: 115.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of( + context) + .secondaryBackground, + ), + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Expanded( + child: Container( + width: 100.0, + height: 100.0, + decoration: + const BoxDecoration(), + child: Column( + mainAxisSize: + MainAxisSize.max, + children: [ + Row( + mainAxisSize: + MainAxisSize + .max, + children: [ + Text( + FFLocalizations.of( + context) + .getText( + 'nhxs49l9' /* Visitante: */, + ), + 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), + ), + ), + Align( + alignment: + const AlignmentDirectional( + -1.0, + -1.0), + child: Text( + getJsonField( + visitaWrapItem, + r'''$.VTE_NOME''', + ).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( + 'x9jg3kfx' /* Início em: */, + ), + 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( + visitaWrapItem, + r'''$.VAW_DTINICIO''', + ).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( + 'dh8ib64e' /* Fim em: */, + ), + 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( + visitaWrapItem, + r'''$.VAW_DTFIM''', + ).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)), + ), + Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 10.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: 200.0, + height: 27.0, + decoration: + BoxDecoration( + color: valueOrDefault< + Color>( + () { + if (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"A\"') { + return FlutterFlowTheme.of(context) + .success; + } else if (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"C\"') { + return FlutterFlowTheme.of(context) + .error; + } else if (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"I\"') { + return FlutterFlowTheme.of(context) + .warning; + } else { + return FlutterFlowTheme.of(context) + .primary; + } + }(), + FlutterFlowTheme.of( + context) + .primary, + ), + borderRadius: + BorderRadius.circular( + 5.0), + ), + child: Align( + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Text( + () { + if (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"A\"') { + return FFLocalizations.of(context) + .getVariableText( + ptText: + 'Ativo', + enText: + 'Active', + ); + } else if ((functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"F\"') || + (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"C\"') || + (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"B\"') || + (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"I\"')) { + return FFLocalizations.of(context) + .getVariableText( + ptText: + 'Cancelado', + enText: + 'Canceled', + ); + } else { + return FFLocalizations.of(context) + .getVariableText( + ptText: + 'Pendente', + enText: + 'Pending', + ); + } + }(), + 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( + height: 3.0)), + ), + ), + ), + ClipRRect( + borderRadius: + BorderRadius.circular( + 0.0), + child: CachedNetworkImage( + fadeInDuration: + const Duration( + milliseconds: + 500), + fadeOutDuration: + const Duration( + milliseconds: + 500), + imageUrl: + valueOrDefault< + String>( + 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitaWrapItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E', + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + fit: BoxFit.cover, + ), + ), + ], + ), + ), + ), + ), + ); + }), + ); + }, + ); + }, + ), + ), + ), + ].addToStart(const SizedBox(height: 30.0)), + ), + Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: Container( + width: double.infinity, + height: double.infinity, + decoration: const BoxDecoration(), + child: FutureBuilder( + future: PhpGroup.getVisitsCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitas', + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context) + .primary, + size: 50.0, + ), + ), + ); + } + final wrapGetVisitsResponse = snapshot.data!; + return Builder( + builder: (context) { + final visitaWrap = PhpGroup.getVisitsCall + .visitasList( + wrapGetVisitsResponse.jsonBody, + ) + ?.toList() ?? + []; + return Wrap( + spacing: 2.0, + runSpacing: 1.0, + alignment: WrapAlignment.start, + crossAxisAlignment: + WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: List.generate(visitaWrap.length, + (visitaWrapIndex) { + final visitaWrapItem = + visitaWrap[visitaWrapIndex]; + return Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: + Colors.transparent, + enableDrag: false, + useSafeArea: true, + 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: + VisitDetailsModalTemplateComponentWidget( + visitStatusStr: + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + ).toString(), + visitStartDateStr: + getJsonField( + visitaWrapItem, + r'''$.VAW_DTINICIO''', + ).toString(), + visitEndDateStr: + getJsonField( + visitaWrapItem, + r'''$.VAW_DTFIM''', + ).toString(), + visitReasonStr: + getJsonField( + visitaWrapItem, + r'''$.MOT_DESCRICAO''', + ).toString(), + visitLevelStr: + getJsonField( + visitaWrapItem, + r'''$.NAC_DESCRICAO''', + ).toString(), + visitTempStr: + getJsonField( + visitaWrapItem, + r'''$.VTE_UNICA''', + ).toString(), + visitObsStr: + getJsonField( + visitaWrapItem, + r'''$.VAW_OBS''', + ).toString(), + visitorImgPath: + valueOrDefault< + String>( + 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitaWrapItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E', + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + visitorStrList: + getJsonField( + visitaWrapItem, + r'''$.VTE_DOCUMENTO''', + ).toString(), + visitIdStr: + getJsonField( + visitaWrapItem, + r'''$.VAW_ID''', + ).toString(), + visitorJsonList: + PhpGroup + .getVisitsCall + .visitasList( + wrapGetVisitsResponse + .jsonBody, + ), + updateToggleIdx: + () async {}, + repeatVisitSchedule: + () async {}, + ), + ), + ); + }, + ).then((value) => + safeSetState(() {})); + }, + child: Card( + clipBehavior: + Clip.antiAliasWithSaveLayer, + color: + FlutterFlowTheme.of(context) + .secondaryBackground, + elevation: 5.0, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(8.0), + ), + child: Container( + width: 350.0, + height: 115.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of( + context) + .secondaryBackground, + ), + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Expanded( + child: Container( + width: 100.0, + height: 100.0, + decoration: + const BoxDecoration(), + child: Column( + mainAxisSize: + MainAxisSize.max, + children: [ + Row( + mainAxisSize: + MainAxisSize + .max, + children: [ + Text( + FFLocalizations.of( + context) + .getText( + 'ftl6katl' /* Visitante: */, + ), + 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), + ), + ), + Align( + alignment: + const AlignmentDirectional( + -1.0, + -1.0), + child: Text( + getJsonField( + visitaWrapItem, + r'''$.VTE_NOME''', + ).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( + 'dbquxozy' /* Início em: */, + ), + 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( + visitaWrapItem, + r'''$.VAW_DTINICIO''', + ).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( + 'gjw5vcc6' /* Fim em: */, + ), + 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( + visitaWrapItem, + r'''$.VAW_DTFIM''', + ).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)), + ), + Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 10.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: 200.0, + height: 27.0, + decoration: + BoxDecoration( + color: valueOrDefault< + Color>( + () { + if (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"A\"') { + return FlutterFlowTheme.of(context) + .success; + } else if (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"C\"') { + return FlutterFlowTheme.of(context) + .error; + } else if (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"I\"') { + return FlutterFlowTheme.of(context) + .warning; + } else { + return FlutterFlowTheme.of(context) + .primary; + } + }(), + FlutterFlowTheme.of( + context) + .primary, + ), + borderRadius: + BorderRadius.circular( + 5.0), + ), + child: Align( + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Text( + () { + if (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"A\"') { + return FFLocalizations.of(context) + .getVariableText( + ptText: + 'Ativo', + enText: + 'Active', + ); + } else if ((functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"F\"') || + (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"C\"') || + (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"B\"') || + (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"I\"')) { + return FFLocalizations.of(context) + .getVariableText( + ptText: + 'Cancelado', + enText: + 'Canceled', + ); + } else { + return FFLocalizations.of(context) + .getVariableText( + ptText: + 'Pendente', + enText: + 'Pending', + ); + } + }(), + 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( + height: 3.0)), + ), + ), + ), + ClipRRect( + borderRadius: + BorderRadius.circular( + 0.0), + child: CachedNetworkImage( + fadeInDuration: + const Duration( + milliseconds: + 500), + fadeOutDuration: + const Duration( + milliseconds: + 500), + imageUrl: + valueOrDefault< + String>( + 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitaWrapItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E', + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + fit: BoxFit.cover, + ), + ), + ], + ), + ), + ), + ), + ); + }), + ); + }, + ); + }, + ), + ), + ), + ].addToStart(const SizedBox(height: 30.0)), + ), + Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: Container( + width: double.infinity, + height: double.infinity, + decoration: const BoxDecoration(), + child: FutureBuilder( + future: PhpGroup.getVisitsCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitas', + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context) + .primary, + size: 50.0, + ), + ), + ); + } + final wrapGetVisitsResponse = snapshot.data!; + return Builder( + builder: (context) { + final visitaWrap = PhpGroup.getVisitsCall + .visitasList( + wrapGetVisitsResponse.jsonBody, + ) + ?.toList() ?? + []; + return Wrap( + spacing: 2.0, + runSpacing: 1.0, + alignment: WrapAlignment.start, + crossAxisAlignment: + WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: List.generate(visitaWrap.length, + (visitaWrapIndex) { + final visitaWrapItem = + visitaWrap[visitaWrapIndex]; + return Align( + alignment: + const AlignmentDirectional(0.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: + Colors.transparent, + enableDrag: false, + useSafeArea: true, + 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: + VisitDetailsModalTemplateComponentWidget( + visitStatusStr: + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + ).toString(), + visitStartDateStr: + getJsonField( + visitaWrapItem, + r'''$.VAW_DTINICIO''', + ).toString(), + visitEndDateStr: + getJsonField( + visitaWrapItem, + r'''$.VAW_DTFIM''', + ).toString(), + visitReasonStr: + getJsonField( + visitaWrapItem, + r'''$.MOT_DESCRICAO''', + ).toString(), + visitLevelStr: + getJsonField( + visitaWrapItem, + r'''$.NAC_DESCRICAO''', + ).toString(), + visitTempStr: + getJsonField( + visitaWrapItem, + r'''$.VTE_UNICA''', + ).toString(), + visitObsStr: + getJsonField( + visitaWrapItem, + r'''$.VAW_OBS''', + ).toString(), + visitorImgPath: + valueOrDefault< + String>( + 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitaWrapItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E', + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + visitorStrList: + getJsonField( + visitaWrapItem, + r'''$.VTE_DOCUMENTO''', + ).toString(), + visitIdStr: + getJsonField( + visitaWrapItem, + r'''$.VAW_ID''', + ).toString(), + visitorJsonList: + PhpGroup + .getVisitsCall + .visitasList( + wrapGetVisitsResponse + .jsonBody, + ), + updateToggleIdx: + () async {}, + repeatVisitSchedule: + () async {}, + ), + ), + ); + }, + ).then((value) => + safeSetState(() {})); + }, + child: Card( + clipBehavior: + Clip.antiAliasWithSaveLayer, + color: + FlutterFlowTheme.of(context) + .secondaryBackground, + elevation: 5.0, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(8.0), + ), + child: Container( + width: 350.0, + height: 115.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of( + context) + .secondaryBackground, + ), + child: Row( + mainAxisSize: + MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Expanded( + child: Container( + width: 100.0, + height: 100.0, + decoration: + const BoxDecoration(), + child: Column( + mainAxisSize: + MainAxisSize.max, + children: [ + Row( + mainAxisSize: + MainAxisSize + .max, + children: [ + Text( + FFLocalizations.of( + context) + .getText( + '0xbh5f3a' /* Visitante: */, + ), + 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), + ), + ), + Align( + alignment: + const AlignmentDirectional( + -1.0, + -1.0), + child: Text( + getJsonField( + visitaWrapItem, + r'''$.VTE_NOME''', + ).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( + 'gq3pp39j' /* Início em: */, + ), + 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( + visitaWrapItem, + r'''$.VAW_DTINICIO''', + ).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( + '7iaxwb8o' /* Fim em: */, + ), + 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( + visitaWrapItem, + r'''$.VAW_DTFIM''', + ).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)), + ), + Align( + alignment: + const AlignmentDirectional( + -1.0, + 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 10.0, + 0.0, + 0.0, + 0.0), + child: + Container( + width: 200.0, + height: 27.0, + decoration: + BoxDecoration( + color: valueOrDefault< + Color>( + () { + if (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"A\"') { + return FlutterFlowTheme.of(context) + .success; + } else if (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"C\"') { + return FlutterFlowTheme.of(context) + .error; + } else if (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"I\"') { + return FlutterFlowTheme.of(context) + .warning; + } else { + return FlutterFlowTheme.of(context) + .primary; + } + }(), + FlutterFlowTheme.of( + context) + .primary, + ), + borderRadius: + BorderRadius.circular( + 5.0), + ), + child: Align( + alignment: + const AlignmentDirectional( + 0.0, + 0.0), + child: Text( + () { + if (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"A\"') { + return FFLocalizations.of(context) + .getVariableText( + ptText: + 'Ativo', + enText: + 'Active', + ); + } else if ((functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"F\"') || + (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"C\"') || + (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"B\"') || + (functions.jsonToStr(getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"I\"')) { + return FFLocalizations.of(context) + .getVariableText( + ptText: + 'Cancelado', + enText: + 'Canceled', + ); + } else { + return FFLocalizations.of(context) + .getVariableText( + ptText: + 'Pendente', + enText: + 'Pending', + ); + } + }(), + 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( + height: 3.0)), + ), + ), + ), + ClipRRect( + borderRadius: + BorderRadius.circular( + 0.0), + child: CachedNetworkImage( + fadeInDuration: + const Duration( + milliseconds: + 500), + fadeOutDuration: + const Duration( + milliseconds: + 500), + imageUrl: + valueOrDefault< + String>( + 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitaWrapItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E', + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + fit: BoxFit.cover, + ), + ), + ], + ), + ), + ), + ), + ); + }), + ); + }, + ); + }, + ), + ), + ), + ].addToStart(const SizedBox(height: 30.0)), + ), + ], + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/liberation_history/liberation_history_model.dart b/lib/pages/liberation_history/liberation_history_model.dart new file mode 100644 index 00000000..82830046 --- /dev/null +++ b/lib/pages/liberation_history/liberation_history_model.dart @@ -0,0 +1,23 @@ +import '/flutter_flow/flutter_flow_util.dart'; +import 'liberation_history_widget.dart' show LiberationHistoryWidget; +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; + String? Function(BuildContext, String?)? textControllerValidator; + + @override + void initState(BuildContext context) {} + + @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 new file mode 100644 index 00000000..f66a234a --- /dev/null +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -0,0 +1,680 @@ +import '/backend/api_requests/api_calls.dart'; +import '/components/templates_components/visit_details_modal_template_component/visit_details_modal_template_component_widget.dart'; +import '/flutter_flow/flutter_flow_theme.dart'; +import '/flutter_flow/flutter_flow_util.dart'; +import '/flutter_flow/custom_functions.dart' as functions; +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_spinkit/flutter_spinkit.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:provider/provider.dart'; +import 'liberation_history_model.dart'; +export 'liberation_history_model.dart'; + +class LiberationHistoryWidget extends StatefulWidget { + const LiberationHistoryWidget({super.key}); + + @override + State createState() => + _LiberationHistoryWidgetState(); +} + +class _LiberationHistoryWidgetState extends State { + late LiberationHistoryModel _model; + + final scaffoldKey = GlobalKey(); + + @override + void initState() { + super.initState(); + _model = createModel(context, () => LiberationHistoryModel()); + + _model.textController ??= TextEditingController(); + _model.textFieldFocusNode ??= FocusNode(); + } + + @override + void dispose() { + _model.dispose(); + + super.dispose(); + } + + @override + Widget build(BuildContext context) { + context.watch(); + + return GestureDetector( + onTap: () => _model.unfocusNode.canRequestFocus + ? FocusScope.of(context).requestFocus(_model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Scaffold( + key: scaffoldKey, + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + body: SafeArea( + top: true, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: double.infinity, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).secondaryBackground, + ), + alignment: const AlignmentDirectional(0.0, -1.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0), + child: TextFormField( + controller: _model.textController, + focusNode: _model.textFieldFocusNode, + autofocus: true, + obscureText: false, + decoration: InputDecoration( + labelText: FFLocalizations.of(context).getText( + 'dy0mx15f' /* Label here... */, + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context).labelMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).labelMediumFamily), + ), + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).alternate, + width: 2.0, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 2.0, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.0, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: UnderlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.0, + ), + borderRadius: BorderRadius.circular(8.0), + ), + prefixIcon: const Icon( + Icons.search_sharp, + ), + ), + 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: Container( + width: double.infinity, + height: double.infinity, + decoration: const BoxDecoration(), + child: FutureBuilder( + future: PhpGroup.getVisitsCall.call( + devUUID: FFAppState().devUUID, + userUUID: FFAppState().userUUID, + cliID: FFAppState().cliUUID, + atividade: 'getVisitas', + ), + builder: (context, snapshot) { + // Customize what your widget looks like when it's loading. + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: FlutterFlowTheme.of(context).primary, + size: 50.0, + ), + ), + ); + } + final wrapGetVisitsResponse = snapshot.data!; + return Builder( + builder: (context) { + final visitaWrap = PhpGroup.getVisitsCall + .visitasList( + wrapGetVisitsResponse.jsonBody, + ) + ?.toList() ?? + []; + return Wrap( + spacing: 2.0, + runSpacing: 1.0, + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.start, + direction: Axis.horizontal, + runAlignment: WrapAlignment.start, + verticalDirection: VerticalDirection.down, + clipBehavior: Clip.none, + children: List.generate(visitaWrap.length, + (visitaWrapIndex) { + final visitaWrapItem = + visitaWrap[visitaWrapIndex]; + return Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: Colors.transparent, + enableDrag: false, + useSafeArea: true, + 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: + VisitDetailsModalTemplateComponentWidget( + visitStatusStr: getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + ).toString(), + visitStartDateStr: getJsonField( + visitaWrapItem, + r'''$.VAW_DTINICIO''', + ).toString(), + visitEndDateStr: getJsonField( + visitaWrapItem, + r'''$.VAW_DTFIM''', + ).toString(), + visitReasonStr: getJsonField( + visitaWrapItem, + r'''$.MOT_DESCRICAO''', + ).toString(), + visitLevelStr: getJsonField( + visitaWrapItem, + r'''$.NAC_DESCRICAO''', + ).toString(), + visitTempStr: getJsonField( + visitaWrapItem, + r'''$.VTE_UNICA''', + ).toString(), + visitObsStr: getJsonField( + visitaWrapItem, + r'''$.VAW_OBS''', + ).toString(), + visitorImgPath: + valueOrDefault( + 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitaWrapItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E', + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + visitorStrList: getJsonField( + visitaWrapItem, + r'''$.VTE_DOCUMENTO''', + ).toString(), + visitIdStr: getJsonField( + visitaWrapItem, + r'''$.VAW_ID''', + ).toString(), + visitorJsonList: PhpGroup + .getVisitsCall + .visitasList( + wrapGetVisitsResponse.jsonBody, + ), + updateToggleIdx: () async {}, + repeatVisitSchedule: () async {}, + ), + ), + ); + }, + ).then((value) => safeSetState(() {})); + }, + child: Card( + clipBehavior: Clip.antiAliasWithSaveLayer, + color: FlutterFlowTheme.of(context) + .secondaryBackground, + elevation: 5.0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8.0), + ), + child: Container( + width: 350.0, + height: 115.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .secondaryBackground, + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Container( + width: 100.0, + height: 100.0, + decoration: const BoxDecoration(), + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Row( + mainAxisSize: + MainAxisSize.max, + children: [ + Text( + FFLocalizations.of( + context) + .getText( + 'f77je6tr' /* Visitante: */, + ), + 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), + ), + ), + Align( + alignment: + const AlignmentDirectional( + -1.0, -1.0), + child: Text( + getJsonField( + visitaWrapItem, + r'''$.VTE_NOME''', + ).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( + 'dkzewokx' /* Início em: */, + ), + 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( + visitaWrapItem, + r'''$.VAW_DTINICIO''', + ).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( + 'qi4mjhtw' /* Fim em: */, + ), + 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( + visitaWrapItem, + r'''$.VAW_DTFIM''', + ).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)), + ), + Align( + alignment: + const AlignmentDirectional( + -1.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 10.0, + 0.0, + 0.0, + 0.0), + child: Container( + width: 200.0, + height: 27.0, + decoration: + BoxDecoration( + color: valueOrDefault< + Color>( + () { + if (functions + .jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"A\"') { + return FlutterFlowTheme.of( + context) + .success; + } else if (functions + .jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"C\"') { + return FlutterFlowTheme.of( + context) + .error; + } else if (functions + .jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"I\"') { + return FlutterFlowTheme.of( + context) + .warning; + } else { + return FlutterFlowTheme.of( + context) + .primary; + } + }(), + FlutterFlowTheme.of( + context) + .primary, + ), + borderRadius: + BorderRadius + .circular( + 5.0), + ), + child: Align( + alignment: + const AlignmentDirectional( + 0.0, 0.0), + child: Text( + () { + if (functions + .jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"A\"') { + return FFLocalizations.of( + context) + .getVariableText( + ptText: + 'Ativo', + enText: + 'Active', + ); + } else if ((functions + .jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"F\"') || + (functions.jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"C\"') || + (functions.jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"B\"') || + (functions.jsonToStr( + getJsonField( + visitaWrapItem, + r'''$.VAW_STATUS''', + )) == + '\"I\"')) { + return FFLocalizations.of( + context) + .getVariableText( + ptText: + 'Cancelado', + enText: + 'Canceled', + ); + } else { + return FFLocalizations.of( + context) + .getVariableText( + ptText: + 'Pendente', + enText: + 'Pending', + ); + } + }(), + 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(height: 3.0)), + ), + ), + ), + ClipRRect( + borderRadius: + BorderRadius.circular(0.0), + child: CachedNetworkImage( + fadeInDuration: + const Duration(milliseconds: 500), + fadeOutDuration: + const Duration(milliseconds: 500), + imageUrl: valueOrDefault( + 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitaWrapItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E', + 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', + ), + fit: BoxFit.cover, + ), + ), + ], + ), + ), + ), + ), + ); + }), + ); + }, + ); + }, + ), + ), + ), + ].addToStart(const SizedBox(height: 30.0)), + ), + ), + ), + ); + } +} 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 7f94a91d..613a67c1 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 @@ -2115,6 +2115,7 @@ class _ScheduleCompleteVisitPageWidgetState ), textAlign: TextAlign.start, maxLines: null, + maxLength: 80, validator: _model .textController3Validator .asValidator(context), @@ -2671,12 +2672,13 @@ class _ScheduleCompleteVisitPageWidgetState '\"A\"') { return FlutterFlowTheme.of(context) .success; - } else if (functions.jsonToStr( - getJsonField( - visitaWrapItem, - r'''$.VAW_STATUS''', - )) == - '\"C\"') { + } else if ((visitStatusStr == 'C') || + (visitStatusStr == + 'F') || + (visitStatusStr == + 'B') || + (visitStatusStr == + 'I')) { return FlutterFlowTheme.of(context) .error; } else if (functions 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 e072f5d5..2dd72163 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 @@ -824,6 +824,7 @@ class _ScheduleProvisionalVisitPageWidgetState ), textAlign: TextAlign.start, maxLines: null, + maxLength: 100, validator: _model.textController3Validator .asValidator(context), ),