From c22e1bff5e9f5c3a4eac4ebb92e5141dfa0b305d Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 1 Nov 2024 09:39:09 -0300 Subject: [PATCH 1/7] Feat: Ajuste na responsividade da tela de Welcome, Login, Registe e Forgot Password --- .vscode/settings.json | 13 +- android/app/build.gradle | 6 +- ...ot_password_template_component_widget.dart | 426 +++--- .../sign_in_template_component_widget.dart | 1203 ++++++++++------- .../sign_up_template_component_widget.dart | 119 +- .../welcome_template_component_widget.dart | 199 +-- lib/main.dart | 17 +- lib/shared/utils/text_util.dart | 31 + 8 files changed, 1160 insertions(+), 854 deletions(-) create mode 100644 lib/shared/utils/text_util.dart diff --git a/.vscode/settings.json b/.vscode/settings.json index 9892690e..7f89760e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,8 @@ { - "editor.quickSuggestions": { - "comments": "off", - "strings": "off", - "other": "off" - } -} \ No newline at end of file + "editor.quickSuggestions": { + "comments": "off", + "strings": "off", + "other": "off" + }, + "java.configuration.updateBuildConfiguration": "automatic" +} diff --git a/android/app/build.gradle b/android/app/build.gradle index af88cf55..6ec0d534 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -57,12 +57,12 @@ android { compileOptions { coreLibraryDesugaringEnabled true - sourceCompatibility JavaVersion.VERSION_18 - targetCompatibility JavaVersion.VERSION_18 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = "18" + jvmTarget = "11" } signingConfigs { 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 70f2ede6..32e05b13 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 @@ -1,4 +1,3 @@ - import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -53,173 +52,103 @@ class _ForgotPasswordTemplateComponentWidgetState Widget build(BuildContext context) { return Align( alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: double.infinity, - height: 300.0, - constraints: const BoxConstraints( - maxWidth: 570.0, - ), - 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: SingleChildScrollView( + child: Container( + width: double.infinity, + constraints: const BoxConstraints( + maxWidth: 570.0, ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (responsiveVisibility( - context: context, - phone: false, - tablet: false, - )) - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), - child: InkWell( - key: const ValueKey('BackButton'), - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - context.safePop(); - }, - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - const Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0.0, 12.0, 0.0, 12.0), - child: Icon( - Icons.arrow_back_rounded, - color: Color(0xFF15161E), - size: 24.0, - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), - child: Text( - '', - style: FlutterFlowTheme.of(context).bodyMedium.override( + 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: Padding( + padding: const EdgeInsets.fromLTRB(0, 25, 0, 25), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (responsiveVisibility( + context: context, + phone: false, + tablet: false, + )) + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 16.0, 0.0, 16.0, 8.0), + child: InkWell( + key: const ValueKey('BackButton'), + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + context.safePop(); + }, + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + const Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0.0, 12.0, 0.0, 12.0), + child: Icon( + Icons.arrow_back_rounded, + color: Color(0xFF15161E), + size: 24.0, + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 12.0, 0.0, 0.0, 0.0), + child: Text( + '', + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( fontFamily: 'Plus Jakarta Sans', color: const Color(0xFF15161E), fontSize: 14.0, letterSpacing: 0.0, fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), ), - ), + ), + ), + ], ), - ], + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context) + .getText('xxm3ajsy' /* ESQUECEU SUA SENHA? */), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Outfit', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 24.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Outfit'), + ), ), ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText('xxm3ajsy' /* ESQUECEU SUA SENHA? */), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Outfit', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), - child: Text( - FFLocalizations.of(context).getText('wu2f7yzo' /* Não se preucupe nós vamos te a... */), - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), - ), - ), - ), - Form( - key: _model.formKey, - autovalidateMode: AutovalidateMode.onUserInteraction, - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - key: const ValueKey('recoveryTextFormField'), - controller: _model.emailAddressTextController, - focusNode: _model.emailAddressFocusNode, - onChanged: (_) => EasyDebounce.debounce( - '_model.emailAddressTextController', - const Duration(milliseconds: 500), - () => setState(() {}), - ), - autofocus: true, - autofillHints: const [AutofillHints.email], - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText('mtz8l7ft' /* E-mail */), - labelStyle: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primary, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - enabledBorder: OutlineInputBorder( - borderSide: const BorderSide( - color: Colors.black, - width: 2.00, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 2.00, - ), - borderRadius: BorderRadius.circular(12.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.00, - ), - borderRadius: BorderRadius.circular(12.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 2.00, - ), - borderRadius: BorderRadius.circular(12.0), - ), - contentPadding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 24.0, 20.0, 24.0), - suffixIcon: Icon( - Icons.email, - color: FlutterFlowTheme.of(context).primary, - size: 22.0, - ), - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 16.0, 4.0, 16.0, 4.0), + child: Text( + FFLocalizations.of(context).getText( + 'wu2f7yzo' /* Não se preucupe nós vamos te a... */), + style: FlutterFlowTheme.of(context).labelMedium.override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, fontSize: 14.0, @@ -228,62 +157,147 @@ class _ForgotPasswordTemplateComponentWidgetState useGoogleFonts: GoogleFonts.asMap() .containsKey('Plus Jakarta Sans'), ), - maxLines: null, - keyboardType: TextInputType.emailAddress, - cursorColor: FlutterFlowTheme.of(context).primary, - validator: _model.emailAddressTextControllerValidator - .asValidator(context), ), ), - ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), - child: FFButtonWidget( - key: const ValueKey('SendButtonWidget'), - onPressed: (_model.emailAddressTextController.text == '' || - !ValidatorUtil.isValidEmail( - _model.emailAddressTextController.text)) - ? null - : () async => AuthenticationService.forgotPassword(context, _model.emailAddressTextController.text), - - - text: FFLocalizations.of(context).getText( - '74rnd5bu' /* Enviar */, - ), - options: FFButtonOptions( - width: 270.0, - height: 50.0, + Form( + key: _model.formKey, + autovalidateMode: AutovalidateMode.onUserInteraction, + child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).primary, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: 'Plus Jakarta Sans', - color: Colors.white, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), + 16.0, 12.0, 16.0, 0.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + key: const ValueKey('recoveryTextFormField'), + controller: _model.emailAddressTextController, + focusNode: _model.emailAddressFocusNode, + onChanged: (_) => EasyDebounce.debounce( + '_model.emailAddressTextController', + const Duration(milliseconds: 500), + () => setState(() {}), ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, + autofocus: true, + autofillHints: const [AutofillHints.email], + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of(context) + .getText('mtz8l7ft' /* E-mail */), + labelStyle: + FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primary, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + enabledBorder: OutlineInputBorder( + borderSide: const BorderSide( + color: Colors.black, + width: 2.00, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 2.00, + ), + borderRadius: BorderRadius.circular(12.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.00, + ), + borderRadius: BorderRadius.circular(12.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 2.00, + ), + borderRadius: BorderRadius.circular(12.0), + ), + contentPadding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 24.0, 20.0, 24.0), + suffixIcon: Icon( + Icons.email, + color: FlutterFlowTheme.of(context).primary, + size: 22.0, + ), + ), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + maxLines: null, + keyboardType: TextInputType.emailAddress, + cursorColor: FlutterFlowTheme.of(context).primary, + validator: _model.emailAddressTextControllerValidator + .asValidator(context), + ), ), - disabledColor: FlutterFlowTheme.of(context).customColor5, - disabledTextColor: Colors.white, ), - showLoadingIndicator: true, ), - ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 24.0, 0.0, 0.0), + child: FFButtonWidget( + key: const ValueKey('SendButtonWidget'), + onPressed: (_model.emailAddressTextController.text == + '' || + !ValidatorUtil.isValidEmail( + _model.emailAddressTextController.text)) + ? null + : () async => AuthenticationService.forgotPassword( + context, _model.emailAddressTextController.text), + text: FFLocalizations.of(context).getText( + '74rnd5bu' /* Enviar */, + ), + options: FFButtonOptions( + width: 270.0, + height: 50.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context).primary, + textStyle: + FlutterFlowTheme.of(context).titleSmall.override( + fontFamily: 'Plus Jakarta Sans', + color: Colors.white, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + disabledColor: + FlutterFlowTheme.of(context).customColor5, + disabledTextColor: Colors.white, + ), + showLoadingIndicator: true, + ), + ), + ), + ], ), - ], + ), ), ), ); 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 9bd0b5e1..e7b8b9ca 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 @@ -100,8 +100,10 @@ class _SignInTemplateComponentWidgetState } bool _isFormInvalid() { - if (_model.emailAddressTextController.text == '' || _model.passwordTextController.text == '') return true; - if (!ValidatorUtil.isValidEmail(_model.emailAddressTextController.text)) return true; + if (_model.emailAddressTextController.text == '' || + _model.passwordTextController.text == '') return true; + if (!ValidatorUtil.isValidEmail(_model.emailAddressTextController.text)) + return true; return false; } @@ -112,225 +114,128 @@ class _SignInTemplateComponentWidgetState children: [ Expanded( flex: 6, - child: Container( - width: 100.0, - height: double.infinity, - decoration: const BoxDecoration(), - alignment: const AlignmentDirectional(0.0, -1.0), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 35.0, 0.0, 35.0), - child: Container( - width: 548.0, - height: 112.0, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(16.0)), - alignment: const AlignmentDirectional(0.0, 0.0), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(20.0), + child: Expanded( + child: Align( + alignment: const AlignmentDirectional(0.0, 1.0), child: Padding( - padding: const EdgeInsets.all(20.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: const EdgeInsets.all(3.0), - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'VAMOS LÁ! ENTRE COM A SUA CONTA', - enText: 'LET\'S GO! SIGN IN WITH YOUR ACCOUNT', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .displaySmall - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), - ), - ), - ), + padding: const EdgeInsets.all(3.0), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'VAMOS LÁ! ENTRE COM A SUA CONTA', + enText: 'LET\'S GO! SIGN IN WITH YOUR ACCOUNT', + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .displaySmall + .override( + fontFamily: 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of(context).primaryText, + fontSize: 24.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), ), - ), - ], ), ), ), ), - Container( - width: 291.0, - height: 167.0, - decoration: const BoxDecoration(), - child: ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: const AtomImageSvgTheme(filename: 'login', width: 600, height: 155), - ), + ), + Container( + width: 291.0, + height: 160.0, + decoration: const BoxDecoration(), + child: ClipRRect( + borderRadius: BorderRadius.circular(8.0), + child: const AtomImageSvgTheme( + filename: 'login', width: 600, height: 155), ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB(34.0, 0.0, 34.0, 0.0), - child: Container( - width: double.infinity, - constraints: const BoxConstraints(maxWidth: 570.0,), - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - borderRadius: BorderRadius.circular(12.0), - shape: BoxShape.rectangle, - ), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsets.all(32.0), - child: Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Form( - key: _model.formKey, - autovalidateMode: - AutovalidateMode.onUserInteraction, - 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( - key: const ValueKey( - 'emailTextFormField'), - controller: _model - .emailAddressTextController, - focusNode: _model - .emailAddressFocusNode, - cursorColor: - FlutterFlowTheme.of( - context) - .primary, - onChanged: (_) => - EasyDebounce.debounce( - '_model.emailAddressTextController', - const Duration( - milliseconds: 500), - () => setState(() {}), - ), - autofocus: true, - autofillHints: const [ - AutofillHints.email - ], - 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, - ), - ), - style: FlutterFlowTheme.of( + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 34.0, 0.0, 34.0, 0.0), + child: Container( + width: double.infinity, + constraints: const BoxConstraints( + maxWidth: 570.0, + ), + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + borderRadius: BorderRadius.circular(12.0), + shape: BoxShape.rectangle, + ), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(32.0), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Form( + key: _model.formKey, + autovalidateMode: + AutovalidateMode.onUserInteraction, + 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( + key: const ValueKey( + 'emailTextFormField'), + controller: _model + .emailAddressTextController, + focusNode: _model + .emailAddressFocusNode, + cursorColor: + FlutterFlowTheme.of(context) + .primary, + onChanged: (_) => + EasyDebounce.debounce( + '_model.emailAddressTextController', + const Duration( + milliseconds: 500), + () => setState(() {}), + ), + autofocus: true, + autofillHints: const [ + AutofillHints.email + ], + textCapitalization: + TextCapitalization.none, + textInputAction: + TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelText: FFLocalizations.of( context) - .bodyLarge + .getText( + '1ltg0ylb' /* Email */, + ), + labelStyle: FlutterFlowTheme + .of(context) + .labelLarge .override( fontFamily: 'Plus Jakarta Sans', @@ -347,230 +252,499 @@ class _SignInTemplateComponentWidgetState .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( - key: const ValueKey('passwordTextFormField'), - controller: _model.passwordTextController, - cursorColor: FlutterFlowTheme.of(context).primary, - focusNode: _model.passwordFocusNode, - onChanged: (_) => EasyDebounce.debounce( - '_model.passwordTextController', - const Duration(milliseconds: 500), - () => setState(() {}) + enabledBorder: + OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of( + context) + .customColor1, + width: 0.25, + ), + borderRadius: + BorderRadius.circular( + 12.0), ), - autofocus: true, - autofillHints: const [AutofillHints.password], - textInputAction: TextInputAction.send, - obscureText: !_model.passwordVisibility, - decoration: InputDecoration( - isDense: true, - labelText: FFLocalizations.of(context).getText('2x19ce8k' /* Senha */), - labelStyle: FlutterFlowTheme.of(context) - .labelLarge + 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, + ), + ), + style: + FlutterFlowTheme.of(context) + .bodyLarge .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, + 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) - .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), - ), + 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( + key: const ValueKey( + 'passwordTextFormField'), + controller: _model + .passwordTextController, + cursorColor: + FlutterFlowTheme.of(context) + .primary, + focusNode: + _model.passwordFocusNode, + onChanged: (_) => + EasyDebounce.debounce( + '_model.passwordTextController', + const Duration( + milliseconds: 500), + () => setState(() {})), + autofocus: true, + autofillHints: const [ + AutofillHints.password + ], + 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) + .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), + ), + ), + ), + ], ), - - - Builder( - builder: (context) { - if (MediaQuery.sizeOf(context).width < kBreakpointSmall ? true : false) { - return Column( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0), - child: FFButtonWidget( - key: const ValueKey('SubmitButtonWidget'), - onPressed: _isFormInvalid() - ? null - : () async { - await AuthenticationService.signIn(context, _model, - emailAdress: _model.emailAddressTextController.text, - password: _model.passwordTextController.text, - ); - setState(() {}); - }, - text: FFLocalizations.of(context).getText('k44tm7wo' /* Entrar */), - options: FFButtonOptions( - width: double.infinity, - height: 44.0, - padding: const EdgeInsetsDirectional.fromSTEB(0.0,0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0,0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).primary, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).info, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans')), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0), - borderRadius: BorderRadius.circular(12.0), - disabledColor: FlutterFlowTheme.of(context).customColor5, - disabledTextColor: Colors.white, - ), - showLoadingIndicator: false, + ), + Builder( + builder: (context) { + if (MediaQuery.sizeOf(context).width < + kBreakpointSmall + ? true + : false) { + return Column( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: FFButtonWidget( + key: const ValueKey( + 'SubmitButtonWidget'), + onPressed: _isFormInvalid() + ? null + : () async { + await AuthenticationService + .signIn( + context, + _model, + emailAdress: _model + .emailAddressTextController + .text, + password: _model + .passwordTextController + .text, + ); + setState(() {}); + }, + text: FFLocalizations.of( + context) + .getText( + 'k44tm7wo' /* Entrar */), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of( + context) + .primary, + textStyle: FlutterFlowTheme + .of(context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .info, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans')), + elevation: 3.0, + borderSide: + const BorderSide( + color: Colors + .transparent, + width: 1.0), + borderRadius: + BorderRadius.circular( + 12.0), + disabledColor: + FlutterFlowTheme.of( + context) + .customColor5, + disabledTextColor: + Colors.white, ), + showLoadingIndicator: false, ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0), - child: FFButtonWidget( - key: const ValueKey('toggleSignUpPage'), - onPressed: () async => await widget.toggleSignUpPage?.call(), - text: FFLocalizations.of(context).getText('14u7ipws' /* Cadastrar */, - ), - options: FFButtonOptions( - width: double.infinity, - height: 44.0, - padding: const EdgeInsetsDirectional.fromSTEB(0.0,0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).customColor1, - textStyle: - FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).secondaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: const BorderSide(color: Colors.transparent, width: 1.0), - borderRadius: BorderRadius.circular(12.0), - ), - showLoadingIndicator: false, + ), + Padding( + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 16.0), + child: FFButtonWidget( + key: const ValueKey( + 'toggleSignUpPage'), + onPressed: () async => + await widget + .toggleSignUpPage + ?.call(), + text: FFLocalizations.of( + context) + .getText( + '14u7ipws' /* Cadastrar */, ), + options: FFButtonOptions( + width: double.infinity, + height: 44.0, + padding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of( + context) + .customColor1, + textStyle: FlutterFlowTheme + .of(context) + .titleSmall + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .secondaryText, + fontSize: 16.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.w500, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: + const BorderSide( + color: Colors + .transparent, + width: 1.0), + borderRadius: + BorderRadius.circular( + 12.0), + ), + showLoadingIndicator: false, ), - ], - ); - } else { - return Row( + ), + ], + ); + } else { + return Row( mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, children: [ Expanded( child: Padding( padding: const EdgeInsetsDirectional - .fromSTEB(0.0, 0.0,0.0, 16.0), + .fromSTEB(0.0, 0.0, + 0.0, 16.0), child: FFButtonWidget( - key: const ValueKey('SubmitButtonWidget'), - onPressed: _isFormInvalid() ? null : () async { + key: const ValueKey< + String>( + 'SubmitButtonWidget'), + onPressed: + _isFormInvalid() + ? null + : () async { try { - await AuthenticationService.signIn( + await AuthenticationService + .signIn( context, _model, - emailAdress: _model.emailAddressTextController.text, - password: _model.passwordTextController.text, + emailAdress: _model + .emailAddressTextController + .text, + password: _model + .passwordTextController + .text, ); - setState(() {}); + setState( + () {}); } catch (e, s) { - await DialogUtil.errorDefault(context); + await DialogUtil + .errorDefault( + context); LogUtil.requestAPIFailed( 'login.php', - _model.emailAddressTextController.text, + _model + .emailAddressTextController + .text, "Login", - e, s); + e, + s); } }, - text: FFLocalizations.of(context).getText('1x926nsn'), + text: FFLocalizations.of( + context) + .getText('1x926nsn'), options: FFButtonOptions( width: double.infinity, height: 44.0, - padding: const EdgeInsetsDirectional.fromSTEB(0.0,0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).accent1, - textStyle: FlutterFlowTheme.of(context) + padding: + const EdgeInsetsDirectional + .fromSTEB(0.0, + 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB(0.0, + 0.0, 0.0, 0.0), + color: + FlutterFlowTheme.of( + context) + .accent1, + textStyle: + FlutterFlowTheme.of( + context) .titleSmall .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).info, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .info, + fontSize: + 16.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, + borderSide: + const BorderSide( + color: Colors + .transparent, width: 1.0, ), - borderRadius: BorderRadius.circular(12.0), - disabledColor: const Color(0xE81AAB5F), + borderRadius: + BorderRadius + .circular(12.0), + disabledColor: + const Color( + 0xE81AAB5F), ), - showLoadingIndicator: true, + showLoadingIndicator: + true, ), ), ), @@ -581,105 +755,178 @@ class _SignInTemplateComponentWidgetState .fromSTEB(0.0, 0.0, 0.0, 16.0), child: FFButtonWidget( - key: const ValueKey('toggleSignUpPage'), - onPressed: () async => await widget.toggleSignUpPage?.call(), - text: FFLocalizations.of(context).getText('jwvd4ai1' /* Cadastrar */), + key: const ValueKey< + String>( + 'toggleSignUpPage'), + onPressed: () async => + await widget + .toggleSignUpPage + ?.call(), + text: FFLocalizations.of( + context) + .getText( + 'jwvd4ai1' /* Cadastrar */), options: FFButtonOptions( width: double.infinity, height: 44.0, - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).customColor1, + padding: + const EdgeInsetsDirectional + .fromSTEB(0.0, + 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB(0.0, + 0.0, 0.0, 0.0), + color: + FlutterFlowTheme.of( + context) + .customColor1, textStyle: - FlutterFlowTheme - .of(context) + FlutterFlowTheme.of( + context) .titleSmall .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).secondaryText, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme.of( + context) + .secondaryText, + fontSize: + 16.0, + letterSpacing: + 0.0, + fontWeight: + FontWeight + .w500, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), ), elevation: 3.0, - borderSide: const BorderSide(color: Colors.transparent,width: 1.0,), - borderRadius: BorderRadius.circular(12.0), + borderSide: + const BorderSide( + color: Colors + .transparent, + width: 1.0, + ), + borderRadius: + BorderRadius + .circular(12.0), ), - showLoadingIndicator: false, + showLoadingIndicator: + false, ), ), ), - ].divide(const SizedBox(width: 7.0))); - } + ].divide( + const SizedBox(width: 7.0))); + } + }, + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB( + 0.0, 12.0, 0.0, 12.0), + child: InkWell( + key: const ValueKey( + 'ForgotPassword'), + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + await showModalBottomSheet( + isScrollControlled: true, + backgroundColor: + Colors.transparent, + context: context, + builder: (context) { + return Padding( + padding: MediaQuery + .viewInsetsOf( + context), + child: + const ForgotPasswordTemplateComponentWidget(), + ); + }) + .then((value) => + safeSetState(() {})); }, - ), - - - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 12.0, 0.0, 12.0), - child: InkWell( - key: const ValueKey('ForgotPassword'), - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - await showModalBottomSheet( - isScrollControlled: true, - backgroundColor: Colors.transparent, - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const ForgotPasswordTemplateComponentWidget(), - ); - }).then((value) => safeSetState(() {})); - }, - child: RichText( - textScaler: MediaQuery.of(context).textScaler, - text: TextSpan( - children: [ - TextSpan( - text: FFLocalizations.of(context).getText('05dx91ku' /* Você esqueceu a sua senha? */,), - style: TextStyle(color: FlutterFlowTheme.of(context).primaryText), + child: RichText( + textScaler: + MediaQuery.of(context).textScaler, + text: TextSpan( + children: [ + TextSpan( + text: + FFLocalizations.of(context) + .getText( + '05dx91ku' /* Você esqueceu a sua senha? */, ), - TextSpan( - text: FFLocalizations.of(context).getText('p5c6d54y' /* Recupere aqui */), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primary, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.normal, - useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), - ), - mouseCursor: SystemMouseCursors.click, - ) - ], - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily)), - ), + style: TextStyle( + color: FlutterFlowTheme.of( + context) + .primaryText), + ), + TextSpan( + text: FFLocalizations.of( + context) + .getText( + 'p5c6d54y' /* Recupere aqui */), + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + 'Plus Jakarta Sans', + color: FlutterFlowTheme + .of(context) + .primary, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: + FontWeight.normal, + useGoogleFonts: + GoogleFonts + .asMap() + .containsKey( + 'Plus Jakarta Sans'), + ), + mouseCursor: + SystemMouseCursors.click, + ) + ], + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily)), ), ), ), - const AtomTermsOfUse(), - ], - ), + ), + const AtomTermsOfUse(), + ], ), ), - ).animateOnPageLoad( - animationsMap['containerOnPageLoadAnimation']!), - ), + ), + ).animateOnPageLoad( + animationsMap['containerOnPageLoadAnimation']!), ), - ], - ), - ], - ), + ), + ], + ), + ], ), ), ), 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 14003cdb..35dc9f93 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 @@ -17,12 +17,16 @@ import 'sign_up_template_component_model.dart'; export 'sign_up_template_component_model.dart'; class SignUpTemplateComponentWidget extends StatefulWidget { - const SignUpTemplateComponentWidget({super.key, required this.toggleSignInPage}); + const SignUpTemplateComponentWidget( + {super.key, required this.toggleSignInPage}); final Future Function()? toggleSignInPage; - @override State createState() => _SignUpTemplateComponentWidgetState(); + @override + State createState() => + _SignUpTemplateComponentWidgetState(); } -class _SignUpTemplateComponentWidgetState extends State with TickerProviderStateMixin { +class _SignUpTemplateComponentWidgetState + extends State with TickerProviderStateMixin { late SignUpTemplateComponentModel _model; final animationsMap = {}; @@ -137,48 +141,30 @@ class _SignUpTemplateComponentWidgetState extends State('passwordVisibilitySuffixIcon'), + key: const ValueKey< + String>( + 'passwordVisibilitySuffixIcon'), onTap: () => setState( () => _model .passwordRegisterFormVisibility = @@ -683,24 +671,40 @@ class _SignUpTemplateComponentWidgetState extends State('SubmitButtonWidget'), + key: const ValueKey( + 'SubmitButtonWidget'), onPressed: isFormInvalid() ? null : () async { var shouldSetState = false; - _model.register = await AuthenticationService.signUp(context, - email: _model.emailRegisterFormTextController.text, - name: _model.nameRegisterFormTextController.text, - passwd: _model.passwordRegisterFormTextController.text, - device: StorageUtil().deviceType, + _model.register = + await AuthenticationService + .signUp( + context, + email: _model + .emailRegisterFormTextController + .text, + name: _model + .nameRegisterFormTextController + .text, + passwd: _model + .passwordRegisterFormTextController + .text, + device: StorageUtil() + .deviceType, ); shouldSetState = true; - if (_model.register == true) await widget.toggleSignInPage?.call(); + if (_model.register == true) + await widget + .toggleSignInPage + ?.call(); else { - if (shouldSetState) setState(() {}); + if (shouldSetState) + setState(() {}); return; } - if (shouldSetState) setState(() {}); + if (shouldSetState) + setState(() {}); }, text: FFLocalizations.of(context) .getText( @@ -755,12 +759,15 @@ class _SignUpTemplateComponentWidgetState extends State('toggleSignInPage'), + key: const ValueKey( + 'toggleSignInPage'), splashColor: Colors.transparent, focusColor: Colors.transparent, hoverColor: Colors.transparent, highlightColor: Colors.transparent, - onTap: () async => await widget.toggleSignInPage?.call(), + onTap: () async => await widget + .toggleSignInPage + ?.call(), child: RichText( textScaler: MediaQuery.of(context) .textScaler, diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart index 5c0f0aa0..08aafeb2 100644 --- a/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart +++ b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart @@ -26,7 +26,9 @@ class WelcomeTemplateComponentWidget extends StatefulWidget { _WelcomeTemplateComponentWidgetState(); } -class _WelcomeTemplateComponentWidgetState extends State with TickerProviderStateMixin { +class _WelcomeTemplateComponentWidgetState + extends State + with TickerProviderStateMixin { late WelcomeTemplateComponentModel _model; final animationsMap = {}; @@ -41,39 +43,38 @@ class _WelcomeTemplateComponentWidgetState extends State WelcomeTemplateComponentModel()); - animationsMap.addAll( - { - 'containerOnPageLoadAnimation': AnimationInfo( - trigger: AnimationTrigger.onPageLoad, - effectsBuilder: () => [ - VisibilityEffect(duration: 1.ms), - FadeEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: 0.0, - end: 1.0, - ), - MoveEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.0, 140.0), - end: const Offset(0.0, 0.0), - ), - ScaleEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(0.9, 0.9), - end: const Offset(1.0, 1.0), - ), - TiltEffect( - curve: Curves.easeInOut, - delay: 0.0.ms, - duration: 300.0.ms, - begin: const Offset(-0.349, 0), - end: const Offset(0, 0), + animationsMap.addAll({ + 'containerOnPageLoadAnimation': AnimationInfo( + trigger: AnimationTrigger.onPageLoad, + effectsBuilder: () => [ + VisibilityEffect(duration: 1.ms), + FadeEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: 0.0, + end: 1.0, + ), + MoveEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(0.0, 140.0), + end: const Offset(0.0, 0.0), + ), + ScaleEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(0.9, 0.9), + end: const Offset(1.0, 1.0), + ), + TiltEffect( + curve: Curves.easeInOut, + delay: 0.0.ms, + duration: 300.0.ms, + begin: const Offset(-0.349, 0), + end: const Offset(0, 0), ), ], ), @@ -95,66 +96,56 @@ class _WelcomeTemplateComponentWidgetState extends State('toggleSignInPage'), + key: const ValueKey( + 'toggleSignInPage'), onPressed: () async { await widget.toggleSignInPage?.call(); }, - text: FFLocalizations.of(context).getText( 'dynet730' /* Entrar */), + text: FFLocalizations.of(context) + .getText('dynet730' /* Entrar */), options: FFButtonOptions( width: double.infinity, height: 44.0, - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0), + padding: const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, 0.0, 0.0), + iconPadding: + const EdgeInsetsDirectional + .fromSTEB(0.0, 0.0, 0.0, 0.0), color: FlutterFlowTheme.of(context) .primary, textStyle: FlutterFlowTheme.of( @@ -297,10 +298,9 @@ class _WelcomeTemplateComponentWidgetState extends State('toggleSignInPage'), - + key: const ValueKey( + 'toggleSignInPage'), onPressed: () async { - await widget.toggleSignInPage ?.call(); }, @@ -353,7 +353,8 @@ class _WelcomeTemplateComponentWidgetState extends State('toggleSignUpPage'), + key: const ValueKey( + 'toggleSignUpPage'), onPressed: () async { await widget.toggleSignUpPage ?.call(); diff --git a/lib/main.dart b/lib/main.dart index 9ebf0b17..3bcbff3a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -117,7 +117,7 @@ class App extends StatefulWidget { context.findAncestorStateOfType<_AppState>()!; } -class _AppState extends State with WidgetsBindingObserver { +class _AppState extends State with WidgetsBindingObserver { Locale? _locale = FFLocalizations.getStoredLocale(); ThemeMode _themeMode = FlutterFlowTheme.themeMode; late AppStateNotifier _appStateNotifier; @@ -180,6 +180,7 @@ class _AppState extends State with WidgetsBindingObserver { const Breakpoint(start: 1921, end: 2560, name: HD4K), const Breakpoint(start: 2561, end: double.infinity, name: ULTRAWIDE), ]; + return ResponsiveBreakpoints.builder( child: BouncingScrollWrapper.builder(context, widget!), breakpoints: breakpoints, @@ -264,7 +265,8 @@ class _AppState extends State with WidgetsBindingObserver { }); } - @override void initState() { + @override + void initState() { super.initState(); WidgetsBinding.instance.addObserver(this); @@ -280,18 +282,21 @@ class _AppState extends State with WidgetsBindingObserver { WidgetsBinding.instance.addPersistentFrameCallback((_) => initDeepLinks()); } - @override void dispose() { + @override + void dispose() { WidgetsBinding.instance.removeObserver(this); _linkSubscription?.cancel(); super.dispose(); } - @override void didChangeAppLifecycleState(AppLifecycleState state) async { + @override + void didChangeAppLifecycleState(AppLifecycleState state) async { bool initialize = await StorageUtil().ensureInitialization(); - if(initialize) await LocalizationService.processLocals(context); + if (initialize) await LocalizationService.processLocals(context); } - @override Widget build(BuildContext context) { + @override + Widget build(BuildContext context) { return MaterialApp.router( key: navigatorKey, title: 'FRE ACCESS HUB', diff --git a/lib/shared/utils/text_util.dart b/lib/shared/utils/text_util.dart new file mode 100644 index 00000000..d2876a0b --- /dev/null +++ b/lib/shared/utils/text_util.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; + +class TextUtil extends StatelessWidget { + final String text; + final TextStyle? style; + final TextAlign? textAlign; + + const TextUtil({ + Key? key, + required this.text, + this.style, + this.textAlign, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + var textScale = MediaQuery.textScalerOf(context); + var scaledTextSize = textScale.scale(style?.fontSize ?? 14); + double limitedTextSize = scaledTextSize > (style?.fontSize ?? 14) * 2 + ? (style?.fontSize ?? 14) * 2 + : scaledTextSize; + + return Text( + text, + style: style?.copyWith( + fontSize: limitedTextSize, + ), + textAlign: textAlign ?? TextAlign.start, + ); + } +} From 8ce59f3f2be9ecfc2832712c5e5b45f2b5464f6c Mon Sep 17 00:00:00 2001 From: Lucas Date: Mon, 4 Nov 2024 17:30:54 -0300 Subject: [PATCH 2/7] =?UTF-8?q?Feat:=20Ajuste=20na=20tela=20de=20home,=20v?= =?UTF-8?q?isita=20provis=C3=B3ria=20e=20visita=20completa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../menu_button_item_widget.dart | 46 +- .../menu_card_item/menu_card_item.dart | 33 +- .../local_profile_component_widget.dart | 57 +- .../menu_staggered_view_component_widget.dart | 8 +- .../provisional_shcedule_template_widget.dart | 45 +- lib/flutter_flow/flutter_flow_util.dart | 10 + lib/pages/home_page/home_page_widget.dart | 19 +- .../schedule_complete_visit_page_widget.dart | 2718 +++++++++-------- 8 files changed, 1510 insertions(+), 1426 deletions(-) diff --git a/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart index 44724d64..aff8b187 100644 --- a/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart +++ b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart @@ -8,7 +8,6 @@ import 'package:hub/shared/utils/storage_util.dart'; import '../../../shared/extensions/dialog_extensions.dart'; import '../../../shared/services/localization/localization_service.dart'; - class MenuButtonWidget extends MenuEntry { const MenuButtonWidget({ super.key, @@ -32,34 +31,41 @@ class _MenuButtonWidgetState extends State { get action => action; bool _isProcessing = false; - @override Widget build(BuildContext context) { + final textScaler = MediaQuery.textScalerOf(context); + final double baseFontSize = 10; + final double scaledFontSize = baseFontSize * textScaler.scale(1); + final double limitedFontSize = scaledFontSize > 22 ? 10 : baseFontSize; + return InkWell( splashColor: Colors.transparent, focusColor: Colors.transparent, hoverColor: Colors.transparent, highlightColor: Colors.transparent, - onTap: _isProcessing ? null : () async { - setState(() { - _isProcessing = true; - }); - await LocalizationService.processLocals(context).then((value) async { - if (value) { - await widget.action?.call(); - } else { - DialogUnavailable.unavailableCredentials(context); - } - }); - setState(() { - _isProcessing = false; - }); - }, + onTap: _isProcessing + ? null + : () async { + setState(() { + _isProcessing = true; + }); + await LocalizationService.processLocals(context) + .then((value) async { + if (value) { + await widget.action?.call(); + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); + setState(() { + _isProcessing = false; + }); + }, child: Padding( padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 0), child: Container( - width: 120.0, - height: 100.0, + width: 300, + height: 280, decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, boxShadow: [ @@ -107,7 +113,7 @@ class _MenuButtonWidgetState extends State { style: FlutterFlowTheme.of(context).titleLarge.override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, + fontSize: limitedFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: diff --git a/lib/components/atomic_components/menu_card_item/menu_card_item.dart b/lib/components/atomic_components/menu_card_item/menu_card_item.dart index 04398e5c..3f69ba21 100644 --- a/lib/components/atomic_components/menu_card_item/menu_card_item.dart +++ b/lib/components/atomic_components/menu_card_item/menu_card_item.dart @@ -36,21 +36,24 @@ class _MenuCardItemState extends State { focusColor: Colors.transparent, hoverColor: Colors.transparent, highlightColor: Colors.transparent, - onTap: _isProcessing ? null : () async { - setState(() { - _isProcessing = true; - }); - await LocalizationService.processLocals(context).then((value) async { - if (value) { - await widget.action?.call(); - } else { - DialogUnavailable.unavailableCredentials(context); - } - }); - setState(() { - _isProcessing = false; - }); - }, + onTap: _isProcessing + ? null + : () async { + setState(() { + _isProcessing = true; + }); + await LocalizationService.processLocals(context) + .then((value) async { + if (value) { + await widget.action?.call(); + } else { + DialogUnavailable.unavailableCredentials(context); + } + }); + setState(() { + _isProcessing = false; + }); + }, child: Card( elevation: 0, color: FlutterFlowTheme.of(context).primaryBackground, diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart index e954b417..288d8feb 100644 --- a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart +++ b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart @@ -39,8 +39,8 @@ class _LocalProfileComponentWidgetState // // WidgetsBinding.instance // .addPostFrameCallback((_) async => await LocalizationService.processLocals(context).then((value) => value == true ? onUpdate() : null)); - LocalizationService.processLocals(context).then((value) => value == true ? onUpdate() : null); - + LocalizationService.processLocals(context) + .then((value) => value == true ? onUpdate() : null); } @override @@ -57,10 +57,13 @@ class _LocalProfileComponentWidgetState }); } - - @override Widget build(BuildContext context) { + final textScaler = MediaQuery.textScalerOf(context); + final double baseFontSize = 14.0; + final double scaledFontSize = baseFontSize * textScaler.scale(1); + final double limitedFontSize = scaledFontSize > 14.0 ? 9 : scaledFontSize; + return Container( decoration: const BoxDecoration(), child: Align( @@ -90,7 +93,8 @@ class _LocalProfileComponentWidgetState hoverColor: Colors.transparent, highlightColor: Colors.transparent, onTap: () async { - await LocalizationService.selectLocal(context).then((value) => value == true ? onUpdate() : null); + await LocalizationService.selectLocal(context).then( + (value) => value == true ? onUpdate() : null); }, child: ClipRRect( borderRadius: BorderRadius.circular(200.0), @@ -120,23 +124,36 @@ class _LocalProfileComponentWidgetState )), ), ), - Text( - valueOrDefault( - functions.convertToUppercase(_model.cliName), - FFLocalizations.of(context).getVariableText( - ptText: 'SEM LOCAL VINCULADO', - enText: 'NO LINKED LOCAL', + Expanded( + child: Tooltip( + message: valueOrDefault( + functions.convertToUppercase(_model.cliName), + FFLocalizations.of(context).getVariableText( + ptText: 'SEM LOCAL VINCULADO', + enText: 'NO LINKED LOCAL', + ), + ), + child: Text( + valueOrDefault( + functions.convertToUppercase(_model.cliName), + FFLocalizations.of(context).getVariableText( + ptText: 'SEM LOCAL VINCULADO', + enText: 'NO LINKED LOCAL', + ), + ), + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).info, + fontSize: limitedFontSize, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Nunito'), + ), ), ), - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).info, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), ), ] .divide(const SizedBox(width: 20.0)) diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart index ef9d3f46..e5f916ac 100644 --- a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart +++ b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart @@ -52,12 +52,16 @@ class _MenuStaggeredViewComponentWidgetState @override Widget build(BuildContext context) { + final textScaler = MediaQuery.textScalerOf(context); + final double scaledFontSize = 14 * textScaler.scale(1); + final int crossAxisCount = scaledFontSize > 20 ? 2 : 3; + return Column( children: [ GridView.builder( physics: const NeverScrollableScrollPhysics(), - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: crossAxisCount, crossAxisSpacing: 10.0, mainAxisSpacing: 10.0, childAspectRatio: 1, diff --git a/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart b/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart index d5af8a30..91a95b09 100644 --- a/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart +++ b/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart @@ -165,26 +165,31 @@ class _ScheduleProvisionalVisitPageWidgetState memCacheHeight: 35, ), ), - Padding( - padding: const EdgeInsetsDirectional - .fromSTEB(15.0, 0.0, 0.0, 0.0), - child: Text( - model.cliName, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of( - context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), - ), + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional + .fromSTEB(15.0, 0.0, 0.0, 0.0), + child: Text( + model.cliName, + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: + FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + ), ), ), ], diff --git a/lib/flutter_flow/flutter_flow_util.dart b/lib/flutter_flow/flutter_flow_util.dart index 46f249a2..eab12119 100644 --- a/lib/flutter_flow/flutter_flow_util.dart +++ b/lib/flutter_flow/flutter_flow_util.dart @@ -193,6 +193,12 @@ Theme wrapInMaterialTimePickerTheme( required double iconSize, }) { final baseTheme = Theme.of(context); + + final textScaler = MediaQuery.textScalerOf(context); + final double baseFontSize = 14.0; + final double scaledFontSize = baseFontSize * textScaler.scale(1); + final double limitedFontSize = scaledFontSize > 14.0 ? 8 : scaledFontSize; + return Theme( data: baseTheme.copyWith( focusColor: headerBackgroundColor, @@ -271,6 +277,10 @@ Theme wrapInMaterialTimePickerTheme( dayPeriodBorderSide: BorderSide( color: pickerForegroundColor, ), + dialTextStyle: baseTheme.textTheme.headlineMedium!.copyWith( + color: pickerDialForegroundColor, + fontSize: limitedFontSize, + ), dayPeriodTextColor: WidgetStateColor.resolveWith((states) => states.contains(WidgetState.selected) ? selectedDateTimeForegroundColor diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index 93ee9cfd..7b7ca0c3 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -1,4 +1,3 @@ - import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -20,7 +19,7 @@ class HomePageWidget extends StatefulWidget { State createState() => _HomePageWidgetState(); } -class _HomePageWidgetState extends State { +class _HomePageWidgetState extends State { late HomePageModel _model; final scaffoldKey = GlobalKey(); @@ -30,13 +29,14 @@ class _HomePageWidgetState extends State { _localProfileComponentWidget = LocalProfileComponentWidget(); } - @override void dispose() { - + @override + void dispose() { super.dispose(); _model.dispose(); } - @override void initState() { + @override + void initState() { super.initState(); _model = createModel(context, () => HomePageModel()); @@ -48,9 +48,8 @@ class _HomePageWidgetState extends State { _model.textFieldFocusNode ??= FocusNode(); } - - - @override Widget build(BuildContext context) { + @override + Widget build(BuildContext context) { StorageUtil().context = context; return Scaffold( key: scaffoldKey, @@ -109,10 +108,6 @@ class _HomePageWidgetState extends State { ); } - - - - Container buildPage(BuildContext context) { return Container( decoration: BoxDecoration( 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 8ce47494..613ded1c 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 @@ -1,4 +1,3 @@ - import 'package:auto_size_text/auto_size_text.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; @@ -42,6 +41,7 @@ class ScheduleCompleteVisitPageWidget extends ScheduleComplete { class _ScheduleCompleteVisitPageWidgetState extends State with TickerProviderStateMixin { + bool _isLoading = false; late ScheduleCompleteVisitPageModel _model; int _visitHistoryLoadingIdx = 0; final int _visitHistoryLoadingCount = 10; @@ -118,154 +118,423 @@ class _ScheduleCompleteVisitPageWidgetState ), ); } -} -PreferredSizeWidget appBarScheduleCompleteVisit(BuildContext context) { - return AppBar( - backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - automaticallyImplyLeading: false, - forceMaterialTransparency: true, - elevation: 0.0, - leading: FlutterFlowIconButton( - borderColor: Colors.transparent, - borderRadius: 30.0, - borderWidth: 1.0, - buttonSize: 60.0, - icon: Icon( - Icons.keyboard_arrow_left, - color: FlutterFlowTheme.of(context).primaryText, - size: 30.0, - ), - onPressed: () async { - context.pop(); - }, - ), - title: Text( - FFLocalizations.of(context).getText( - '61lcxdgm', - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 15.0, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - actions: const [], - centerTitle: true, - ); -} - -Widget bodyScheduleCompleteVisit(BuildContext context, - ScheduleCompleteVisitPageModel model, Function safeSetState) { - return 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, - fontSize: 13.0, - 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( - 'ueth1f4g', - ), - ), - Tab( - text: FFLocalizations.of(context).getText( - 'k4uraqam', - ), - ), - ], - controller: model.tabBarController, - onTap: (i) async { - [() async {}, () async {}][i](); - }, - ), + PreferredSizeWidget appBarScheduleCompleteVisit(BuildContext context) { + return AppBar( + backgroundColor: FlutterFlowTheme.of(context).primaryBackground, + automaticallyImplyLeading: false, + forceMaterialTransparency: true, + elevation: 0.0, + leading: FlutterFlowIconButton( + borderColor: Colors.transparent, + borderRadius: 30.0, + borderWidth: 1.0, + buttonSize: 60.0, + icon: Icon( + Icons.keyboard_arrow_left, + color: FlutterFlowTheme.of(context).primaryText, + size: 30.0, ), - Expanded( - child: TabBarView( - controller: model.tabBarController, - children: [ - scheduleVisit(context, model, safeSetState), - wrapWithModel( - model: model, - child: const VisitHistoryWidget(), - updateCallback: () { - safeSetState(() {}); - }, - updateOnChange: true), - ], - ), + onPressed: () async { + context.pop(); + }, + ), + title: Text( + FFLocalizations.of(context).getText( + '61lcxdgm', ), - ], - ), - ); -} + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 15.0, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), + ), + actions: const [], + centerTitle: true, + ); + } -Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, - Function safeSetState) { - return SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - Form( - autovalidateMode: AutovalidateMode.onUserInteraction, - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Column(mainAxisSize: MainAxisSize.max, children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 30.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '98evnbbe', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), + Widget bodyScheduleCompleteVisit(BuildContext context, + ScheduleCompleteVisitPageModel model, Function safeSetState) { + return 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, + fontSize: 13.0, + 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( + 'ueth1f4g', ), ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - SizedBox( - width: MediaQuery.of(context).size.width, - height: 60.0, - child: Stack( - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: model.textController1, + Tab( + text: FFLocalizations.of(context).getText( + 'k4uraqam', + ), + ), + ], + controller: model.tabBarController, + onTap: (i) async { + [() async {}, () async {}][i](); + }, + ), + ), + Expanded( + child: TabBarView( + controller: model.tabBarController, + children: [ + scheduleVisit(context, model, safeSetState), + wrapWithModel( + model: model, + child: const VisitHistoryWidget(), + updateCallback: () { + safeSetState(() {}); + }, + updateOnChange: true), + ], + ), + ), + ], + ), + ); + } + + Widget scheduleVisit(BuildContext context, + ScheduleCompleteVisitPageModel model, Function safeSetState) { + final textScaler = MediaQuery.textScalerOf(context); + final double baseFontSize = 12.0; + final double scaledFontSize = baseFontSize * textScaler.scale(1); + final double limitedFontSize = scaledFontSize > 16.0 ? 10 : baseFontSize; + final double scaledSizedBoxSize = scaledFontSize > 16.0 ? 100 : 80; + + return SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Form( + autovalidateMode: AutovalidateMode.onUserInteraction, + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Column(mainAxisSize: MainAxisSize.max, children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 30.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + '98evnbbe', + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width, + height: scaledSizedBoxSize, + child: Stack( + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( + controller: model.textController1, + readOnly: true, + focusNode: model.textFieldFocusNode1, + autovalidateMode: + AutovalidateMode.onUserInteraction, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + fontSize: limitedFontSize, + ), + hintText: + FFLocalizations.of(context).getText( + '53cbwqh9', + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + lineHeight: 1.0, + fontSize: limitedFontSize, + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent4, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + suffixIcon: Icon( + Icons.date_range, + color: + FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + lineHeight: 1.8, + fontSize: limitedFontSize, + ), + textAlign: TextAlign.start, + validator: model.textController1Validator + .asValidator(context)), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + final datePicked1Date = await showDatePicker( + context: context, + initialDate: getCurrentTimestamp, + firstDate: getCurrentTimestamp, + lastDate: DateTime(2050), + builder: (context, child) { + return wrapInMaterialDatePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: + FlutterFlowTheme.of(context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of(context) + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context).info, + actionButtonForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + + TimeOfDay? datePicked1Time; + if (datePicked1Date != null) { + datePicked1Time = await showTimePicker( + context: context, + initialTime: TimeOfDay.fromDateTime( + getCurrentTimestamp), + builder: (context, child) { + return wrapInMaterialTimePickerTheme( + context, + child!, + headerBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge + .override( + fontFamily: + FlutterFlowTheme.of(context) + .headlineLargeFamily, + fontSize: 32.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey(FlutterFlowTheme + .of(context) + .headlineLargeFamily), + ), + pickerBackgroundColor: + FlutterFlowTheme.of(context) + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context).info, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context).info, + pickerDialForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + actionButtonForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + iconSize: 24.0, + ); + }, + ); + } + + if (datePicked1Date != null && + datePicked1Time != null) { + safeSetState(() { + model.datePicked1 = DateTime( + datePicked1Date.year, + datePicked1Date.month, + datePicked1Date.day, + datePicked1Time!.hour, + datePicked1Time.minute, + ); + }); + } + safeSetState(() { + model.textController1?.text = + dateTimeFormat( + 'dd/MM/yyyy HH:mm:ss', + model.datePicked1, + locale: FFLocalizations.of(context) + .languageCode, + ); + model.textController1?.selection = + TextSelection.collapsed( + offset: model + .textController1!.text.length); + }); + }, + child: Container( + width: double.infinity, + height: 80.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), + ), + ), + ), + ), + ], + ), + ), + ], + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + SizedBox( + width: MediaQuery.of(context).size.width, + height: scaledSizedBoxSize, + child: Stack( + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: TextFormField( readOnly: true, - focusNode: model.textFieldFocusNode1, + controller: model.textController2, + focusNode: model.textFieldFocusNode2, autovalidateMode: AutovalidateMode.onUserInteraction, autofocus: false, @@ -284,9 +553,10 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, .containsKey( FlutterFlowTheme.of(context) .labelMediumFamily), + fontSize: limitedFontSize, ), hintText: FFLocalizations.of(context).getText( - '53cbwqh9', + 'xpgc5e8d', ), hintStyle: FlutterFlowTheme.of(context) .labelMedium @@ -301,6 +571,7 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, FlutterFlowTheme.of(context) .labelMediumFamily), lineHeight: 1.0, + fontSize: limitedFontSize, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -348,74 +619,29 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, FlutterFlowTheme.of(context) .bodyMediumFamily), lineHeight: 1.8, + fontSize: limitedFontSize, ), textAlign: TextAlign.start, - validator: model.textController1Validator - .asValidator(context)), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - final datePicked1Date = await showDatePicker( - context: context, - initialDate: getCurrentTimestamp, - firstDate: getCurrentTimestamp, - lastDate: DateTime(2050), - builder: (context, child) { - return wrapInMaterialDatePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of(context).primary, - headerForegroundColor: - FlutterFlowTheme.of(context).info, - headerTextStyle: FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of(context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of(context) - .primaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of(context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of(context).primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of(context).info, - actionButtonForegroundColor: - FlutterFlowTheme.of(context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - - TimeOfDay? datePicked1Time; - if (datePicked1Date != null) { - datePicked1Time = await showTimePicker( + validator: model.textController2Validator + .asValidator(context), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + final datePicked2Date = await showDatePicker( context: context, - initialTime: TimeOfDay.fromDateTime( - getCurrentTimestamp), + initialDate: getCurrentTimestamp, + firstDate: getCurrentTimestamp, + lastDate: DateTime(2050), builder: (context, child) { - return wrapInMaterialTimePickerTheme( + return wrapInMaterialDatePickerTheme( context, child!, headerBackgroundColor: @@ -430,7 +656,7 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, fontFamily: FlutterFlowTheme.of(context) .headlineLargeFamily, - fontSize: 32.0, + fontSize: limitedFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w600, useGoogleFonts: GoogleFonts @@ -444,15 +670,13 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, FlutterFlowTheme.of(context) .primaryBackground, pickerForegroundColor: - FlutterFlowTheme.of(context).info, + FlutterFlowTheme.of(context) + .primaryText, selectedDateTimeBackgroundColor: FlutterFlowTheme.of(context) .primary, selectedDateTimeForegroundColor: FlutterFlowTheme.of(context).info, - pickerDialForegroundColor: - FlutterFlowTheme.of(context) - .primaryText, actionButtonForegroundColor: FlutterFlowTheme.of(context) .primaryText, @@ -460,531 +684,655 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, ); }, ); - } - if (datePicked1Date != null && - datePicked1Time != null) { - safeSetState(() { - model.datePicked1 = DateTime( - datePicked1Date.year, - datePicked1Date.month, - datePicked1Date.day, - datePicked1Time!.hour, - datePicked1Time.minute, - ); - }); - } - safeSetState(() { - model.textController1?.text = dateTimeFormat( - 'dd/MM/yyyy HH:mm:ss', - model.datePicked1, - locale: FFLocalizations.of(context) - .languageCode, - ); - model.textController1?.selection = - TextSelection.collapsed( - offset: model - .textController1!.text.length); - }); - }, - child: Container( - width: double.infinity, - height: 80.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8.0), - ), - ), - ), - ), - ], - ), - ), - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - SizedBox( - width: MediaQuery.of(context).size.width, - height: 60.0, - child: Stack( - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: TextFormField( - readOnly: true, - controller: model.textController2, - focusNode: model.textFieldFocusNode2, - autovalidateMode: - AutovalidateMode.onUserInteraction, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( + TimeOfDay? datePicked2Time; + if (datePicked2Date != null) { + datePicked2Time = await showTimePicker( + context: context, + initialTime: TimeOfDay.fromDateTime( + getCurrentTimestamp), + builder: (context, child) { + return wrapInMaterialTimePickerTheme( + context, + child!, + headerBackgroundColor: FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - hintText: FFLocalizations.of(context).getText( - 'xpgc5e8d', - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - lineHeight: 1.0, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent4, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - lineHeight: 1.8, - ), - textAlign: TextAlign.start, - validator: model.textController2Validator - .asValidator(context), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - final datePicked2Date = await showDatePicker( - context: context, - initialDate: getCurrentTimestamp, - firstDate: getCurrentTimestamp, - lastDate: DateTime(2050), - builder: (context, child) { - return wrapInMaterialDatePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of(context).primary, - headerForegroundColor: - FlutterFlowTheme.of(context).info, - headerTextStyle: FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of(context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of(context) - .primaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of(context) - .primaryText, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of(context).primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of(context).info, - actionButtonForegroundColor: - FlutterFlowTheme.of(context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - - TimeOfDay? datePicked2Time; - if (datePicked2Date != null) { - datePicked2Time = await showTimePicker( - context: context, - initialTime: TimeOfDay.fromDateTime( - getCurrentTimestamp), - builder: (context, child) { - return wrapInMaterialTimePickerTheme( - context, - child!, - headerBackgroundColor: - FlutterFlowTheme.of(context) - .primary, - headerForegroundColor: - FlutterFlowTheme.of(context).info, - headerTextStyle: FlutterFlowTheme.of( - context) - .headlineLarge - .override( - fontFamily: - FlutterFlowTheme.of(context) - .headlineLargeFamily, - fontSize: 32.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts - .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .headlineLargeFamily), - ), - pickerBackgroundColor: - FlutterFlowTheme.of(context) - .primaryBackground, - pickerForegroundColor: - FlutterFlowTheme.of(context).info, - selectedDateTimeBackgroundColor: - FlutterFlowTheme.of(context) - .primary, - selectedDateTimeForegroundColor: - FlutterFlowTheme.of(context).info, - pickerDialForegroundColor: - FlutterFlowTheme.of(context) - .primaryText, - actionButtonForegroundColor: - FlutterFlowTheme.of(context) - .primaryText, - iconSize: 24.0, - ); - }, - ); - } - - if (datePicked2Date != null && - datePicked2Time != null) { - safeSetState(() { - model.datePicked2 = DateTime( - datePicked2Date.year, - datePicked2Date.month, - datePicked2Date.day, - datePicked2Time!.hour, - datePicked2Time.minute, - ); - }); - } - safeSetState(() { - model.textController2?.text = dateTimeFormat( - 'dd/MM/yyyy HH:mm:ss', - model.datePicked2, - locale: FFLocalizations.of(context) - .languageCode, - ); - model.textController2?.selection = - TextSelection.collapsed( - offset: model - .textController2!.text.length); - }); - }, - child: Container( - width: double.infinity, - height: 80.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8.0), - ), - ), - ), - ), - ], - ), - ), - ], - ), - ]), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 30.0), - child: Text( - FFLocalizations.of(context).getText( - 'u0jocx7e', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - if (model.visitorJsonList.isNotEmpty) - Builder( - builder: (context) { - final visitorListView = - model.visitorJsonList.map((e) => e).toList(); - return ListView.separated( - padding: const EdgeInsets.fromLTRB( - 0, - 0, - 20, - 20, - ), - shrinkWrap: true, - scrollDirection: Axis.vertical, - itemCount: visitorListView.length, - separatorBuilder: (_, __) => - const SizedBox(height: 5.0), - itemBuilder: (context, visitorListViewIndex) { - final visitorListViewItem = - visitorListView[visitorListViewIndex]; - return Padding( - padding: - const EdgeInsets.symmetric(horizontal: 30), - child: Container( - width: MediaQuery.of(context).size.width, - height: 70.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: 50.0, - height: 50.0, - clipBehavior: Clip.antiAlias, - decoration: const BoxDecoration( - shape: BoxShape.circle, - ), - child: CachedNetworkImage( - fadeInDuration: - const Duration(milliseconds: 500), - fadeOutDuration: - const Duration(milliseconds: 500), - imageUrl: - "https://freaccess.com.br/freaccess/getImage.php?devUUID=${model.devUUID}&userUUID=${model.userUUID}&cliID=${model.cliUUID}&atividade=getFoto&Documento=${getJsonField(visitorListViewItem, r'''$.VTE_DOCUMENTO''').toString()}&tipo=E", - fit: BoxFit.cover, - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 8.0), - child: Text( - getJsonField(visitorListViewItem, - r'''$.VTE_NOME''') - .toString(), - style: FlutterFlowTheme.of(context) - .bodyMedium + .primary, + headerForegroundColor: + FlutterFlowTheme.of(context).info, + headerTextStyle: FlutterFlowTheme.of( + context) + .headlineLarge .override( fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, + .headlineLargeFamily, + fontSize: 32.0, letterSpacing: 0.0, + fontWeight: FontWeight.w600, useGoogleFonts: GoogleFonts .asMap() - .containsKey( - FlutterFlowTheme.of( - context) - .bodyMediumFamily), + .containsKey(FlutterFlowTheme + .of(context) + .headlineLargeFamily), ), - overflow: TextOverflow.ellipsis, - ), - ), - ), - IconButton( - onPressed: () async { - safeSetState(() { - model.removeFromVisitorJsonList( - visitorListViewItem); - if (model.visitorJsonList.isEmpty) { - model.visitorStrList = ''; - } - }); + pickerBackgroundColor: + FlutterFlowTheme.of(context) + .primaryBackground, + pickerForegroundColor: + FlutterFlowTheme.of(context).info, + selectedDateTimeBackgroundColor: + FlutterFlowTheme.of(context) + .primary, + selectedDateTimeForegroundColor: + FlutterFlowTheme.of(context).info, + pickerDialForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + actionButtonForegroundColor: + FlutterFlowTheme.of(context) + .primaryText, + iconSize: 24.0, + ); }, - icon: const Icon(Icons.close), - ), - ], + ); + } + + if (datePicked2Date != null && + datePicked2Time != null) { + safeSetState(() { + model.datePicked2 = DateTime( + datePicked2Date.year, + datePicked2Date.month, + datePicked2Date.day, + datePicked2Time!.hour, + datePicked2Time.minute, + ); + }); + } + safeSetState(() { + model.textController2?.text = + dateTimeFormat( + 'dd/MM/yyyy HH:mm:ss', + model.datePicked2, + locale: FFLocalizations.of(context) + .languageCode, + ); + model.textController2?.selection = + TextSelection.collapsed( + offset: model + .textController2!.text.length); + }); + }, + child: Container( + width: double.infinity, + height: 80.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), + ), ), ), - ); - }, - ); - }, + ), + ], + ), + ), + ], + ), + ]), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 30.0), + child: Text( + FFLocalizations.of(context).getText( + 'u0jocx7e', + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), ), - Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.01, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 20.0), - child: FFButtonWidget( - onPressed: () async { - await showModalBottomSheet( - isScrollControlled: true, - isDismissible: true, - backgroundColor: FlutterFlowTheme.of(context) - .primaryBackground, - enableDrag: true, - context: context, - builder: (context) { - return GestureDetector( - onTap: () => - model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: SizedBox( - height: - MediaQuery.of(context).size.height * - 0.7, - width: MediaQuery.of(context).size.width, - child: Padding( - padding: - MediaQuery.viewInsetsOf(context), - child: - VisitorSearchModalTemplateComponentWidget( - getVisitors: (visitorsParam) async { - model.visitorJsonList = - visitorsParam! - .toList() - .cast(); - safeSetState(() {}); - }, - getDocs: (docsParam) async { - model.visitorStrList = strListToStr( - docsParam!.toList()); - safeSetState(() {}); - }, + if (model.visitorJsonList.isNotEmpty) + Builder( + builder: (context) { + final visitorListView = + model.visitorJsonList.map((e) => e).toList(); + return ListView.separated( + padding: const EdgeInsets.fromLTRB( + 0, + 0, + 20, + 20, + ), + shrinkWrap: true, + scrollDirection: Axis.vertical, + itemCount: visitorListView.length, + separatorBuilder: (_, __) => + const SizedBox(height: 5.0), + itemBuilder: (context, visitorListViewIndex) { + final visitorListViewItem = + visitorListView[visitorListViewIndex]; + return Padding( + padding: + const EdgeInsets.symmetric(horizontal: 30), + child: Container( + width: MediaQuery.of(context).size.width, + height: 70.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context) + .primaryBackground, + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: 50.0, + height: 50.0, + clipBehavior: Clip.antiAlias, + decoration: const BoxDecoration( + shape: BoxShape.circle, + ), + child: CachedNetworkImage( + fadeInDuration: + const Duration(milliseconds: 500), + fadeOutDuration: + const Duration(milliseconds: 500), + imageUrl: + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${model.devUUID}&userUUID=${model.userUUID}&cliID=${model.cliUUID}&atividade=getFoto&Documento=${getJsonField(visitorListViewItem, r'''$.VTE_DOCUMENTO''').toString()}&tipo=E", + fit: BoxFit.cover, ), ), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - text: '', - icon: Icon( - Icons.add, - color: FlutterFlowTheme.of(context).primary, - size: 30.0, - ), - options: FFButtonOptions( - width: MediaQuery.sizeOf(context).width * 0.8, - height: 80.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: Text( + getJsonField(visitorListViewItem, + r'''$.VTE_NOME''') + .toString(), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + overflow: TextOverflow.ellipsis, + ), + ), + ), + IconButton( + onPressed: () async { + safeSetState(() { + model.removeFromVisitorJsonList( + visitorListViewItem); + if (model.visitorJsonList.isEmpty) { + model.visitorStrList = ''; + } + }); + }, + icon: const Icon(Icons.close), + ), + ], ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent4, - width: 1.0, + ), + ); + }, + ); + }, + ), + Stack( + children: [ + GestureDetector( + onTap: () async { + safeSetState(() { + _isLoading = true; + }); + + await showModalBottomSheet( + isScrollControlled: true, + isDismissible: true, + backgroundColor: FlutterFlowTheme.of(context) + .primaryBackground, + enableDrag: true, + context: context, + builder: (context) { + return GestureDetector( + onTap: () => model.unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: SizedBox( + height: MediaQuery.of(context).size.height * + 0.7, + width: MediaQuery.of(context).size.width, + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: + VisitorSearchModalTemplateComponentWidget( + getVisitors: (visitorsParam) async { + model.visitorJsonList = visitorsParam! + .toList() + .cast(); + safeSetState(() {}); + }, + getDocs: (docsParam) async { + model.visitorStrList = + strListToStr(docsParam!.toList()); + safeSetState(() {}); + }, + ), + ), + ), + ); + }, + ).then((value) => safeSetState(() { + _isLoading = false; + })); + }, + child: Center( + child: Container( + width: MediaQuery.of(context).size.width * 0.8, + height: 120, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), + border: Border.all( + color: FlutterFlowTheme.of(context).accent4, + width: 1.0, + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _isLoading + ? SizedBox( + width: 30.0, + height: 30.0, + child: CircularProgressIndicator( + valueColor: + AlwaysStoppedAnimation( + FlutterFlowTheme.of(context) + .primary, + ), + ), + ) + : Icon( + Icons.add, + color: FlutterFlowTheme.of(context) + .primary, + size: 30.0, + ), + Padding( + padding: + const EdgeInsets.fromLTRB(0, 15, 0, 0), + child: Text( + FFLocalizations.of(context).getText( + 'r8soavtz', + ), + textAlign: TextAlign.center, + style: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: + FlutterFlowTheme.of(context) + .titleSmallFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: limitedFontSize, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), + ), + ), + ) + ], ), - borderRadius: BorderRadius.circular(8.0), ), ), ), + ], + ), + ], + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + '0meymh6u', + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 50.0, 0.0, 0.0), - child: Container( - width: MediaQuery.sizeOf(context).width * 0.8, - height: 20.0, - decoration: const BoxDecoration(), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: AutoSizeText( - FFLocalizations.of(context).getText( - 'r8soavtz', + ), + Column( + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: Container( + width: 100.0, + height: 45.0, + decoration: const BoxDecoration(), + child: FutureBuilder( + future: PhpGroup.getDadosCall.call(), + builder: (context, snapshot) { + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: + FlutterFlowTheme.of(context) + .primary, + size: 50.0, + ), + ), + ); + } + + final reasonsJsonList = + PhpGroup.getDadosCall.reasonsJsonList( + snapshot.data!.jsonBody); + final reasonsOptionLabels = PhpGroup + .getDadosCall + .reasonsMotDescStrList( + snapshot.data!.jsonBody); + + model.processDropDown1(reasonsJsonList!); + + return FlutterFlowDropDown( + fillColor: FlutterFlowTheme.of(context) + .primaryBackground, + controller: + model.dropDownValueController1, + options: model.reasonsDropDown1, + optionLabels: reasonsOptionLabels, + onChanged: (val) => safeSetState( + () => model.dropDownValue1 = val), + width: double.infinity, + height: double.infinity, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '6p3e0bzr', + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context) + .accent4, + borderWidth: 0.5, + borderRadius: 10.0, + margin: const EdgeInsetsDirectional + .fromSTEB(16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ); + }, + ), ), + ), + ), + ], + ), + if (model.dropDownValue1 == '') + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 30.0, vertical: 5.0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Field is Required', + ptText: 'Campo Obrigatório', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context) + .customColor6, + fontSize: 12.0)), + ), + ], + ), + ], + ), + Column( + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + child: Container( + width: 100.0, + height: 45.0, + decoration: const BoxDecoration(), + child: FutureBuilder( + future: PhpGroup.getDadosCall.call(), + builder: (context, snapshot) { + if (!snapshot.hasData) { + return Center( + child: SizedBox( + width: 50.0, + height: 50.0, + child: SpinKitCircle( + color: + FlutterFlowTheme.of(context) + .primary, + size: 50.0, + ), + ), + ); + } + + final lavelsJsonList = + PhpGroup.getDadosCall.levelJsonList( + snapshot.data!.jsonBody); + final lavelsOptionLabels = PhpGroup + .getDadosCall + .levelNACDescricaoStrList( + snapshot.data!.jsonBody); + model.processDropDown2(lavelsJsonList!); + + return FlutterFlowDropDown( + controller: + model.dropDownValueController2, + options: model.lavelsDropDown2, + optionLabels: lavelsOptionLabels, + onChanged: (val) => safeSetState( + () => model.dropDownValue2 = val), + width: double.infinity, + height: double.infinity, + textStyle: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts + .asMap() + .containsKey( + FlutterFlowTheme.of( + context) + .bodyMediumFamily), + ), + hintText: + FFLocalizations.of(context).getText( + '2wun8p6c', + ), + icon: Icon( + Icons.keyboard_arrow_down_rounded, + color: FlutterFlowTheme.of(context) + .accent1, + size: 24.0, + ), + elevation: 2.0, + borderColor: + FlutterFlowTheme.of(context) + .accent4, + borderWidth: 0.5, + borderRadius: 10.0, + margin: const EdgeInsetsDirectional + .fromSTEB(16.0, 0.0, 16.0, 0.0), + hidesUnderline: true, + fillColor: FlutterFlowTheme.of(context) + .primaryBackground, + isOverButton: true, + isSearchable: false, + isMultiSelect: false, + ); + }, + ), + ), + ), + ), + ], + ), + if (model.dropDownValue2 == '') + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 30.0, vertical: 5.0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Field is Required', + ptText: 'Campo Obrigatório', + ), + style: TextStyle( + color: FlutterFlowTheme.of(context) + .customColor6, + fontSize: 12.0)), + ), + ], + ), + ], + ), + ].divide(const SizedBox(height: 10.0)), + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 24.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + '8rk26eg1', + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 30.0, 0.0, 30.0, 20.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Flexible( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 130.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'lgv0q5ht', + ), + textAlign: TextAlign.start, style: FlutterFlowTheme.of(context) .bodyMedium .override( fontFamily: FlutterFlowTheme.of(context) .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap() .containsKey( @@ -994,662 +1342,358 @@ Widget scheduleVisit(BuildContext context, ScheduleCompleteVisitPageModel model, ), ), ), - ), - ), - ], - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '0meymh6u', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Column( - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: Container( - width: 100.0, - height: 45.0, - decoration: const BoxDecoration(), - child: FutureBuilder( - future: PhpGroup.getDadosCall.call(), - builder: (context, snapshot) { - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context) - .primary, - size: 50.0, - ), - ), - ); - } - - final reasonsJsonList = - PhpGroup.getDadosCall.reasonsJsonList( - snapshot.data!.jsonBody); - final reasonsOptionLabels = PhpGroup - .getDadosCall - .reasonsMotDescStrList( - snapshot.data!.jsonBody); - - model.processDropDown1(reasonsJsonList!); - - return FlutterFlowDropDown( - fillColor: FlutterFlowTheme.of(context) - .primaryBackground, - controller: - model.dropDownValueController1, - options: model.reasonsDropDown1, - optionLabels: reasonsOptionLabels, - onChanged: (val) => safeSetState( - () => model.dropDownValue1 = val), - width: double.infinity, - height: double.infinity, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '6p3e0bzr', - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context).accent4, - borderWidth: 0.5, - borderRadius: 10.0, - margin: - const EdgeInsetsDirectional.fromSTEB( - 16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ); - }, - ), - ), - ), - ), - ], - ), - if (model.dropDownValue1 == '') - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 30.0, vertical: 5.0), - child: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Field is Required', - ptText: 'Campo Obrigatório', - ), - style: TextStyle( - color: FlutterFlowTheme.of(context) - .customColor6, - fontSize: 12.0)), - ), - ], - ), - ], - ), - Column( - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: Container( - width: 100.0, - height: 45.0, - decoration: const BoxDecoration(), - child: FutureBuilder( - future: PhpGroup.getDadosCall.call(), - builder: (context, snapshot) { - if (!snapshot.hasData) { - return Center( - child: SizedBox( - width: 50.0, - height: 50.0, - child: SpinKitCircle( - color: FlutterFlowTheme.of(context) - .primary, - size: 50.0, - ), - ), - ); - } - - final lavelsJsonList = PhpGroup.getDadosCall - .levelJsonList(snapshot.data!.jsonBody); - final lavelsOptionLabels = PhpGroup - .getDadosCall - .levelNACDescricaoStrList( - snapshot.data!.jsonBody); - model.processDropDown2(lavelsJsonList!); - - return FlutterFlowDropDown( - controller: - model.dropDownValueController2, - options: model.lavelsDropDown2, - optionLabels: lavelsOptionLabels, - onChanged: (val) => safeSetState( - () => model.dropDownValue2 = val), - width: double.infinity, - height: double.infinity, - textStyle: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - hintText: - FFLocalizations.of(context).getText( - '2wun8p6c', - ), - icon: Icon( - Icons.keyboard_arrow_down_rounded, - color: FlutterFlowTheme.of(context) - .accent1, - size: 24.0, - ), - elevation: 2.0, - borderColor: - FlutterFlowTheme.of(context).accent4, - borderWidth: 0.5, - borderRadius: 10.0, - margin: - const EdgeInsetsDirectional.fromSTEB( - 16.0, 0.0, 16.0, 0.0), - hidesUnderline: true, - fillColor: FlutterFlowTheme.of(context) - .primaryBackground, - isOverButton: true, - isSearchable: false, - isMultiSelect: false, - ); - }, - ), - ), - ), - ), - ], - ), - if (model.dropDownValue2 == '') - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 30.0, vertical: 5.0), - child: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Field is Required', - ptText: 'Campo Obrigatório', - ), - style: TextStyle( - color: FlutterFlowTheme.of(context) - .customColor6, - fontSize: 12.0)), - ), - ], - ), - ], - ), - ].divide(const SizedBox(height: 10.0)), - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 24.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - '8rk26eg1', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 30.0, 0.0, 30.0, 20.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Flexible( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 130.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'lgv0q5ht', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - ), - ), - ), - Switch( - value: model.switchValue!, - onChanged: (newValue) async { - safeSetState(() => model.switchValue = newValue); - }, - focusColor: FlutterFlowTheme.of(context).primary, - trackColor: WidgetStateProperty.resolveWith( - (states) { - if (states.contains(WidgetState.disabled)) { + Switch( + value: model.switchValue!, + onChanged: (newValue) async { + safeSetState(() => model.switchValue = newValue); + }, + focusColor: FlutterFlowTheme.of(context).primary, + trackColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context).alternate; + } return FlutterFlowTheme.of(context).alternate; - } - return FlutterFlowTheme.of(context).alternate; - }, + }, + ), + hoverColor: + FlutterFlowTheme.of(context).primaryBackground, + overlayColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context).accent4; + } + return FlutterFlowTheme.of(context) + .primaryBackground; + }, + ), + trackOutlineColor: WidgetStateProperty.resolveWith( + (states) { + if (states.contains(WidgetState.disabled)) { + return FlutterFlowTheme.of(context).accent4; + } + return FlutterFlowTheme.of(context) + .primaryBackground; + }, + ), + activeColor: FlutterFlowTheme.of(context).success, + activeTrackColor: + FlutterFlowTheme.of(context).primaryBackground, + inactiveTrackColor: + FlutterFlowTheme.of(context).primaryBackground, + inactiveThumbColor: + FlutterFlowTheme.of(context).error, ), - hoverColor: - FlutterFlowTheme.of(context).primaryBackground, - overlayColor: WidgetStateProperty.resolveWith( - (states) { - if (states.contains(WidgetState.disabled)) { - return FlutterFlowTheme.of(context).accent4; - } - return FlutterFlowTheme.of(context) - .primaryBackground; - }, - ), - trackOutlineColor: WidgetStateProperty.resolveWith( - (states) { - if (states.contains(WidgetState.disabled)) { - return FlutterFlowTheme.of(context).accent4; - } - return FlutterFlowTheme.of(context) - .primaryBackground; - }, - ), - activeColor: FlutterFlowTheme.of(context).success, - activeTrackColor: - FlutterFlowTheme.of(context).primaryBackground, - inactiveTrackColor: - FlutterFlowTheme.of(context).primaryBackground, - inactiveThumbColor: - FlutterFlowTheme.of(context).error, - ), - ], + ], + ), ), - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.max, - children: [ - Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( + ], + ), + Column( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 20.0, 0.0, 0.0, 24.0), + child: Text( + FFLocalizations.of(context).getText( + 'eftcs67c', + ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + ), + ), + ), + ), + Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 24.0), - child: Text( - FFLocalizations.of(context).getText( - 'eftcs67c', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - fontWeight: FontWeight.w600, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), + 24.0, 0.0, 24.0, 0.0), + child: SizedBox( + width: double.infinity, + child: TextFormField( + controller: model.textController3, + focusNode: model.textFieldFocusNode3, + autofocus: false, + cursorColor: FlutterFlowTheme.of(context).primary, + textInputAction: TextInputAction.next, + obscureText: false, + decoration: InputDecoration( + isDense: false, + labelText: FFLocalizations.of(context).getText( + 't0q2vuup', + ), + labelStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: + FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + hintText: FFLocalizations.of(context).getText( + 'w18iztdm', + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: + FlutterFlowTheme.of(context).primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .labelMediumFamily), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).accent4, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(10.0), + ), + suffixIcon: Icon( + Icons.text_fields, + color: FlutterFlowTheme.of(context).accent1, ), - ), - ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: SizedBox( - width: double.infinity, - child: TextFormField( - controller: model.textController3, - focusNode: model.textFieldFocusNode3, - autofocus: false, - cursorColor: FlutterFlowTheme.of(context).primary, - textInputAction: TextInputAction.next, - obscureText: false, - decoration: InputDecoration( - isDense: false, - labelText: FFLocalizations.of(context).getText( - 't0q2vuup', ), - labelStyle: FlutterFlowTheme.of(context) - .labelMedium + style: FlutterFlowTheme.of(context) + .bodyMedium .override( fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, + .bodyMediumFamily, color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) - .labelMediumFamily), + .bodyMediumFamily), ), - hintText: FFLocalizations.of(context).getText( - 'w18iztdm', - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent4, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(10.0), - ), - suffixIcon: Icon( - Icons.text_fields, - color: FlutterFlowTheme.of(context).accent1, - ), + textAlign: TextAlign.start, + maxLines: null, + maxLength: 80, + validator: model.textController3Validator + .asValidator(context), ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), - textAlign: TextAlign.start, - maxLines: null, - maxLength: 80, - validator: - model.textController3Validator.asValidator(context), ), ), - ), - ], - ), - Container( - width: 100.0, - height: 54.0, - decoration: const BoxDecoration(), - ), - ], + ], + ), + Container( + width: 100.0, + height: 54.0, + decoration: const BoxDecoration(), + ), + ], + ), ), - ), - FFButtonWidget( - text: FFLocalizations.of(context).getVariableText( - enText: 'Schedule', - ptText: 'Agendar', - ), - onPressed: model.isValid() - ? () async { - Future scheduleVisit() async { - await PhpGroup.postScheduleVisitCall - .call( - devDesc: model.textController3.text, - idVisitante: model.visitorStrList, - dtInicio: model - .convertDateFormat(model.textController1.text), - dtFim: model - .convertDateFormat(model.textController2.text), - unica: model.switchValue == true ? 'S' : 'N', - idMotivo: extractIdToStr(model.dropDownValue1!), - idNAC: extractIdToStr(model.dropDownValue2!), - obs: model.textController3.text, - ) - .catchError((e) async => await DialogUtil.errorDefault(context)) - .then((value) async { - if (PhpGroup.postScheduleVisitCall.error( - (value.jsonBody ?? ''), - ) == - false) { - context.pop(); + FFButtonWidget( + text: FFLocalizations.of(context).getVariableText( + enText: 'Schedule', + ptText: 'Agendar', + ), + onPressed: model.isValid() + ? () async { + Future scheduleVisit() async { + await PhpGroup.postScheduleVisitCall + .call( + devDesc: model.textController3.text, + idVisitante: model.visitorStrList, + dtInicio: model + .convertDateFormat(model.textController1.text), + dtFim: model + .convertDateFormat(model.textController2.text), + unica: model.switchValue == true ? 'S' : 'N', + idMotivo: extractIdToStr(model.dropDownValue1!), + idNAC: extractIdToStr(model.dropDownValue2!), + obs: model.textController3.text, + ) + .catchError((e) async => + await DialogUtil.errorDefault(context)) + .then((value) async { + if (PhpGroup.postScheduleVisitCall.error( + (value.jsonBody ?? ''), + ) == + false) { + context.pop(); - model.dropDownValue1 = null; - model.dropDownValue2 = null; - model.dropDownValueController1 = - FormFieldController(''); - model.dropDownValueController2 = - FormFieldController(''); - model.visitorStrList = ''; - model.visitorJsonList = []; + model.dropDownValue1 = null; + model.dropDownValue2 = null; + model.dropDownValueController1 = + FormFieldController(''); + model.dropDownValueController2 = + FormFieldController(''); + model.visitorStrList = ''; + model.visitorJsonList = []; - ToastUtil.showToast( - message: FFLocalizations.of(context) - .getVariableText( - ptText: 'Visitante já adicionado!', - enText: 'Visitor already added!'), - gravity: ToastGravity.TOP, - backgroundColor: Colors.green); + ToastUtil.showToast( + message: FFLocalizations.of(context) + .getVariableText( + ptText: 'Visitante já adicionado!', + enText: 'Visitor already added!'), + gravity: ToastGravity.TOP, + backgroundColor: Colors.green); - await ShareUtil.showShare(value.jsonBody); - } else { - final message = value.jsonBody['error_msg']; - await DialogUtil.error(context, message); - context.pop(); - } - }); + await ShareUtil.showShare(value.jsonBody); + } else { + final message = value.jsonBody['error_msg']; + await DialogUtil.error(context, message); + context.pop(); + } + }); - safeSetState(() {}); - } + safeSetState(() {}); + } - if (model.visitorJsonList.length > 1) { - final title = FFLocalizations.of(context).getVariableText( - ptText: 'Cadastrar Múltiplos Visitantes', - enText: 'Register Multiple Visitors', - ); - final content = FFLocalizations.of(context).getVariableText( - ptText: - 'Você deseja agendar uma visita para ${model.visitorJsonList.length} visitantes?', - enText: - 'Do you want to schedule a visit for ${model.visitorJsonList.length} visitors?', - ); + if (model.visitorJsonList.length > 1) { + final title = FFLocalizations.of(context).getVariableText( + ptText: 'Cadastrar Múltiplos Visitantes', + enText: 'Register Multiple Visitors', + ); + final content = + FFLocalizations.of(context).getVariableText( + ptText: + 'Você deseja agendar uma visita para ${model.visitorJsonList.length} visitantes?', + enText: + 'Do you want to schedule a visit for ${model.visitorJsonList.length} visitors?', + ); - showAlertDialog(context, title, content, scheduleVisit); - } else { - await showDialog( - context: context, - builder: (context) { - return GestureDetector( - onTap: () => model.unfocusNode.canRequestFocus - ? FocusScope.of(context) - .requestFocus(model.unfocusNode) - : FocusScope.of(context).unfocus(), - child: Dialog( - alignment: Alignment.topCenter, - child: SizedBox( - child: DetailsComponentWidget( - buttons: [ - FFButtonWidget( - text: FFLocalizations.of(context) - .getVariableText( - enText: 'Done', - ptText: 'Confirmar', - ), - icon: const Icon(Icons.done), - onPressed: scheduleVisit, - options: FFButtonOptions( - width: 130, - height: 40, - color: FlutterFlowTheme.of(context) - .primaryBackground, - elevation: 0, - textStyle: TextStyle( - color: FlutterFlowTheme.of(context) - .primaryText, + showAlertDialog(context, title, content, scheduleVisit); + } else { + await showDialog( + context: context, + builder: (context) { + return GestureDetector( + onTap: () => model.unfocusNode.canRequestFocus + ? FocusScope.of(context) + .requestFocus(model.unfocusNode) + : FocusScope.of(context).unfocus(), + child: Dialog( + alignment: Alignment.topCenter, + child: SizedBox( + child: DetailsComponentWidget( + buttons: [ + FFButtonWidget( + text: FFLocalizations.of(context) + .getVariableText( + enText: 'Done', + ptText: 'Confirmar', ), - borderSide: BorderSide( + icon: const Icon(Icons.done), + onPressed: scheduleVisit, + options: FFButtonOptions( + width: 130, + height: 40, color: FlutterFlowTheme.of(context) .primaryBackground, - width: 1, + elevation: 0, + textStyle: TextStyle( + color: FlutterFlowTheme.of(context) + .primaryText, + ), + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primaryBackground, + width: 1, + ), ), ), - ), - ], - imagePath: - 'https://freaccess.com.br/freaccess/getImage.php?cliID=${model.cliUUID}&atividade=getFoto&Documento=${model.visitorJsonList[0]['VTE_DOCUMENTO'] ?? ''}&tipo=E', - labelsHashMap: { - 'Nome': model.visitorJsonList[0]['VTE_NOME'], - 'Start': model.textController1.text, - 'End': model.textController2.text, - 'Reason': (RegExp(r'MOT_DESCRICAO:\s*([^,]+)') - .firstMatch( - model.dropDownValue1.toString()) - ?.group(1) - .toString()) ?? - '', - 'Level': (RegExp(r'NAC_DESCRICAO:\s*([^,]+)') - .firstMatch( - model.dropDownValue2.toString()) - ?.group(1) - .toString()) ?? - '', - 'Single Visit': - model.switchValue == true ? 'S' : 'N', - if (model.textController3.text.isNotEmpty) - 'Observation': model.textController3.text, - }, - statusHashMap: [ - Map.from({ - FFLocalizations.of(context).getVariableText( - ptText: 'Inativo', - enText: 'Inactive', - ): FlutterFlowTheme.of(context).success, - }), - ], - onTapCardItemAction: () async {}, + ], + imagePath: + 'https://freaccess.com.br/freaccess/getImage.php?cliID=${model.cliUUID}&atividade=getFoto&Documento=${model.visitorJsonList[0]['VTE_DOCUMENTO'] ?? ''}&tipo=E', + labelsHashMap: { + 'Nome': model.visitorJsonList[0] + ['VTE_NOME'], + 'Start': model.textController1.text, + 'End': model.textController2.text, + 'Reason': (RegExp( + r'MOT_DESCRICAO:\s*([^,]+)') + .firstMatch( + model.dropDownValue1.toString()) + ?.group(1) + .toString()) ?? + '', + 'Level': (RegExp( + r'NAC_DESCRICAO:\s*([^,]+)') + .firstMatch( + model.dropDownValue2.toString()) + ?.group(1) + .toString()) ?? + '', + 'Single Visit': + model.switchValue == true ? 'S' : 'N', + if (model.textController3.text.isNotEmpty) + 'Observation': model.textController3.text, + }, + statusHashMap: [ + Map.from({ + FFLocalizations.of(context) + .getVariableText( + ptText: 'Inativo', + enText: 'Inactive', + ): FlutterFlowTheme.of(context).success, + }), + ], + onTapCardItemAction: () async {}, + ), ), ), - ), - ); - }, - ).then((value) => safeSetState(() {})); + ); + }, + ).then((value) => safeSetState(() {})); + } } - } - : null, - options: FFButtonOptions( - height: MediaQuery.of(context).size.height * 0.05, - width: MediaQuery.of(context).size.height * 0.2, - color: FlutterFlowTheme.of(context).primary, - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15.0), - bottomRight: Radius.circular(15.0), - topLeft: Radius.circular(15.0), - topRight: Radius.circular(15.0), - ), - disabledColor: FlutterFlowTheme.of(context).customColor5), - showLoadingIndicator: true, - ), - ].addToEnd(const SizedBox(height: 30.0)), - ), - ); + : null, + options: FFButtonOptions( + height: MediaQuery.of(context).size.height * 0.05, + width: MediaQuery.of(context).size.height * 0.2, + color: FlutterFlowTheme.of(context).primary, + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15.0), + bottomRight: Radius.circular(15.0), + topLeft: Radius.circular(15.0), + topRight: Radius.circular(15.0), + ), + disabledColor: FlutterFlowTheme.of(context).customColor5), + showLoadingIndicator: true, + ), + ].addToEnd(const SizedBox(height: 30.0)), + ), + ); + } } From f543a200f14a60210584c43a8f037131d2a6d37c Mon Sep 17 00:00:00 2001 From: Lucas Date: Tue, 5 Nov 2024 17:30:03 -0300 Subject: [PATCH 3/7] Feat: Finalizada a tela de visita completa e de encomendas --- .../menu_button_item_widget.dart | 4 +- .../order_filter_modal_widget.dart | 7 +- .../local_profile_component_widget.dart | 2 +- .../menu_staggered_view_component_widget.dart | 2 +- .../card_item_template_component_widget.dart | 39 +- .../details_component_widget.dart | 18 +- ...earch_modal_template_component_widget.dart | 29 +- lib/flutter_flow/flutter_flow_util.dart | 19 +- lib/flutter_flow/flutter_flow_widgets.dart | 3 +- .../package_order_page.dart | 7 + .../schedule_complete_visit_page_model.dart | 14 +- .../schedule_complete_visit_page_widget.dart | 496 +++++++++--------- .../visit_history_page_widget.dart | 12 +- lib/shared/utils/limited_text_size.dart | 21 + 14 files changed, 396 insertions(+), 277 deletions(-) create mode 100644 lib/shared/utils/limited_text_size.dart diff --git a/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart index aff8b187..1c87f710 100644 --- a/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart +++ b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart @@ -34,9 +34,9 @@ class _MenuButtonWidgetState extends State { @override Widget build(BuildContext context) { final textScaler = MediaQuery.textScalerOf(context); - final double baseFontSize = 10; + final double baseFontSize = 14; final double scaledFontSize = baseFontSize * textScaler.scale(1); - final double limitedFontSize = scaledFontSize > 22 ? 10 : baseFontSize; + final double limitedFontSize = scaledFontSize > 24 ? 12 : baseFontSize; return InkWell( splashColor: Colors.transparent, diff --git a/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart b/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart index 368ad6b9..2fac9684 100644 --- a/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart +++ b/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart @@ -6,6 +6,7 @@ import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; // ignore: unused_import import 'package:hub/shared/helpers/secure_storage_helper.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/storage_util.dart'; class OrderFilterModalWidget extends StatefulWidget { @@ -226,8 +227,8 @@ class _OrderFilterModalWidgetState extends State { mainAxisSize: MainAxisSize.min, children: [ _buildCheckboxListTile( - 'adresseeType', adresseeTypeOptions, 14), - _buildCheckboxListTile('status', statusOptions, 14), + 'adresseeType', adresseeTypeOptions, LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 22, 10)), + _buildCheckboxListTile('status', statusOptions, LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 22, 10)), ], ), ), @@ -239,7 +240,7 @@ class _OrderFilterModalWidgetState extends State { foregroundColor: FlutterFlowTheme.of(context).info, backgroundColor: FlutterFlowTheme.of(context).primary, ), - child: Text(FFLocalizations.of(context).getText('88kshkph')), + child: Text(FFLocalizations.of(context).getText('88kshkph'), style: TextStyle(fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 22, 10))), ), ], ), diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart index 288d8feb..f11ca000 100644 --- a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart +++ b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart @@ -62,7 +62,7 @@ class _LocalProfileComponentWidgetState final textScaler = MediaQuery.textScalerOf(context); final double baseFontSize = 14.0; final double scaledFontSize = baseFontSize * textScaler.scale(1); - final double limitedFontSize = scaledFontSize > 14.0 ? 9 : scaledFontSize; + final double limitedFontSize = scaledFontSize > 20 ? 12 : scaledFontSize; return Container( decoration: const BoxDecoration(), diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart index e5f916ac..bc872bab 100644 --- a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart +++ b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart @@ -54,7 +54,7 @@ class _MenuStaggeredViewComponentWidgetState Widget build(BuildContext context) { final textScaler = MediaQuery.textScalerOf(context); final double scaledFontSize = 14 * textScaler.scale(1); - final int crossAxisCount = scaledFontSize > 20 ? 2 : 3; + final int crossAxisCount = scaledFontSize >= 26 ? 1 : scaledFontSize >= 18 ? 2 : 3; return Column( children: [ diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart index f306eff7..6859bb06 100644 --- a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart +++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart @@ -3,6 +3,7 @@ import 'dart:collection'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; @@ -56,6 +57,8 @@ class _CardItemTemplateComponentWidgetState } List _generateLabels() { + double limitedTextSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 24, 10); + return labelsLinkedHashMap.entries.map((entry) { final key = entry.key; final text = entry.value.toString(); @@ -73,6 +76,7 @@ class _CardItemTemplateComponentWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), color: FlutterFlowTheme.of(context).primaryText, + fontSize: limitedTextSize, ), ), const SizedBox(width: 8), @@ -82,7 +86,7 @@ class _CardItemTemplateComponentWidgetState overflow: TextOverflow.ellipsis, style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: 12.5, + fontSize: limitedTextSize, letterSpacing: 0.0, fontWeight: FontWeight.bold, useGoogleFonts: GoogleFonts.asMap().containsKey( @@ -125,21 +129,24 @@ class _CardItemTemplateComponentWidgetState final text = entry.key; final color = entry.value; - return Container( - padding: const EdgeInsets.all(5), - width: MediaQuery.of(context).size.width * 0.25, - decoration: BoxDecoration( - color: color, - borderRadius: BorderRadius.circular(5), - ), - child: Center( - child: Text( - text, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: FlutterFlowTheme.of(context).info, - fontSize: 12, - fontWeight: FontWeight.bold, + return Tooltip( + message: text, + child: Container( + padding: const EdgeInsets.all(5), + width: MediaQuery.of(context).size.width * 0.25, + decoration: BoxDecoration( + color: color, + borderRadius: BorderRadius.circular(5), + ), + child: Center( + child: Text( + text, + overflow: TextOverflow.ellipsis, + style: TextStyle( + color: FlutterFlowTheme.of(context).info, + fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 12, 22, 10), + fontWeight: FontWeight.bold, + ), ), ), ), diff --git a/lib/components/templates_components/details_component/details_component_widget.dart b/lib/components/templates_components/details_component/details_component_widget.dart index fbfef1cb..0c032822 100644 --- a/lib/components/templates_components/details_component/details_component_widget.dart +++ b/lib/components/templates_components/details_component/details_component_widget.dart @@ -6,6 +6,7 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:hub/components/templates_components/details_component/details_component_model.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; class DetailsComponentWidget extends StatefulWidget { @@ -62,7 +63,12 @@ class _DetailsComponentWidgetState extends State { @override Widget build(BuildContext context) { // CachedNetworkImage.evictFromCache(widget.imagePath ?? ''); - + final double limitedFontSize = LimitedTextSizeUtil.getLimitedBodyFontSize( + context, + 12.0, + 16.0, + 10.0, + ); return Container( constraints: BoxConstraints( maxWidth: MediaQuery.of(context).size.width, @@ -132,7 +138,9 @@ class _DetailsComponentWidgetState extends State { useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) .labelMediumFamily, + ), + fontSize: limitedFontSize, ), hintStyle: FlutterFlowTheme.of(context) .labelMedium @@ -145,6 +153,7 @@ class _DetailsComponentWidgetState extends State { FlutterFlowTheme.of(context) .labelMediumFamily, ), + fontSize: limitedFontSize, ), focusedBorder: InputBorder.none, errorBorder: InputBorder.none, @@ -162,6 +171,7 @@ class _DetailsComponentWidgetState extends State { useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily, ), + fontSize: limitedFontSize, ), textAlign: TextAlign.start, maxLines: null, @@ -186,6 +196,7 @@ class _DetailsComponentWidgetState extends State { return TextFormField( readOnly: true, initialValue: '$value', + style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, @@ -194,8 +205,11 @@ class _DetailsComponentWidgetState extends State { useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily, ), + fontSize: limitedFontSize, ), + decoration: InputDecoration( + labelText: key, filled: true, fillColor: FlutterFlowTheme.of(context).primaryBackground, @@ -216,7 +230,9 @@ class _DetailsComponentWidgetState extends State { useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily, ), + ), + hintStyle: FlutterFlowTheme.of(context) .labelMedium .override( diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index 29597fc5..a2c1020a 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -14,6 +14,7 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; class VisitorSearchModalTemplateComponentWidget extends StatefulWidget { const VisitorSearchModalTemplateComponentWidget({ @@ -59,6 +60,19 @@ class _VisitorSearchModalTemplateComponentWidgetState @override Widget build(BuildContext context) { + final double limitedFontSize = LimitedTextSizeUtil.getLimitedBodyFontSize( + context, + 12, + 16, + 10 + ); + final double limitedHeaderFontSize = LimitedTextSizeUtil.getLimitedBodyFontSize( + context, + 14, + 16, + 12 + ); + return Padding( padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), child: Container( @@ -99,8 +113,9 @@ class _VisitorSearchModalTemplateComponentWidgetState obscureText: false, decoration: InputDecoration( isDense: true, - labelText: FFLocalizations.of(context).getText( - 'cjlpru1m' /* Procure pelo documento do visi... */, + labelText: FFLocalizations.of(context).getVariableText( + enText: 'Document of the Visitor', + ptText: 'Documento do Visitante', ), labelStyle: FlutterFlowTheme.of(context).labelMedium.override( fontFamily: @@ -109,6 +124,7 @@ class _VisitorSearchModalTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), + fontSize: limitedFontSize, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -170,6 +186,7 @@ class _VisitorSearchModalTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedFontSize, ), keyboardType: const TextInputType.numberWithOptions(signed: true), @@ -198,6 +215,7 @@ class _VisitorSearchModalTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), + fontSize: limitedHeaderFontSize, ), ), ), @@ -212,6 +230,7 @@ class _VisitorSearchModalTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedHeaderFontSize, ), ), ), @@ -311,6 +330,7 @@ class _VisitorSearchModalTemplateComponentWidgetState FlutterFlowTheme.of( context) .bodyLargeFamily), + fontSize: limitedFontSize, ), ), ), @@ -382,8 +402,8 @@ class _VisitorSearchModalTemplateComponentWidgetState ptText: 'Enviar', ), options: FFButtonOptions( - width: MediaQuery.of(context).size.width * 0.3, - height: MediaQuery.of(context).size.width * 0.1, + width: MediaQuery.of(context).size.width * 0.4, + height: 40, padding: const EdgeInsetsDirectional.fromSTEB( 24.0, 0.0, 24.0, 0.0), iconPadding: const EdgeInsetsDirectional.fromSTEB( @@ -396,6 +416,7 @@ class _VisitorSearchModalTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).titleSmallFamily), + fontSize: limitedFontSize, ), elevation: 3.0, borderSide: const BorderSide( diff --git a/lib/flutter_flow/flutter_flow_util.dart b/lib/flutter_flow/flutter_flow_util.dart index eab12119..29fa1a0f 100644 --- a/lib/flutter_flow/flutter_flow_util.dart +++ b/lib/flutter_flow/flutter_flow_util.dart @@ -10,6 +10,7 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; import 'package:hub/flutter_flow/internationalization.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:intl/intl.dart'; import 'package:json_path/json_path.dart'; import 'package:timeago/timeago.dart' as timeago; @@ -565,13 +566,19 @@ void showSnackbar( void showAlertDialog(BuildContext context, String title, String content, Future Function() action) { + double limitedTextSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 20, 12); + double limitedHeaderSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 20, 28, 18); + showDialog( context: context, builder: (context) { return AlertDialog( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - title: Text(title), - content: Text(content), + title: Text(title, style: TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedHeaderSize), textAlign: TextAlign.center), + content: Padding( + padding: const EdgeInsets.all(8.0), + child: Text(content, style: TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedTextSize)), + ), actions: [ Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -581,15 +588,17 @@ void showAlertDialog(BuildContext context, String title, String content, onPressed: () => context.pop(), //Navigator.pop(context), options: FFButtonOptions( width: MediaQuery.of(context).size.width * 0.3, - height: MediaQuery.of(context).size.height * 0.05, + height: 50, color: FlutterFlowTheme.of(context).primaryBackground, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, + fontSize: limitedTextSize ), borderSide: BorderSide( color: FlutterFlowTheme.of(context).primaryBackground, width: 1, ), + splashColor: const Color.fromARGB(255, 129, 129, 129), borderRadius: BorderRadius.circular(10), elevation: 0, ), @@ -604,12 +613,14 @@ void showAlertDialog(BuildContext context, String title, String content, }, options: FFButtonOptions( width: MediaQuery.of(context).size.width * 0.3, - height: MediaQuery.of(context).size.height * 0.05, + height: 50, color: FlutterFlowTheme.of(context).primaryBackground, elevation: 0, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, + fontSize: limitedTextSize ), + splashColor: const Color.fromARGB(255, 129, 129, 129), borderSide: BorderSide( color: FlutterFlowTheme.of(context).primaryBackground, width: 1, diff --git a/lib/flutter_flow/flutter_flow_widgets.dart b/lib/flutter_flow/flutter_flow_widgets.dart index f9db2be0..7dc905a0 100644 --- a/lib/flutter_flow/flutter_flow_widgets.dart +++ b/lib/flutter_flow/flutter_flow_widgets.dart @@ -97,13 +97,14 @@ class _FFButtonWidgetState extends State { ), ), ) - : AutoSizeText( + : Text( text ?? '', style: text == null ? null : widget.options.textStyle?.withoutColor(), textAlign: widget.options.textAlign, maxLines: maxLines, overflow: TextOverflow.ellipsis, + ); final onPressed = widget.onPressed != null diff --git a/lib/pages/package_order_page/package_order_page.dart b/lib/pages/package_order_page/package_order_page.dart index f184983f..f1b5cf91 100644 --- a/lib/pages/package_order_page/package_order_page.dart +++ b/lib/pages/package_order_page/package_order_page.dart @@ -10,6 +10,7 @@ import 'package:hub/flutter_flow/flutter_flow_icon_button.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/log_util.dart'; import 'package:hub/shared/utils/storage_util.dart'; import 'package:hub/shared/utils/validator_util.dart'; @@ -178,6 +179,7 @@ class _PackageOrderPage extends State { defaultStatus: _selectedTypeSubject.value['status'] ?? '.*', + ), ), ), @@ -264,6 +266,11 @@ class _PackageOrderPage extends State { FFLocalizations.of(context).getVariableText( ptText: "Nenhuma encomenda encontrada!", enText: "No orders found!"), + style: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize( + context, 14, 24, 12), + ), )), ], ), diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart index 5e7de008..ff57d52b 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart @@ -9,6 +9,7 @@ import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/flutter_flow/request_manager.dart'; import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; import 'package:hub/shared/mixins/status_mixin.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/storage_util.dart'; import 'package:share_plus/share_plus.dart'; @@ -441,6 +442,7 @@ class ScheduleCompleteVisitPageModel ptText: 'Cancelar', enText: 'Cancel', ), + icon: const Icon(Icons.close), onPressed: () async { showAlertDialog( @@ -498,17 +500,19 @@ class ScheduleCompleteVisitPageModel }); }, options: FFButtonOptions( - width: 130, + width: MediaQuery.of(context).size.width * 0.3, height: 40, color: FlutterFlowTheme.of(context).primaryBackground, elevation: 0, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, + fontSize: LimitedTextSizeUtil.getNoResizeFont(context, 14), ), borderSide: BorderSide( color: FlutterFlowTheme.of(context).primaryBackground, width: 1, ), + splashColor: const Color.fromARGB(132, 255, 17, 0), // borderRadius: 12, ), ), @@ -532,17 +536,19 @@ class ScheduleCompleteVisitPageModel switchTab(0); }, options: FFButtonOptions( - width: 130, + width: MediaQuery.of(context).size.width * 0.5, height: 40, color: FlutterFlowTheme.of(context).primaryBackground, elevation: 0, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, + fontSize: LimitedTextSizeUtil.getNoResizeFont(context, 14), ), borderSide: BorderSide( color: FlutterFlowTheme.of(context).primaryBackground, width: 1, ), + splashColor: const Color.fromARGB(137, 134, 134, 134), // borderRadius: 12, ), ), @@ -566,17 +572,19 @@ URL do Convite: https://visita.freaccess.com.br/${item['VAW_ID']}/$cliUUID/${ite '''); }, options: FFButtonOptions( - width: 130, + width: MediaQuery.of(context).size.width * 0.3, height: 40, color: FlutterFlowTheme.of(context).primaryBackground, elevation: 0, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, + fontSize: LimitedTextSizeUtil.getNoResizeFont(context, 14), ), borderSide: BorderSide( color: FlutterFlowTheme.of(context).primaryBackground, width: 1, ), + splashColor: const Color.fromARGB(136, 97, 160, 255), // borderRadius: 12, ), ), 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 613ded1c..cb23ec42 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 @@ -19,6 +19,7 @@ import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart'; import 'package:hub/pages/schedule_complete_visit_page/visit_history_page_widget.dart'; import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/share_util.dart'; class ScheduleComplete extends StatefulWidget { @@ -170,10 +171,12 @@ class _ScheduleCompleteVisitPageWidgetState unselectedLabelColor: FlutterFlowTheme.of(context).primaryText, labelStyle: FlutterFlowTheme.of(context).titleMedium.override( fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, - fontSize: 13.0, + fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize( + context, 12.0, 16.0, 10.0), letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).titleMediumFamily), + ), unselectedLabelStyle: const TextStyle(), indicatorColor: FlutterFlowTheme.of(context).primary, @@ -259,115 +262,112 @@ class _ScheduleCompleteVisitPageWidgetState ), Row( mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, children: [ SizedBox( - width: MediaQuery.of(context).size.width, + width: MediaQuery.of(context).size.width * 0.85, height: scaledSizedBoxSize, child: Stack( children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: TextFormField( - controller: model.textController1, - readOnly: true, - focusNode: model.textFieldFocusNode1, - autovalidateMode: - AutovalidateMode.onUserInteraction, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - fontSize: limitedFontSize, - ), - hintText: - FFLocalizations.of(context).getText( - '53cbwqh9', - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: - FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - lineHeight: 1.0, - fontSize: limitedFontSize, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .accent4, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context) - .primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: - FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium + TextFormField( + controller: model.textController1, + readOnly: true, + focusNode: model.textFieldFocusNode1, + autovalidateMode: + AutovalidateMode.onUserInteraction, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap() .containsKey( FlutterFlowTheme.of(context) - .bodyMediumFamily), - lineHeight: 1.8, + .labelMediumFamily), fontSize: limitedFontSize, ), - textAlign: TextAlign.start, - validator: model.textController1Validator - .asValidator(context)), - ), + hintText: + FFLocalizations.of(context).getText( + '53cbwqh9', + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: + FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + lineHeight: 1.0, + fontSize: limitedFontSize, + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .accent4, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context) + .primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + suffixIcon: Icon( + Icons.date_range, + color: + FlutterFlowTheme.of(context).accent1, + ), + ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + lineHeight: 1.8, + fontSize: limitedFontSize, + ), + textAlign: TextAlign.start, + validator: model.textController1Validator + .asValidator(context)), Padding( padding: const EdgeInsetsDirectional.fromSTEB( 24.0, 0.0, 24.0, 0.0), @@ -522,109 +522,106 @@ class _ScheduleCompleteVisitPageWidgetState ), Row( mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, children: [ SizedBox( - width: MediaQuery.of(context).size.width, + width: MediaQuery.of(context).size.width * 0.85, height: scaledSizedBoxSize, child: Stack( children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - child: TextFormField( - readOnly: true, - controller: model.textController2, - focusNode: model.textFieldFocusNode2, - autovalidateMode: - AutovalidateMode.onUserInteraction, - autofocus: false, - obscureText: false, - decoration: InputDecoration( - isDense: true, - labelStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - fontSize: limitedFontSize, - ), - hintText: FFLocalizations.of(context).getText( - 'xpgc5e8d', - ), - hintStyle: FlutterFlowTheme.of(context) - .labelMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .labelMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .labelMediumFamily), - lineHeight: 1.0, - fontSize: limitedFontSize, - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).accent4, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: - FlutterFlowTheme.of(context).primary, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).error, - width: 0.5, - ), - borderRadius: BorderRadius.circular(8.0), - ), - suffixIcon: Icon( - Icons.date_range, - color: FlutterFlowTheme.of(context).accent1, - ), - ), - style: FlutterFlowTheme.of(context) - .bodyMedium + TextFormField( + readOnly: true, + controller: model.textController2, + focusNode: model.textFieldFocusNode2, + autovalidateMode: + AutovalidateMode.onUserInteraction, + autofocus: false, + obscureText: false, + decoration: InputDecoration( + isDense: true, + labelStyle: FlutterFlowTheme.of(context) + .labelMedium .override( fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap() .containsKey( FlutterFlowTheme.of(context) - .bodyMediumFamily), - lineHeight: 1.8, + .labelMediumFamily), fontSize: limitedFontSize, ), - textAlign: TextAlign.start, - validator: model.textController2Validator - .asValidator(context), + hintText: FFLocalizations.of(context).getText( + 'xpgc5e8d', + ), + hintStyle: FlutterFlowTheme.of(context) + .labelMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .labelMediumFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .labelMediumFamily), + lineHeight: 1.0, + fontSize: limitedFontSize, + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).accent4, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: + FlutterFlowTheme.of(context).primary, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: FlutterFlowTheme.of(context).error, + width: 0.5, + ), + borderRadius: BorderRadius.circular(8.0), + ), + suffixIcon: Icon( + Icons.date_range, + color: FlutterFlowTheme.of(context).accent1, + ), ), + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + lineHeight: 1.8, + fontSize: limitedFontSize, + ), + textAlign: TextAlign.start, + validator: model.textController2Validator + .asValidator(context), ), Padding( padding: const EdgeInsetsDirectional.fromSTEB( @@ -1057,8 +1054,8 @@ class _ScheduleCompleteVisitPageWidgetState padding: const EdgeInsetsDirectional.fromSTEB( 24.0, 0.0, 24.0, 0.0), child: Container( - width: 100.0, - height: 45.0, + width: MediaQuery.of(context).size.width * 0.8, + height: scaledSizedBoxSize *0.5, decoration: const BoxDecoration(), child: FutureBuilder( future: PhpGroup.getDadosCall.call(), @@ -1112,11 +1109,12 @@ class _ScheduleCompleteVisitPageWidgetState FlutterFlowTheme.of( context) .bodyMediumFamily), + fontSize: limitedFontSize, ), hintText: - FFLocalizations.of(context).getText( - '6p3e0bzr', + FFLocalizations.of(context).getVariableText(enText: 'Reason for Visit', ptText: 'Motivo da Visita' ), + icon: Icon( Icons.keyboard_arrow_down_rounded, color: FlutterFlowTheme.of(context) @@ -1148,18 +1146,22 @@ class _ScheduleCompleteVisitPageWidgetState mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, children: [ - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 30.0, vertical: 5.0), - child: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Field is Required', - ptText: 'Campo Obrigatório', - ), - style: TextStyle( - color: FlutterFlowTheme.of(context) - .customColor6, - fontSize: 12.0)), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 30.0, vertical: 5.0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Select a reason for the visit', + ptText: 'Selecione um motivo da visita', + ), + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + color: FlutterFlowTheme.of(context) + .customColor6, + fontSize: limitedFontSize)), + ), ), ], ), @@ -1176,7 +1178,7 @@ class _ScheduleCompleteVisitPageWidgetState 24.0, 0.0, 24.0, 0.0), child: Container( width: 100.0, - height: 45.0, + height: scaledSizedBoxSize *0.5, decoration: const BoxDecoration(), child: FutureBuilder( future: PhpGroup.getDadosCall.call(), @@ -1227,10 +1229,12 @@ class _ScheduleCompleteVisitPageWidgetState FlutterFlowTheme.of( context) .bodyMediumFamily), + fontSize: limitedFontSize, ), hintText: - FFLocalizations.of(context).getText( - '2wun8p6c', + FFLocalizations.of(context).getVariableText( + enText: 'Level of access', + ptText: 'Nível de acesso', ), icon: Icon( Icons.keyboard_arrow_down_rounded, @@ -1265,18 +1269,22 @@ class _ScheduleCompleteVisitPageWidgetState mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, children: [ - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 30.0, vertical: 5.0), - child: Text( - FFLocalizations.of(context).getVariableText( - enText: 'Field is Required', - ptText: 'Campo Obrigatório', - ), - style: TextStyle( - color: FlutterFlowTheme.of(context) - .customColor6, - fontSize: 12.0)), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 30.0, vertical: 5.0), + child: Text( + FFLocalizations.of(context).getVariableText( + enText: 'Select a level of access', + ptText: 'Selecione um nível de acesso', + ), + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + color: FlutterFlowTheme.of(context) + .customColor6, + fontSize: limitedFontSize)), + ), ), ], ), @@ -1316,30 +1324,27 @@ class _ScheduleCompleteVisitPageWidgetState 30.0, 0.0, 30.0, 20.0), child: Row( mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Flexible( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 130.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'lgv0q5ht', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - ), + child: Text( + FFLocalizations.of(context).getText( + 'lgv0q5ht', ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .bodyMedium + .override( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + fontSize: limitedFontSize, + ), ), ), Switch( @@ -1444,6 +1449,7 @@ class _ScheduleCompleteVisitPageWidgetState useGoogleFonts: GoogleFonts.asMap() .containsKey(FlutterFlowTheme.of(context) .labelMediumFamily), + fontSize: limitedFontSize, ), hintText: FFLocalizations.of(context).getText( 'w18iztdm', @@ -1459,6 +1465,7 @@ class _ScheduleCompleteVisitPageWidgetState useGoogleFonts: GoogleFonts.asMap() .containsKey(FlutterFlowTheme.of(context) .labelMediumFamily), + fontSize: limitedFontSize, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -1503,6 +1510,7 @@ class _ScheduleCompleteVisitPageWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), + fontSize: limitedFontSize, ), textAlign: TextAlign.start, maxLines: null, @@ -1527,6 +1535,7 @@ class _ScheduleCompleteVisitPageWidgetState enText: 'Schedule', ptText: 'Agendar', ), + onPressed: model.isValid() ? () async { Future scheduleVisit() async { @@ -1625,6 +1634,7 @@ class _ScheduleCompleteVisitPageWidgetState textStyle: TextStyle( color: FlutterFlowTheme.of(context) .primaryText, + fontSize: 16/ MediaQuery.textScalerOf(context).scale(1), ), borderSide: BorderSide( color: FlutterFlowTheme.of(context) @@ -1680,9 +1690,15 @@ class _ScheduleCompleteVisitPageWidgetState } : null, options: FFButtonOptions( - height: MediaQuery.of(context).size.height * 0.05, - width: MediaQuery.of(context).size.height * 0.2, + height: 40, + width: MediaQuery.of(context).size.width * 0.5, color: FlutterFlowTheme.of(context).primary, + textStyle: FlutterFlowTheme.of(context).subtitle2.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryBackground, + fontSize: 18.0 / MediaQuery.textScalerOf(context).scale(1), + fontWeight: FontWeight.w500, + ), borderRadius: const BorderRadius.only( bottomLeft: Radius.circular(15.0), bottomRight: Radius.circular(15.0), diff --git a/lib/pages/schedule_complete_visit_page/visit_history_page_widget.dart b/lib/pages/schedule_complete_visit_page/visit_history_page_widget.dart index 8dd2f534..db2b434d 100644 --- a/lib/pages/schedule_complete_visit_page/visit_history_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/visit_history_page_widget.dart @@ -7,6 +7,7 @@ import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_p import 'package:hub/pages/schedule_complete_visit_page/schedule_complete_visit_page_widget.dart'; import 'package:hub/shared/mixins/status_mixin.dart'; import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/log_util.dart'; import 'package:hub/shared/utils/storage_util.dart'; import 'package:hub/shared/utils/validator_util.dart'; @@ -127,6 +128,9 @@ class _VisitHistoryWidgetState extends State @override Widget build(BuildContext context) { + + double limitedTextSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 24, 12); + return Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, @@ -140,7 +144,13 @@ class _VisitHistoryWidgetState extends State Center( child: Text(FFLocalizations.of(context).getVariableText( ptText: "Nenhuma visita encontrada!", - enText: "No visit found")), + enText: "No visit found"), + style: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + fontSize: limitedTextSize, + fontWeight: FontWeight.bold + ) + ), ) ], ), diff --git a/lib/shared/utils/limited_text_size.dart b/lib/shared/utils/limited_text_size.dart new file mode 100644 index 00000000..d3de36e1 --- /dev/null +++ b/lib/shared/utils/limited_text_size.dart @@ -0,0 +1,21 @@ +import 'package:flutter/material.dart'; + +class LimitedTextSizeUtil { + static double getLimitedBodyFontSize(BuildContext context, double baseFontSize, double maxFontSize, double limitedFontSize) { + final textScaler = MediaQuery.textScalerOf(context); + final double scaledFontSize = baseFontSize * textScaler.scale(1); + return scaledFontSize > maxFontSize ? limitedFontSize : scaledFontSize; + } + + static double getNoResizeFont(BuildContext context, double baseFontSize) { + final textScaler = MediaQuery.textScalerOf(context); + final double noscaledFontSize = baseFontSize / textScaler.scale(1); + return noscaledFontSize; + } + + static double getScaledSizedBoxSize(BuildContext context, double baseFontSize, double maxFontSize, double sizeIfExceeded, double sizeIfNotExceeded) { + final textScaler = MediaQuery.textScalerOf(context); + final double scaledFontSize = baseFontSize * textScaler.scale(1); + return scaledFontSize > maxFontSize ? sizeIfExceeded : sizeIfNotExceeded; + } +} \ No newline at end of file From a58f535d6dc611b540808d7d1da5f3b9d832f2bc Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 6 Nov 2024 17:27:02 -0300 Subject: [PATCH 4/7] feat: Ajuste na tela de Registro de Visitante e de QRCode --- ...de_pass_key_template_component_widget.dart | 286 +++++++++--------- ...iter_vistor_template_component_widget.dart | 180 ++++++----- .../qr_code_page/qr_code_page_widget.dart | 10 +- .../schedule_complete_visit_page_widget.dart | 39 ++- lib/shared/utils/limited_text_size.dart | 2 +- 5 files changed, 280 insertions(+), 237 deletions(-) diff --git a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart index cc89233e..063daae5 100644 --- a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart +++ b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart @@ -1,4 +1,5 @@ import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_util.dart'; @@ -52,13 +53,16 @@ class _QrCodePassKeyTemplateComponentWidgetState @override Widget build(BuildContext context) { + return Align( alignment: const AlignmentDirectional(0.0, 1.0), child: Container( width: double.infinity, - height: 300.0, + height: LimitedTextSizeUtil.getScaledSizedBoxSize(context, 300, 570, 500, 300), constraints: const BoxConstraints( + minHeight: 300.0, maxWidth: 570.0, + maxHeight: 500, ), decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, @@ -69,104 +73,103 @@ class _QrCodePassKeyTemplateComponentWidgetState topRight: Radius.circular(15.0), ), ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // This row exists for when the "app bar" is hidden on desktop, having a way back for the user can work well. - if (responsiveVisibility( - context: context, - phone: false, - tablet: false, - )) - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - context.safePop(); - }, - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - const Padding( - padding: EdgeInsetsDirectional.fromSTEB( - 0.0, 12.0, 0.0, 12.0), - child: Icon( - Icons.arrow_back_rounded, - color: Color(0xFF15161E), - size: 24.0, + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // This row exists for when the "app bar" is hidden on desktop, having a way back for the user can work well. + if (responsiveVisibility( + context: context, + phone: false, + tablet: false, + )) + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + context.safePop(); + }, + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + const Padding( + padding: EdgeInsetsDirectional.fromSTEB( + 0.0, 12.0, 0.0, 12.0), + child: Icon( + Icons.arrow_back_rounded, + color: Color(0xFF15161E), + size: 24.0, + ), ), - ), - Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 12.0, 0.0, 0.0, 0.0), - child: Text( - '', - style: - FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: const Color(0xFF15161E), - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 12.0, 0.0, 0.0, 0.0), + child: Text( + '', + style: + FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: const Color(0xFF15161E), + fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 16, 30, 14), + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + ), ), - ), - ], + ], + ), ), ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'h1xilful' /* DIGITE A SUA SENHA */, - ), - style: FlutterFlowTheme.of(context).headlineMedium.override( - fontFamily: 'Outfit', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'), - ), - ), - ), - Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), - child: Text( - FFLocalizations.of(context).getText( - 'ujodm2ci' /* Para gerar o QR Code digite a ... */, - ), - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), - ), - ), - ), - Form( - key: _model.formKey, - autovalidateMode: AutovalidateMode.onUserInteraction, - child: Padding( + Padding( padding: - const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), - child: SizedBox( - width: double.infinity, + const EdgeInsetsDirectional.fromSTEB(16.0, 10.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText( + 'h1xilful' /* DIGITE A SUA SENHA */, + ), + style: FlutterFlowTheme.of(context).headlineMedium.override( + fontFamily: 'Outfit', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 20, 38, 18), + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'), + ), + ), + ), + Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(16.0, 4.0, 16.0, 4.0), + child: Text( + FFLocalizations.of(context).getText( + 'ujodm2ci' /* Para gerar o QR Code digite a ... */, + ), + style: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 26, 12), + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Plus Jakarta Sans'), + ), + ), + ), + Form( + key: _model.formKey, + autovalidateMode: AutovalidateMode.onUserInteraction, + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0), child: TextFormField( controller: _model.keyTextFieldTextController, focusNode: _model.keyTextFieldFocusNode, @@ -189,11 +192,12 @@ class _QrCodePassKeyTemplateComponentWidgetState FlutterFlowTheme.of(context).labelMedium.override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, + fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 10, 18, 8), letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() .containsKey('Plus Jakarta Sans'), + ), hintText: FFLocalizations.of(context).getText( 'zz1haydj' /* digite a sua senha..... */, @@ -202,7 +206,7 @@ class _QrCodePassKeyTemplateComponentWidgetState FlutterFlowTheme.of(context).labelMedium.override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, + fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 10, 18, 8), letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() @@ -258,7 +262,7 @@ class _QrCodePassKeyTemplateComponentWidgetState style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, + fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 10, 18, 8), letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() @@ -281,54 +285,54 @@ class _QrCodePassKeyTemplateComponentWidgetState ), ), ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: - const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - if (_model.formKey.currentState == null || - !_model.formKey.currentState!.validate()) { - return; - } - await widget.toggleActionStatus?.call( - _model.keyTextFieldTextController.text, - ); - context.pop(); - }, - text: FFLocalizations.of(context).getText( - '2cybbi5p' /* Enviar */, - ), - options: FFButtonOptions( - width: 270.0, - height: 50.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - color: const Color(0xFF1AAB5F), - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: 'Plus Jakarta Sans', - color: Colors.white, - fontSize: 16.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: + const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 15), + child: FFButtonWidget( + onPressed: () async { + if (_model.formKey.currentState == null || + !_model.formKey.currentState!.validate()) { + return; + } + await widget.toggleActionStatus?.call( + _model.keyTextFieldTextController.text, + ); + context.pop(); + }, + text: FFLocalizations.of(context).getText( + '2cybbi5p' /* Enviar */, ), + options: FFButtonOptions( + width: 270.0, + height: 50.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: const Color(0xFF1AAB5F), + textStyle: FlutterFlowTheme.of(context).titleSmall.override( + fontFamily: 'Plus Jakarta Sans', + color: Colors.white, + fontSize: LimitedTextSizeUtil.getNoResizeFont(context, 15), + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, + ), + ), + showLoadingIndicator: false, ), - showLoadingIndicator: false, ), ), - ), - ], + ], + ), ), ), ); diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index efb7adf1..b12a72fa 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -4,6 +4,7 @@ import 'package:flutter/services.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/shared/utils/dialog_util.dart'; import 'package:hub/shared/utils/image_util.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/validator_util.dart'; import 'package:rxdart/rxdart.dart'; @@ -33,7 +34,7 @@ class RegisiterVistorTemplateComponentWidget extends StatefulWidget { class _RegisiterVistorTemplateComponentWidgetState extends State { late RegisiterVistorTemplateComponentModel _model; - + bool _isLoading = false; final scaffoldKey = GlobalKey(); bool _isVisitorRegistered = false; @@ -120,6 +121,9 @@ class _RegisiterVistorTemplateComponentWidgetState @override Widget build(BuildContext context) { + + double limitedTextSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 12.0, 22.0, 10.0 ); + return Align( alignment: const AlignmentDirectional(0.0, 1.0), child: Container( @@ -193,6 +197,7 @@ class _RegisiterVistorTemplateComponentWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) .labelMediumFamily), + fontSize: limitedTextSize, ), hintStyle: FlutterFlowTheme.of(context).labelMedium.override( @@ -202,6 +207,7 @@ class _RegisiterVistorTemplateComponentWidgetState useGoogleFonts: GoogleFonts.asMap() .containsKey(FlutterFlowTheme.of(context) .labelMediumFamily), + fontSize: limitedTextSize, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -243,6 +249,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedTextSize, ), onChanged: (value) { _model.debounce(() async { @@ -330,6 +337,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), + fontSize: limitedTextSize, ), hintStyle: FlutterFlowTheme.of(context) .labelMedium @@ -340,6 +348,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), + fontSize: limitedTextSize, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -381,6 +390,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedTextSize, ), maxLines: null, maxLength: 80, @@ -420,9 +430,11 @@ class _RegisiterVistorTemplateComponentWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), + fontSize: limitedTextSize, ), - hintText: FFLocalizations.of(context).getText( - 'pmezihb4' /* Selecione... */, + hintText: FFLocalizations.of(context).getVariableText( + enText: 'Visitor Type', + ptText: 'Tipo de Visitante', ), icon: Icon( Icons.keyboard_arrow_down_rounded, @@ -451,8 +463,8 @@ class _RegisiterVistorTemplateComponentWidgetState top: 5, start: 15), child: Text( FFLocalizations.of(context).getVariableText( - enText: 'This field is required', - ptText: 'Este campo é obrigatório', + enText: 'Select the type of visitor', + ptText: 'Selecione o tipo de visitante', ), style: FlutterFlowTheme.of(context) .bodySmall @@ -466,6 +478,7 @@ class _RegisiterVistorTemplateComponentWidgetState .containsKey( FlutterFlowTheme.of(context) .bodySmallFamily), + fontSize: limitedTextSize, )), ), ], @@ -505,11 +518,14 @@ class _RegisiterVistorTemplateComponentWidgetState ); } else { return Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { + children: [ + GestureDetector( + onTap: () async { + + setState(() { + _isLoading = true; + }); + final selectedMedia = await selectMediaWithSourceBottomSheetandFaceDetection( context: context, @@ -562,6 +578,7 @@ class _RegisiterVistorTemplateComponentWidgetState setState(() { _model.uploadedLocalFile = selectedUploadedFiles.first; + _isLoading = false; }); final String message = FFLocalizations.of(context) @@ -571,7 +588,9 @@ class _RegisiterVistorTemplateComponentWidgetState ); showUploadMessage(context, message); } else { - setState(() {}); + setState(() { + _isLoading = false; + }); final String message = FFLocalizations.of(context) .getVariableText( @@ -579,75 +598,80 @@ class _RegisiterVistorTemplateComponentWidgetState ptText: 'Falha ao enviar os dados', ); showUploadMessage(context, message); + return; - } + }} else { + setState(() { + _isLoading = false; + }); + } }, - text: '', - icon: Icon( - Icons.photo_camera, - color: FlutterFlowTheme.of(context).accent1, - size: 30.0, - ), - options: FFButtonOptions( - width: double.infinity, - height: 120.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 20.0), - iconPadding: - const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), - color: FlutterFlowTheme.of(context) - .primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, - width: 0.2, - ), - borderRadius: BorderRadius.circular(8.0), + child: Center( + child: Container( + width: MediaQuery.of(context).size.width * 0.8, + height: 120, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), + border: Border.all( + color: FlutterFlowTheme.of(context).customColor6, + width: 1.0, ), ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 10.0, 65.0, 10.0, 0.0), - child: Text( - FFLocalizations.of(context).getText( - 'p4ftwxcy' /* Clique para adicionar a foto p... */, - ), - style: FlutterFlowTheme.of(context) - .bodyMedium - .override( - fontFamily: FlutterFlowTheme.of(context) - .bodyMediumFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _isLoading + ? SizedBox( + width: 30.0, + height: 30.0, + child: CircularProgressIndicator( + valueColor: + AlwaysStoppedAnimation( + FlutterFlowTheme.of(context) + .primary, + ), + ), + ) + : Icon( + Icons.photo_camera, + color: FlutterFlowTheme.of(context) + .primary, + size: 30.0, + ), + Padding( + padding: + const EdgeInsets.fromLTRB(0, 15, 0, 0), + child: Text( + FFLocalizations.of(context).getText( + 'p4ftwxcy', ), - ), + textAlign: TextAlign.center, + style: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: + FlutterFlowTheme.of(context) + .titleSmallFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: limitedTextSize, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), + ), + ), + ) + ], ), ), - ], - ); + ), + ), + ] + ); } }, ), @@ -706,6 +730,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), + fontSize: limitedTextSize, ), hintStyle: FlutterFlowTheme.of(context) .labelMedium @@ -716,6 +741,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), + fontSize: limitedTextSize, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -757,6 +783,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedTextSize, ), // validator: // _model.textController3Validator.asValidator(context), @@ -793,6 +820,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), + fontSize: limitedTextSize, ), hintStyle: FlutterFlowTheme.of(context) .labelMedium @@ -803,6 +831,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), + fontSize: limitedTextSize, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -844,6 +873,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedTextSize, ), keyboardType: TextInputType.emailAddress, inputFormatters: [LengthLimitingTextInputFormatter(80)], @@ -899,7 +929,10 @@ class _RegisiterVistorTemplateComponentWidgetState 'Visitor successfully registered.'), style: TextStyle( color: FlutterFlowTheme.of(context) - .info)), + .info, + ) + ), + backgroundColor: FlutterFlowTheme.of(context).primary, duration: const Duration(seconds: 3), @@ -960,6 +993,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).titleSmallFamily), + fontSize: LimitedTextSizeUtil.getNoResizeFont(context, 15) ), borderSide: const BorderSide( color: Colors.transparent, diff --git a/lib/pages/qr_code_page/qr_code_page_widget.dart b/lib/pages/qr_code_page/qr_code_page_widget.dart index 32ae343c..ef8d0aed 100644 --- a/lib/pages/qr_code_page/qr_code_page_widget.dart +++ b/lib/pages/qr_code_page/qr_code_page_widget.dart @@ -16,6 +16,7 @@ import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/qr_code_page/qr_code_page_model.dart'; import 'package:hub/shared/utils/biometric_util.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/storage_util.dart'; import 'package:percent_indicator/circular_percent_indicator.dart'; @@ -109,6 +110,9 @@ class _QrCodePageWidgetState extends State screenWidth < screenHeight ? screenWidth : screenHeight; double dimension = smallerDimension * 0.75; double totalTimeInSeconds = 100.0; + double limitedHeaderTextSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 20.0, 38, 18); + double limitedBodyTextSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14.0, 22, 12); + return SafeArea( // top: true, child: Column( @@ -123,11 +127,12 @@ class _QrCodePageWidgetState extends State ), style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: 20.0, + fontSize: limitedHeaderTextSize, letterSpacing: 0.0, fontWeight: FontWeight.bold, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), + ), ), Stack( @@ -221,6 +226,7 @@ class _QrCodePageWidgetState extends State useGoogleFonts: GoogleFonts.asMap() .containsKey(FlutterFlowTheme.of(context) .titleSmallFamily), + fontSize: LimitedTextSizeUtil.getNoResizeFont(context, 14), ), elevation: 3.0, borderSide: const BorderSide( @@ -255,6 +261,7 @@ class _QrCodePageWidgetState extends State letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedBodyTextSize, ), ), ), @@ -291,6 +298,7 @@ class _QrCodePageWidgetState extends State useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), + fontSize: limitedBodyTextSize, ), ), ), 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 cb23ec42..69c0af52 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 @@ -224,7 +224,8 @@ class _ScheduleCompleteVisitPageWidgetState final textScaler = MediaQuery.textScalerOf(context); final double baseFontSize = 12.0; final double scaledFontSize = baseFontSize * textScaler.scale(1); - final double limitedFontSize = scaledFontSize > 16.0 ? 10 : baseFontSize; + final double limitedFontSize = LimitedTextSizeUtil.getLimitedBodyFontSize( + context, 12, 12, 10.0); final double scaledSizedBoxSize = scaledFontSize > 16.0 ? 100 : 80; return SingleChildScrollView( @@ -317,7 +318,7 @@ class _ScheduleCompleteVisitPageWidgetState enabledBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context) - .accent4, + .customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(8.0), @@ -574,7 +575,7 @@ class _ScheduleCompleteVisitPageWidgetState enabledBorder: OutlineInputBorder( borderSide: BorderSide( color: - FlutterFlowTheme.of(context).accent4, + FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(8.0), @@ -924,23 +925,19 @@ class _ScheduleCompleteVisitPageWidgetState : FocusScope.of(context).unfocus(), child: SizedBox( height: MediaQuery.of(context).size.height * - 0.7, + 0.8, width: MediaQuery.of(context).size.width, child: Padding( padding: MediaQuery.viewInsetsOf(context), - child: - VisitorSearchModalTemplateComponentWidget( - getVisitors: (visitorsParam) async { - model.visitorJsonList = visitorsParam! - .toList() - .cast(); - safeSetState(() {}); - }, - getDocs: (docsParam) async { - model.visitorStrList = - strListToStr(docsParam!.toList()); - safeSetState(() {}); - }, + child: VisitorSearchModalTemplateComponentWidget( + getVisitors: (visitorsParam) async { + model.visitorJsonList = visitorsParam!.toList().cast(); + safeSetState(() {}); + }, + getDocs: (docsParam) async { + model.visitorStrList = strListToStr(docsParam!.toList()); + safeSetState(() {}); + }, ), ), ), @@ -957,7 +954,7 @@ class _ScheduleCompleteVisitPageWidgetState decoration: BoxDecoration( borderRadius: BorderRadius.circular(8.0), border: Border.all( - color: FlutterFlowTheme.of(context).accent4, + color: FlutterFlowTheme.of(context).customColor6, width: 1.0, ), ), @@ -1124,7 +1121,7 @@ class _ScheduleCompleteVisitPageWidgetState elevation: 2.0, borderColor: FlutterFlowTheme.of(context) - .accent4, + .customColor6, borderWidth: 0.5, borderRadius: 10.0, margin: const EdgeInsetsDirectional @@ -1245,7 +1242,7 @@ class _ScheduleCompleteVisitPageWidgetState elevation: 2.0, borderColor: FlutterFlowTheme.of(context) - .accent4, + .customColor6, borderWidth: 0.5, borderRadius: 10.0, margin: const EdgeInsetsDirectional @@ -1469,7 +1466,7 @@ class _ScheduleCompleteVisitPageWidgetState ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent4, + color: FlutterFlowTheme.of(context).customColor6, width: 0.5, ), borderRadius: BorderRadius.circular(10.0), diff --git a/lib/shared/utils/limited_text_size.dart b/lib/shared/utils/limited_text_size.dart index d3de36e1..28f3c527 100644 --- a/lib/shared/utils/limited_text_size.dart +++ b/lib/shared/utils/limited_text_size.dart @@ -12,7 +12,7 @@ class LimitedTextSizeUtil { final double noscaledFontSize = baseFontSize / textScaler.scale(1); return noscaledFontSize; } - + static double getScaledSizedBoxSize(BuildContext context, double baseFontSize, double maxFontSize, double sizeIfExceeded, double sizeIfNotExceeded) { final textScaler = MediaQuery.textScalerOf(context); final double scaledFontSize = baseFontSize * textScaler.scale(1); From 1caa0ccf0f02b9fc2eae381b30ae61e1d3ac9954 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 7 Nov 2024 15:45:49 -0300 Subject: [PATCH 5/7] Feat: Ajuste nos modais e as telas restantes. --- .../shared_components_atoms/custom_input.dart | 14 + .../custom_select.dart | 6 + .../media_upload_button.dart | 311 ++++++------ .../shared_components_atoms/tabview.dart | 3 +- .../message_opt_modal/opt_modal_widget.dart | 20 +- .../order_filter_modal_widget.dart | 7 +- .../throw_exception_widget.dart | 8 +- .../card_item_template_component_widget.dart | 9 +- .../details_component_widget.dart | 15 +- ...ot_password_template_component_widget.dart | 17 +- .../message_notification_widget.dart | 12 + .../provisional_shcedule_template_widget.dart | 47 +- ...de_pass_key_template_component_widget.dart | 16 +- ...siter_vistor_template_component_model.dart | 2 +- ...iter_vistor_template_component_widget.dart | 212 ++------ .../sign_in_template_component_widget.dart | 91 ++-- .../sign_up_template_component_widget.dart | 96 ++-- ...earch_modal_template_component_widget.dart | 23 +- .../welcome_template_component_widget.dart | 14 +- lib/flutter_flow/flutter_flow_util.dart | 13 +- .../message_history_page_widget.dart | 24 +- .../package_order_page.dart | 3 +- lib/pages/pets_page/pets_history_screen.dart | 14 +- lib/pages/pets_page/pets_page_model.dart | 9 +- lib/pages/pets_page/pets_page_widget.dart | 85 ++-- .../preferences_settings_widget.dart | 4 +- .../qr_code_page/qr_code_page_widget.dart | 453 +++++++++--------- .../reception_page/reception_page_widget.dart | 25 +- .../schedule_complete_visit_page_model.dart | 6 +- .../schedule_complete_visit_page_widget.dart | 63 ++- .../visit_history_page_widget.dart | 4 +- .../components/atoms/atom_terms_of_use.dart | 4 +- lib/shared/utils/dialog_util.dart | 1 - lib/shared/utils/limited_text_size.dart | 28 +- 34 files changed, 902 insertions(+), 757 deletions(-) diff --git a/lib/components/atomic_components/shared_components_atoms/custom_input.dart b/lib/components/atomic_components/shared_components_atoms/custom_input.dart index 765c2c7e..50f26559 100644 --- a/lib/components/atomic_components/shared_components_atoms/custom_input.dart +++ b/lib/components/atomic_components/shared_components_atoms/custom_input.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; // ignore: must_be_immutable class CustomInputUtil extends StatefulWidget { @@ -48,6 +49,8 @@ class _CustomInputUtilState extends State { @override Widget build(BuildContext context) { + double limitedInputTextSize = LimitedFontSizeUtil.getInputFontSize(context); + return Padding( padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 10.0), child: Column( @@ -81,6 +84,7 @@ class _CustomInputUtilState extends State { useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily, ), + fontSize: limitedInputTextSize, ), hintText: widget.hintText, hintStyle: FlutterFlowTheme.of(context).labelMedium.override( @@ -90,6 +94,11 @@ class _CustomInputUtilState extends State { useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily, ), + fontSize: limitedInputTextSize, + ), + helperStyle: TextStyle( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontSize: limitedInputTextSize, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -112,6 +121,11 @@ class _CustomInputUtilState extends State { ), borderRadius: BorderRadius.circular(10.0), ), + errorStyle: TextStyle( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).error, + fontSize: limitedInputTextSize, + ), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).error, diff --git a/lib/components/atomic_components/shared_components_atoms/custom_select.dart b/lib/components/atomic_components/shared_components_atoms/custom_select.dart index d0822749..f25232fb 100644 --- a/lib/components/atomic_components/shared_components_atoms/custom_select.dart +++ b/lib/components/atomic_components/shared_components_atoms/custom_select.dart @@ -5,6 +5,7 @@ import 'package:hub/flutter_flow/flutter_flow_drop_down.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/form_field_controller.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; // ignore: must_be_immutable class CustomSelect extends StatefulWidget { @@ -41,6 +42,9 @@ class _CustomSelectState extends State { @override Widget build(BuildContext context) { + + double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); + return Padding( padding: const EdgeInsetsDirectional.fromSTEB(0, 0.0, 0, 10.0), child: Column( @@ -73,6 +77,7 @@ class _CustomSelectState extends State { letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedInputFontSize, ), hintText: widget.hintText, icon: Icon( @@ -123,6 +128,7 @@ class _CustomSelectState extends State { useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) .bodySmallFamily), + fontSize: limitedInputFontSize )), ), ], diff --git a/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart b/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart index 2377b458..4f44136d 100644 --- a/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart +++ b/lib/components/atomic_components/shared_components_atoms/media_upload_button.dart @@ -4,6 +4,7 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; import 'package:hub/flutter_flow/upload_data.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; // ignore: must_be_immutable class MediaUploadButtonUtil extends StatefulWidget { @@ -32,155 +33,175 @@ class _MediaUploadButtonUtilState extends State { @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 0.0), - child: Builder( - builder: (context) { - if (widget.uploadedFiles != null && - widget.uploadedFiles!.bytes!.isNotEmpty) { - { - return InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - setState(() { - widget.isUploading = false; - widget.uploadedFiles = - FFUploadedFile(bytes: Uint8List.fromList([])); - widget.onUploadComplete(widget.uploadedFiles!); - }); - }, - child: ClipRRect( - borderRadius: BorderRadius.circular(8.0), - child: Image.memory( - widget.uploadedFiles!.bytes ?? Uint8List.fromList([]), - width: 300.0, - height: 200.0, - fit: BoxFit.cover, - ), - ), - ); - } - } else { - return Stack( - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - final selectedMedia = - await selectMediaWithSourceBottomSheet( - context: context, - imageQuality: 100, - allowPhoto: true, - includeDimensions: true, - ); - if (selectedMedia != null) { - setState(() => widget.isUploading = true); - var selectedUploadedFiles = []; + double limitedInputTextSize = LimitedFontSizeUtil.getInputFontSize(context); + bool _isLoading = false; - try { - final message = FFLocalizations.of(context) - .getVariableText( - enText: 'Uploading file...', - ptText: 'Enviando arquivo...'); - showUploadMessage( - context, - message, - showLoading: true, - ); - selectedUploadedFiles = selectedMedia - .map((m) => FFUploadedFile( - name: m.storagePath.split('/').last, - bytes: m.bytes, - height: m.dimensions?.height, - width: m.dimensions?.width, - // blurHash: m.blurHash, - )) - .toList(); - } finally { - ScaffoldMessenger.of(context).hideCurrentSnackBar(); - widget.isUploading = false; - } - if (selectedUploadedFiles.length == - selectedMedia.length) { - setState(() { - widget.uploadedFiles = selectedUploadedFiles.first; - }); - widget.onUploadComplete(widget.uploadedFiles!); - final message = FFLocalizations.of(context) - .getVariableText( - enText: 'Success!', ptText: 'Sucesso!'); - showUploadMessage(context, message); - } else { - setState(() {}); - final message = FFLocalizations.of(context) - .getVariableText( - enText: 'Failed to upload data', - ptText: 'Falha ao enviar dados'); - showUploadMessage(context, message); - return; - } - } - }, - text: '', - icon: Icon( - Icons.photo_camera, - color: FlutterFlowTheme.of(context).accent1, - size: 30.0, - ), - options: FFButtonOptions( - width: double.infinity, - height: 120.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 20.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 14.0, 0.0, 0.0, 20.0), - color: FlutterFlowTheme.of(context).primaryBackground, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: - FlutterFlowTheme.of(context).titleSmallFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 16.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).titleSmallFamily), - ), - borderSide: BorderSide( - color: FlutterFlowTheme.of(context).accent1, - width: 0.2, - ), - borderRadius: BorderRadius.circular(8.0), - ), - ), + return Builder( + builder: (context) { + if (widget.uploadedFiles != null && + widget.uploadedFiles!.bytes!.isNotEmpty) { + { + return InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + setState(() { + widget.isUploading = false; + widget.uploadedFiles = + FFUploadedFile(bytes: Uint8List.fromList([])); + widget.onUploadComplete(widget.uploadedFiles!); + }); + }, + child: ClipRRect( + borderRadius: BorderRadius.circular(8.0), + child: Image.memory( + widget.uploadedFiles!.bytes ?? Uint8List.fromList([]), + width: 300.0, + height: 200.0, + fit: BoxFit.cover, ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 10.0, 65.0, 10.0, 0.0), - child: Text( - widget.labelText, - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - color: FlutterFlowTheme.of(context).primaryText, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - ), - ), - ), - ), - ], + ), ); } - }, - ), + } else { + return Stack( + children: [ + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: GestureDetector( + onTap: () async { + setState(() { + _isLoading = true; + }); + final selectedMedia = await selectMediaWithSourceBottomSheet( + context: context, + imageQuality: 100, + allowPhoto: true, + includeDimensions: true, + ); + if (selectedMedia != null) { + setState(() => widget.isUploading = true); + var selectedUploadedFiles = []; + + try { + final message = FFLocalizations.of(context) + .getVariableText( + enText: 'Uploading file...', + ptText: 'Enviando arquivo...'); + showUploadMessage( + context, + message, + showLoading: true, + ); + selectedUploadedFiles = selectedMedia + .map((m) => FFUploadedFile( + name: m.storagePath.split('/').last, + bytes: m.bytes, + height: m.dimensions?.height, + width: m.dimensions?.width, + // blurHash: m.blurHash, + )) + .toList(); + } finally { + ScaffoldMessenger.of(context).hideCurrentSnackBar(); + widget.isUploading = false; + } + if (selectedUploadedFiles.length == + selectedMedia.length) { + setState(() { + widget.uploadedFiles = selectedUploadedFiles.first; + }); + widget.onUploadComplete(widget.uploadedFiles!); + final message = FFLocalizations.of(context) + .getVariableText( + enText: 'Success!', ptText: 'Sucesso!'); + showUploadMessage(context, message); + } else { + setState(() { + _isLoading = false; + }); + final message = FFLocalizations.of(context) + .getVariableText( + enText: 'Failed to upload data', + ptText: 'Falha ao enviar dados'); + showUploadMessage(context, message); + return; + } }else{ + setState(() { + _isLoading = false; + }); + } + }, + child: Center( + child: Container( + width: MediaQuery.of(context).size.width * 0.8, + height: 120, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.0), + border: Border.all( + color: FlutterFlowTheme.of(context).customColor6, + width: 1.0, + ), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _isLoading + ? SizedBox( + width: 30.0, + height: 30.0, + child: CircularProgressIndicator( + valueColor: + AlwaysStoppedAnimation( + FlutterFlowTheme.of(context) + .primary, + ), + ), + ) + : Icon( + Icons.photo_camera, + color: FlutterFlowTheme.of(context) + .primary, + size: 30.0, + ), + Padding( + padding: + const EdgeInsets.fromLTRB(0, 15, 0, 0), + child: Text( + FFLocalizations.of(context).getText( + 'p4ftwxcy', + ), + textAlign: TextAlign.center, + style: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: + FlutterFlowTheme.of(context) + .titleSmallFamily, + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: limitedInputTextSize, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .titleSmallFamily), + ), + ), + ) + ], + ), + ), + ), + ), + ), + ], + ); + } + }, ); } } diff --git a/lib/components/atomic_components/shared_components_atoms/tabview.dart b/lib/components/atomic_components/shared_components_atoms/tabview.dart index 3798d6d8..6c7a6493 100644 --- a/lib/components/atomic_components/shared_components_atoms/tabview.dart +++ b/lib/components/atomic_components/shared_components_atoms/tabview.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; // ignore: must_be_immutable class TabViewUtil extends StatelessWidget { @@ -39,7 +40,7 @@ class TabViewUtil extends StatelessWidget { unselectedLabelColor: FlutterFlowTheme.of(context).primaryText, labelStyle: FlutterFlowTheme.of(context).titleMedium.override( fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, - fontSize: 13.0, + fontSize: LimitedFontSizeUtil.getBodyFontSize(context), letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).titleMediumFamily), diff --git a/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart index 01ee6ea1..3c91574a 100644 --- a/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart +++ b/lib/components/molecular_components/message_opt_modal/opt_modal_widget.dart @@ -4,6 +4,7 @@ import 'package:hub/components/molecular_components/message_opt_modal/opt_modal_ import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; class OptModalWidget extends StatefulWidget { final String defaultPersonType; @@ -85,6 +86,7 @@ class _OptModalWidgetState extends State { Widget _buildCheckboxListTile( String key, List> options, double fontsize) { + double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); return Column( children: [ Row( @@ -98,7 +100,7 @@ class _OptModalWidgetState extends State { textAlign: TextAlign.left, style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: fontsize, + fontSize: limitedInputFontSize, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), @@ -120,7 +122,7 @@ class _OptModalWidgetState extends State { style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, - fontSize: fontsize, + fontSize: limitedInputFontSize, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), color: FlutterFlowTheme.of(context).primaryText, @@ -176,6 +178,7 @@ class _OptModalWidgetState extends State { Widget build(BuildContext context) { double screenWidth = MediaQuery.of(context).size.width; + return Center( child: Container( width: screenWidth - (screenWidth * 0.35), @@ -203,7 +206,8 @@ class _OptModalWidgetState extends State { fontFamily: FlutterFlowTheme.of(context) .headlineMediumFamily, color: FlutterFlowTheme.of(context).primaryText, - fontSize: 18.0, + fontSize: LimitedFontSizeUtil.getHeaderFontSize( + context), letterSpacing: 0.0, fontWeight: FontWeight.bold, useGoogleFonts: GoogleFonts.asMap().containsKey( @@ -234,7 +238,15 @@ class _OptModalWidgetState extends State { foregroundColor: FlutterFlowTheme.of(context).info, backgroundColor: FlutterFlowTheme.of(context).primary, ), - child: Text(FFLocalizations.of(context).getText('88kshkph')), + child: Text(FFLocalizations.of(context).getText('88kshkph'), style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + color: FlutterFlowTheme.of(context).info, + fontSize: LimitedFontSizeUtil.getInputFontSize(context), + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + )), ), ], ), diff --git a/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart b/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart index 2fac9684..b6289cca 100644 --- a/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart +++ b/lib/components/molecular_components/order_filter_modal/order_filter_modal_widget.dart @@ -180,6 +180,7 @@ class _OrderFilterModalWidgetState extends State { @override Widget build(BuildContext context) { double screenWidth = MediaQuery.of(context).size.width; + double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); return Center( child: Container( @@ -227,8 +228,8 @@ class _OrderFilterModalWidgetState extends State { mainAxisSize: MainAxisSize.min, children: [ _buildCheckboxListTile( - 'adresseeType', adresseeTypeOptions, LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 22, 10)), - _buildCheckboxListTile('status', statusOptions, LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 22, 10)), + 'adresseeType', adresseeTypeOptions, limitedBodyFontSize), + _buildCheckboxListTile('status', statusOptions, limitedBodyFontSize), ], ), ), @@ -240,7 +241,7 @@ class _OrderFilterModalWidgetState extends State { foregroundColor: FlutterFlowTheme.of(context).info, backgroundColor: FlutterFlowTheme.of(context).primary, ), - child: Text(FFLocalizations.of(context).getText('88kshkph'), style: TextStyle(fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 22, 10))), + child: Text(FFLocalizations.of(context).getText('88kshkph'), style: TextStyle(fontSize: limitedBodyFontSize)), ), ], ), diff --git a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart index b494d2c4..eab873ea 100644 --- a/lib/components/molecular_components/throw_exception/throw_exception_widget.dart +++ b/lib/components/molecular_components/throw_exception/throw_exception_widget.dart @@ -3,6 +3,7 @@ import 'package:flutter_animate/flutter_animate.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/shared/enums/enum_throw_exception.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import '/flutter_flow/flutter_flow_animations.dart'; import '/flutter_flow/flutter_flow_theme.dart'; @@ -91,6 +92,8 @@ class _ThrowExceptionWidgetState extends State super.dispose(); } @override Widget build(BuildContext context) { + double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); + double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); return InkWell( key: const ValueKey('ThrowExceptionWidget'), splashColor: Colors.transparent, @@ -132,7 +135,7 @@ class _ThrowExceptionWidgetState extends State _getTitleByType(context), style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: 20.0, + fontSize: limitedHeaderFontSize, letterSpacing: 0.0, fontWeight: FontWeight.bold, useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), @@ -142,10 +145,13 @@ class _ThrowExceptionWidgetState extends State padding: const EdgeInsetsDirectional.fromSTEB(15.0, 10.0, 15.0, 0.0), child: Text( valueOrDefault(widget.msg, 'Message Not Found'), + overflow: TextOverflow.clip, + textAlign: TextAlign.center, style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedBodyFontSize, ), ), ), diff --git a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart index 6859bb06..ad1e86d8 100644 --- a/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart +++ b/lib/components/templates_components/card_item_template_component/card_item_template_component_widget.dart @@ -57,7 +57,7 @@ class _CardItemTemplateComponentWidgetState } List _generateLabels() { - double limitedTextSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 24, 10); + double limitedBodyTextSize = LimitedFontSizeUtil.getBodyFontSize(context); return labelsLinkedHashMap.entries.map((entry) { final key = entry.key; @@ -76,7 +76,7 @@ class _CardItemTemplateComponentWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedTextSize, + fontSize: limitedBodyTextSize, ), ), const SizedBox(width: 8), @@ -86,7 +86,7 @@ class _CardItemTemplateComponentWidgetState overflow: TextOverflow.ellipsis, style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: limitedTextSize, + fontSize: limitedBodyTextSize, letterSpacing: 0.0, fontWeight: FontWeight.bold, useGoogleFonts: GoogleFonts.asMap().containsKey( @@ -124,6 +124,7 @@ class _CardItemTemplateComponentWidgetState } List _generateStatus() { + double limitedBodyTextSize = LimitedFontSizeUtil.getBodyFontSize(context); return statusLinkedHashMap.expand((statusLinked) { return statusLinked.entries.map((entry) { final text = entry.key; @@ -144,7 +145,7 @@ class _CardItemTemplateComponentWidgetState overflow: TextOverflow.ellipsis, style: TextStyle( color: FlutterFlowTheme.of(context).info, - fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 12, 22, 10), + fontSize: limitedBodyTextSize, fontWeight: FontWeight.bold, ), ), diff --git a/lib/components/templates_components/details_component/details_component_widget.dart b/lib/components/templates_components/details_component/details_component_widget.dart index 0c032822..3c84637e 100644 --- a/lib/components/templates_components/details_component/details_component_widget.dart +++ b/lib/components/templates_components/details_component/details_component_widget.dart @@ -63,12 +63,7 @@ class _DetailsComponentWidgetState extends State { @override Widget build(BuildContext context) { // CachedNetworkImage.evictFromCache(widget.imagePath ?? ''); - final double limitedFontSize = LimitedTextSizeUtil.getLimitedBodyFontSize( - context, - 12.0, - 16.0, - 10.0, - ); + final double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); return Container( constraints: BoxConstraints( maxWidth: MediaQuery.of(context).size.width, @@ -140,7 +135,7 @@ class _DetailsComponentWidgetState extends State { .labelMediumFamily, ), - fontSize: limitedFontSize, + fontSize: limitedBodyFontSize, ), hintStyle: FlutterFlowTheme.of(context) .labelMedium @@ -153,7 +148,7 @@ class _DetailsComponentWidgetState extends State { FlutterFlowTheme.of(context) .labelMediumFamily, ), - fontSize: limitedFontSize, + fontSize: limitedBodyFontSize, ), focusedBorder: InputBorder.none, errorBorder: InputBorder.none, @@ -171,7 +166,7 @@ class _DetailsComponentWidgetState extends State { useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily, ), - fontSize: limitedFontSize, + fontSize: limitedBodyFontSize, ), textAlign: TextAlign.start, maxLines: null, @@ -205,7 +200,7 @@ class _DetailsComponentWidgetState extends State { useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily, ), - fontSize: limitedFontSize, + fontSize: limitedBodyFontSize, ), decoration: InputDecoration( 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 32e05b13..a63c7f37 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 @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/shared/services/authentication/authentication_service.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/validator_util.dart'; import '/flutter_flow/flutter_flow_theme.dart'; @@ -50,6 +51,10 @@ class _ForgotPasswordTemplateComponentWidgetState @override Widget build(BuildContext context) { + double limitedSubHeaderFontSize = LimitedFontSizeUtil.getSubHeaderFontSize(context); + double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); + double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); + return Align( alignment: const AlignmentDirectional(0.0, 1.0), child: SingleChildScrollView( @@ -113,7 +118,7 @@ class _ForgotPasswordTemplateComponentWidgetState .override( fontFamily: 'Plus Jakarta Sans', color: const Color(0xFF15161E), - fontSize: 14.0, + fontSize: limitedHeaderFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() @@ -134,7 +139,7 @@ class _ForgotPasswordTemplateComponentWidgetState style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Outfit', color: FlutterFlowTheme.of(context).primaryText, - fontSize: 24.0, + fontSize: limitedHeaderFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: @@ -151,7 +156,7 @@ class _ForgotPasswordTemplateComponentWidgetState style: FlutterFlowTheme.of(context).labelMedium.override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, + fontSize: limitedSubHeaderFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() @@ -187,7 +192,7 @@ class _ForgotPasswordTemplateComponentWidgetState FlutterFlowTheme.of(context).labelMedium.override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primary, - fontSize: 14.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() @@ -232,7 +237,7 @@ class _ForgotPasswordTemplateComponentWidgetState style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() @@ -276,7 +281,7 @@ class _ForgotPasswordTemplateComponentWidgetState FlutterFlowTheme.of(context).titleSmall.override( fontFamily: 'Plus Jakarta Sans', color: Colors.white, - fontSize: 16.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() diff --git a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart index 2055c251..84ed9118 100644 --- a/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart +++ b/lib/components/templates_components/message_notificaion_modal_template_component/message_notification_widget.dart @@ -3,6 +3,7 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:hub/components/templates_components/message_notificaion_modal_template_component/message_notification_model.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; class MessageNotificationModalTemplateComponentWidget extends StatefulWidget { const MessageNotificationModalTemplateComponentWidget({ @@ -58,6 +59,9 @@ class _MessageNotificationModalTemplateComponentWidgetState @override Widget build(BuildContext context) { + double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); + double limitedSubHeaderFontSize = LimitedFontSizeUtil.getSubHeaderFontSize(context); + return Container( width: MediaQuery.sizeOf(context).width, height: MediaQuery.sizeOf(context).height, @@ -98,6 +102,7 @@ class _MessageNotificationModalTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), + fontSize: limitedBodyFontSize, ), hintStyle: FlutterFlowTheme.of(context).labelMedium.override( fontFamily: @@ -106,6 +111,7 @@ class _MessageNotificationModalTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), + fontSize: limitedBodyFontSize, ), enabledBorder: InputBorder.none, focusedBorder: InputBorder.none, @@ -122,6 +128,7 @@ class _MessageNotificationModalTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedBodyFontSize, ), textAlign: TextAlign.start, maxLines: null, @@ -155,6 +162,7 @@ class _MessageNotificationModalTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), + fontSize: limitedBodyFontSize, ), hintStyle: FlutterFlowTheme.of(context) .labelMedium @@ -165,6 +173,7 @@ class _MessageNotificationModalTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), + fontSize: limitedBodyFontSize, ), enabledBorder: InputBorder.none, focusedBorder: InputBorder.none, @@ -217,6 +226,7 @@ class _MessageNotificationModalTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), + fontSize: limitedBodyFontSize, ), hintStyle: FlutterFlowTheme.of(context).labelMedium.override( fontFamily: @@ -225,6 +235,7 @@ class _MessageNotificationModalTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), + fontSize: limitedBodyFontSize, ), enabledBorder: InputBorder.none, focusedBorder: InputBorder.none, @@ -241,6 +252,7 @@ class _MessageNotificationModalTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedBodyFontSize, ), textAlign: TextAlign.start, maxLines: null, diff --git a/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart b/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart index 91a95b09..ab988446 100644 --- a/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart +++ b/lib/components/templates_components/provisional_schedule_template/provisional_shcedule_template_widget.dart @@ -5,6 +5,7 @@ import 'package:flutter/services.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/components/templates_components/provisional_schedule_template/provisional_schedule_template_model.dart'; import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/log_util.dart'; import '/backend/api_requests/api_calls.dart'; @@ -40,6 +41,11 @@ class _ScheduleProvisionalVisitPageWidgetState @override Widget build(BuildContext context) { + double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); + double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); + double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); + double limitedSubHeaderFontSize = LimitedFontSizeUtil.getSubHeaderFontSize(context); + return GestureDetector( onTap: () => FocusScope.of(context).unfocus(), child: SingleChildScrollView( @@ -62,18 +68,19 @@ class _ScheduleProvisionalVisitPageWidgetState alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 24.0, 0.0, 24.0), + 24.0, 24.0, 24.0, 24.0), child: Text( FFLocalizations.of(context).getText( 'uj8acuab' /* Preencha os Campos Abaixo: */, ), textAlign: TextAlign.start, + overflow: TextOverflow.clip, style: FlutterFlowTheme.of(context) .bodyMedium .override( fontFamily: FlutterFlowTheme.of(context) .bodyMediumFamily, - fontSize: 16.0, + fontSize: limitedHeaderFontSize, letterSpacing: 0.0, fontWeight: FontWeight.bold, useGoogleFonts: GoogleFonts.asMap() @@ -115,6 +122,7 @@ class _ScheduleProvisionalVisitPageWidgetState .containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), + fontSize: limitedSubHeaderFontSize, ), ), ), @@ -188,6 +196,7 @@ class _ScheduleProvisionalVisitPageWidgetState FlutterFlowTheme.of( context) .bodyMediumFamily), + fontSize: limitedBodyFontSize, ), ), ), @@ -229,6 +238,7 @@ class _ScheduleProvisionalVisitPageWidgetState .containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), + fontSize: limitedSubHeaderFontSize, ), ), ), @@ -290,6 +300,7 @@ class _ScheduleProvisionalVisitPageWidgetState FlutterFlowTheme.of( context) .bodyMediumFamily), + fontSize: limitedInputFontSize, ), hintStyle: FlutterFlowTheme.of(context) @@ -310,6 +321,8 @@ class _ScheduleProvisionalVisitPageWidgetState FlutterFlowTheme.of( context) .labelMediumFamily), + fontSize: limitedInputFontSize, + ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -376,6 +389,8 @@ class _ScheduleProvisionalVisitPageWidgetState FlutterFlowTheme.of( context) .bodyMediumFamily), + fontSize: limitedInputFontSize, + ), textAlign: TextAlign.start, maxLines: null, @@ -441,6 +456,8 @@ class _ScheduleProvisionalVisitPageWidgetState FlutterFlowTheme.of( context) .bodyMediumFamily), + fontSize: limitedInputFontSize, + ), enabledBorder: OutlineInputBorder( @@ -511,6 +528,8 @@ class _ScheduleProvisionalVisitPageWidgetState FlutterFlowTheme.of( context) .bodyMediumFamily), + fontSize: limitedInputFontSize, + ), textAlign: TextAlign.start, validator: model @@ -743,6 +762,7 @@ class _ScheduleProvisionalVisitPageWidgetState model.notesTextController, focusNode: model.notesFocusNode, + autofocus: false, showCursor: true, cursorColor: @@ -754,6 +774,19 @@ class _ScheduleProvisionalVisitPageWidgetState obscureText: false, decoration: InputDecoration( isDense: true, + counterStyle: FlutterFlowTheme + .of(context) + .bodyText1 + .override( + fontFamily: + FlutterFlowTheme.of( + context) + .bodyText1Family, + color: FlutterFlowTheme.of( + context) + .primaryText, + fontSize: limitedInputFontSize, + ), labelText: FFLocalizations.of( context) @@ -778,6 +811,7 @@ class _ScheduleProvisionalVisitPageWidgetState FlutterFlowTheme.of( context) .bodyMediumFamily), + fontSize: limitedInputFontSize, ), hintStyle: FlutterFlowTheme .of(context) @@ -797,6 +831,7 @@ class _ScheduleProvisionalVisitPageWidgetState FlutterFlowTheme.of( context) .labelMediumFamily), + fontSize: limitedInputFontSize, ), enabledBorder: OutlineInputBorder( @@ -877,6 +912,8 @@ class _ScheduleProvisionalVisitPageWidgetState FlutterFlowTheme.of( context) .bodyMediumFamily), + fontSize: limitedInputFontSize, + ), textAlign: TextAlign.start, maxLines: 3, @@ -960,8 +997,8 @@ class _ScheduleProvisionalVisitPageWidgetState text: FFLocalizations.of(context) .getText('bv5fg9sv' /* Enviar */), options: FFButtonOptions( - width: 150.0, - height: 50.0, + + height: 30.0 * MediaQuery.textScalerOf(context).scale(1), padding: const EdgeInsetsDirectional.fromSTEB( 24.0, 0.0, 24.0, 0.0), iconPadding: const EdgeInsetsDirectional.fromSTEB( @@ -977,7 +1014,9 @@ class _ScheduleProvisionalVisitPageWidgetState useGoogleFonts: GoogleFonts.asMap() .containsKey(FlutterFlowTheme.of(context) .titleSmallFamily), + fontSize: limitedInputFontSize, ), + elevation: 3.0, borderSide: const BorderSide( color: Colors.transparent, diff --git a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart index 063daae5..9a008778 100644 --- a/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart +++ b/lib/components/templates_components/qr_code_pass_key_template_component/qr_code_pass_key_template_component_widget.dart @@ -58,7 +58,7 @@ class _QrCodePassKeyTemplateComponentWidgetState alignment: const AlignmentDirectional(0.0, 1.0), child: Container( width: double.infinity, - height: LimitedTextSizeUtil.getScaledSizedBoxSize(context, 300, 570, 500, 300), + height: 300 * MediaQuery.textScalerOf(context).scale(1), constraints: const BoxConstraints( minHeight: 300.0, maxWidth: 570.0, @@ -117,7 +117,7 @@ class _QrCodePassKeyTemplateComponentWidgetState FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: 'Plus Jakarta Sans', color: const Color(0xFF15161E), - fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 16, 30, 14), + fontSize: LimitedFontSizeUtil.getCalculateFontSize(context, 16, 16, 14), letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() @@ -139,7 +139,7 @@ class _QrCodePassKeyTemplateComponentWidgetState style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Outfit', color: FlutterFlowTheme.of(context).primaryText, - fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 20, 38, 18), + fontSize: LimitedFontSizeUtil.getCalculateFontSize(context, 20, 20, 18), letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap().containsKey('Outfit'), @@ -156,7 +156,7 @@ class _QrCodePassKeyTemplateComponentWidgetState style: FlutterFlowTheme.of(context).labelMedium.override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, - fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 26, 12), + fontSize: LimitedFontSizeUtil.getCalculateFontSize(context, 14, 14, 12), letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: @@ -192,7 +192,7 @@ class _QrCodePassKeyTemplateComponentWidgetState FlutterFlowTheme.of(context).labelMedium.override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, - fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 10, 18, 8), + fontSize: LimitedFontSizeUtil.getInputFontSize(context), letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() @@ -206,7 +206,7 @@ class _QrCodePassKeyTemplateComponentWidgetState FlutterFlowTheme.of(context).labelMedium.override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, - fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 10, 18, 8), + fontSize: LimitedFontSizeUtil.getInputFontSize(context), letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() @@ -262,7 +262,7 @@ class _QrCodePassKeyTemplateComponentWidgetState style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, - fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize(context, 10, 18, 8), + fontSize: LimitedFontSizeUtil.getInputFontSize(context), letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() @@ -315,7 +315,7 @@ class _QrCodePassKeyTemplateComponentWidgetState textStyle: FlutterFlowTheme.of(context).titleSmall.override( fontFamily: 'Plus Jakarta Sans', color: Colors.white, - fontSize: LimitedTextSizeUtil.getNoResizeFont(context, 15), + fontSize: LimitedFontSizeUtil.getInputFontSize(context), letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart index 0d45259f..02d829df 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_model.dart @@ -66,7 +66,7 @@ class RegisiterVistorTemplateComponentModel enText: 'This field is required', ptText: 'Este campo é obrigatório', ); - } + } return null; } diff --git a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart index b12a72fa..3a3850fd 100644 --- a/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart +++ b/lib/components/templates_components/regisiter_vistor_template_component/regisiter_vistor_template_component_widget.dart @@ -2,6 +2,7 @@ import 'package:easy_debounce/easy_debounce.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/components/atomic_components/shared_components_atoms/media_upload_button.dart'; import 'package:hub/shared/utils/dialog_util.dart'; import 'package:hub/shared/utils/image_util.dart'; import 'package:hub/shared/utils/limited_text_size.dart'; @@ -122,7 +123,9 @@ class _RegisiterVistorTemplateComponentWidgetState @override Widget build(BuildContext context) { - double limitedTextSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 12.0, 22.0, 10.0 ); + double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); + double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); + double limitedSubHeaderFontSize = LimitedFontSizeUtil.getSubHeaderFontSize(context); return Align( alignment: const AlignmentDirectional(0.0, 1.0), @@ -150,11 +153,12 @@ class _RegisiterVistorTemplateComponentWidgetState alignment: const AlignmentDirectional(-1.0, 0.0), child: Padding( padding: const EdgeInsetsDirectional.fromSTEB( - 20.0, 0.0, 0.0, 15.0), + 24.0, 0.0, 24.0, 15.0), child: Text( FFLocalizations.of(context).getText( 'zazj5d8b' /* Preencha o formulário com os d... */, ), + overflow: TextOverflow.clip, textAlign: TextAlign.start, style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: @@ -162,6 +166,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedHeaderFontSize, ), ), ), @@ -197,7 +202,7 @@ class _RegisiterVistorTemplateComponentWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) .labelMediumFamily), - fontSize: limitedTextSize, + fontSize: limitedInputFontSize, ), hintStyle: FlutterFlowTheme.of(context).labelMedium.override( @@ -207,7 +212,7 @@ class _RegisiterVistorTemplateComponentWidgetState useGoogleFonts: GoogleFonts.asMap() .containsKey(FlutterFlowTheme.of(context) .labelMediumFamily), - fontSize: limitedTextSize, + fontSize: limitedInputFontSize, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -230,6 +235,10 @@ class _RegisiterVistorTemplateComponentWidgetState ), borderRadius: BorderRadius.circular(10.0), ), + errorStyle: TextStyle( + color: FlutterFlowTheme.of(context).error, + fontSize: limitedInputFontSize, + ), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).error, @@ -249,7 +258,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), - fontSize: limitedTextSize, + fontSize: limitedInputFontSize, ), onChanged: (value) { _model.debounce(() async { @@ -298,7 +307,7 @@ class _RegisiterVistorTemplateComponentWidgetState Colors.black .withOpacity(0.25), Colors.red), - fontSize: 13.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, )), ), @@ -337,7 +346,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), - fontSize: limitedTextSize, + fontSize: limitedInputFontSize, ), hintStyle: FlutterFlowTheme.of(context) .labelMedium @@ -348,7 +357,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), - fontSize: limitedTextSize, + fontSize: limitedInputFontSize, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -371,6 +380,10 @@ class _RegisiterVistorTemplateComponentWidgetState ), borderRadius: BorderRadius.circular(10.0), ), + errorStyle: TextStyle( + color: FlutterFlowTheme.of(context).error, + fontSize: limitedInputFontSize, + ), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( color: FlutterFlowTheme.of(context).error, @@ -390,7 +403,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), - fontSize: limitedTextSize, + fontSize: limitedInputFontSize, ), maxLines: null, maxLength: 80, @@ -430,7 +443,7 @@ class _RegisiterVistorTemplateComponentWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), - fontSize: limitedTextSize, + fontSize: limitedInputFontSize, ), hintText: FFLocalizations.of(context).getVariableText( enText: 'Visitor Type', @@ -478,7 +491,7 @@ class _RegisiterVistorTemplateComponentWidgetState .containsKey( FlutterFlowTheme.of(context) .bodySmallFamily), - fontSize: limitedTextSize, + fontSize: limitedInputFontSize, )), ), ], @@ -519,156 +532,17 @@ class _RegisiterVistorTemplateComponentWidgetState } else { return Stack( children: [ - GestureDetector( - onTap: () async { - - setState(() { - _isLoading = true; - }); - - final selectedMedia = - await selectMediaWithSourceBottomSheetandFaceDetection( - context: context, - // maxWidth: 300.00, - // maxHeight: 300.00, - imageQuality: 100, - allowPhoto: true, - includeDimensions: true, - ); - if (selectedMedia != null) { - // && - // selectedMedia.every((m) => - // validateFileFormat( - // m.storagePath, context))) { - setState( - () => _model.isDataUploading = true); - var selectedUploadedFiles = - []; - - try { - final message = - FFLocalizations.of(context) - .getVariableText( - enText: 'Uploading file...', - ptText: 'Enviando arquivo...', - ); - showUploadMessage( - context, - message, - showLoading: true, - ); - selectedUploadedFiles = selectedMedia - .map((m) => FFUploadedFile( - name: m.storagePath - .split('/') - .last, - bytes: m.bytes, - height: m.dimensions?.height, - width: m.dimensions?.width, - // blurHash: m.blurHash, - )) - .toList(); - } finally { - ScaffoldMessenger.of(context) - .hideCurrentSnackBar(); - _model.isDataUploading = false; - } - if (selectedUploadedFiles.length == - selectedMedia.length) { - setState(() { - _model.uploadedLocalFile = - selectedUploadedFiles.first; - _isLoading = false; - }); - final String message = - FFLocalizations.of(context) - .getVariableText( - enText: 'File uploaded successfully', - ptText: 'Arquivo enviado com sucesso', - ); - showUploadMessage(context, message); - } else { - setState(() { - _isLoading = false; - }); - final String message = - FFLocalizations.of(context) - .getVariableText( - enText: 'Failed to upload data', - ptText: 'Falha ao enviar os dados', - ); - showUploadMessage(context, message); - - return; - }} else { - setState(() { - _isLoading = false; - }); - - } - }, - child: Center( - child: Container( - width: MediaQuery.of(context).size.width * 0.8, - height: 120, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8.0), - border: Border.all( - color: FlutterFlowTheme.of(context).customColor6, - width: 1.0, - ), - ), - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - _isLoading - ? SizedBox( - width: 30.0, - height: 30.0, - child: CircularProgressIndicator( - valueColor: - AlwaysStoppedAnimation( - FlutterFlowTheme.of(context) - .primary, - ), - ), - ) - : Icon( - Icons.photo_camera, - color: FlutterFlowTheme.of(context) - .primary, - size: 30.0, - ), - Padding( - padding: - const EdgeInsets.fromLTRB(0, 15, 0, 0), - child: Text( - FFLocalizations.of(context).getText( - 'p4ftwxcy', - ), - textAlign: TextAlign.center, - style: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: - FlutterFlowTheme.of(context) - .titleSmallFamily, - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: limitedTextSize, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .titleSmallFamily), - ), - ), - ) - ], - ), - ), + MediaUploadButtonUtil( + onUploadComplete: (uploadedFile) { + setState(() { + _model.uploadedLocalFile = uploadedFile; + }); + }, + isUploading: _model.isDataUploading, + labelText: FFLocalizations.of(context).getText( + 'p4ftwxcy' /* Selecione uma foto */, ), + uploadedFiles: _model.uploadedLocalFile, ), ] ); @@ -692,6 +566,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedSubHeaderFontSize, ), ), ), @@ -730,7 +605,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), - fontSize: limitedTextSize, + fontSize: limitedInputFontSize, ), hintStyle: FlutterFlowTheme.of(context) .labelMedium @@ -741,7 +616,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), - fontSize: limitedTextSize, + fontSize: limitedInputFontSize, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -783,7 +658,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), - fontSize: limitedTextSize, + fontSize: limitedInputFontSize, ), // validator: // _model.textController3Validator.asValidator(context), @@ -820,7 +695,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), - fontSize: limitedTextSize, + fontSize: limitedInputFontSize, ), hintStyle: FlutterFlowTheme.of(context) .labelMedium @@ -831,7 +706,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), - fontSize: limitedTextSize, + fontSize: limitedInputFontSize, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -873,7 +748,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), - fontSize: limitedTextSize, + fontSize: limitedInputFontSize, ), keyboardType: TextInputType.emailAddress, inputFormatters: [LengthLimitingTextInputFormatter(80)], @@ -976,8 +851,7 @@ class _RegisiterVistorTemplateComponentWidgetState 'okbw0aiu' /* Cadastrar */, ), options: FFButtonOptions( - width: 250.0, - height: 36.0, + height: 30.0 * MediaQuery.textScalerOf(context).scale(1), disabledColor: FlutterFlowTheme.of(context).customColor5, padding: const EdgeInsetsDirectional.fromSTEB( 80.0, 0.0, 80.0, 0.0), @@ -993,7 +867,7 @@ class _RegisiterVistorTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).titleSmallFamily), - fontSize: LimitedTextSizeUtil.getNoResizeFont(context, 15) + fontSize: limitedInputFontSize, ), borderSide: const BorderSide( color: Colors.transparent, 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 e7b8b9ca..53d731eb 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 @@ -5,6 +5,7 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart'; import 'package:hub/shared/components/atoms/atom_terms_of_use.dart'; import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/log_util.dart'; import 'package:hub/shared/utils/validator_util.dart'; @@ -109,6 +110,9 @@ class _SignInTemplateComponentWidgetState @override Widget build(BuildContext context) { + double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); + double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); + return Row( mainAxisSize: MainAxisSize.max, children: [ @@ -123,30 +127,28 @@ class _SignInTemplateComponentWidgetState children: [ Padding( padding: const EdgeInsets.all(20.0), - child: Expanded( - child: Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Padding( - padding: const EdgeInsets.all(3.0), - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: 'VAMOS LÁ! ENTRE COM A SUA CONTA', - enText: 'LET\'S GO! SIGN IN WITH YOUR ACCOUNT', - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .displaySmall - .override( - fontFamily: 'Plus Jakarta Sans', - color: - FlutterFlowTheme.of(context).primaryText, - fontSize: 24.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), + child: Align( + alignment: const AlignmentDirectional(0.0, 1.0), + child: Padding( + padding: const EdgeInsets.all(3.0), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'VAMOS LÁ! ENTRE COM A SUA CONTA', + enText: 'LET\'S GO! SIGN IN WITH YOUR ACCOUNT', ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .displaySmall + .override( + fontFamily: 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of(context).primaryText, + fontSize: limitedHeaderFontSize, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), ), ), ), @@ -243,7 +245,7 @@ class _SignInTemplateComponentWidgetState FlutterFlowTheme.of( context) .primaryText, - fontSize: 16.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -287,10 +289,19 @@ class _SignInTemplateComponentWidgetState .error, width: 0.25, ), + borderRadius: BorderRadius.circular( 12.0), ), + errorStyle: TextStyle( + color: + FlutterFlowTheme.of( + context) + .error, + fontSize: limitedInputFontSize, + fontWeight: FontWeight.w500, + ), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( @@ -321,7 +332,7 @@ class _SignInTemplateComponentWidgetState color: FlutterFlowTheme .of(context) .primaryText, - fontSize: 16.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -383,7 +394,7 @@ class _SignInTemplateComponentWidgetState color: FlutterFlowTheme .of(context) .primaryText, - fontSize: 16.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -404,6 +415,14 @@ class _SignInTemplateComponentWidgetState BorderRadius.circular( 12.0), ), + errorStyle: TextStyle( + color: + FlutterFlowTheme.of( + context) + .error, + fontSize: limitedInputFontSize, + fontWeight: FontWeight.w500, + ), focusedBorder: OutlineInputBorder( borderSide: const BorderSide( @@ -469,7 +488,7 @@ class _SignInTemplateComponentWidgetState color: FlutterFlowTheme .of(context) .primaryText, - fontSize: 16.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -548,7 +567,7 @@ class _SignInTemplateComponentWidgetState color: FlutterFlowTheme .of(context) .info, - fontSize: 16.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -616,7 +635,7 @@ class _SignInTemplateComponentWidgetState color: FlutterFlowTheme .of(context) .secondaryText, - fontSize: 16.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -717,8 +736,7 @@ class _SignInTemplateComponentWidgetState color: FlutterFlowTheme.of( context) .info, - fontSize: - 16.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: @@ -867,7 +885,10 @@ class _SignInTemplateComponentWidgetState style: TextStyle( color: FlutterFlowTheme.of( context) - .primaryText), + .primaryText, + fontSize: limitedInputFontSize, + ), + ), TextSpan( text: FFLocalizations.of( @@ -883,7 +904,7 @@ class _SignInTemplateComponentWidgetState color: FlutterFlowTheme .of(context) .primary, - fontSize: 14.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.normal, @@ -910,7 +931,9 @@ class _SignInTemplateComponentWidgetState .containsKey( FlutterFlowTheme.of( context) - .bodyMediumFamily)), + .bodyMediumFamily), + fontSize: limitedInputFontSize + ), ), ), ), 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 35dc9f93..5b133d1e 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 @@ -4,6 +4,7 @@ import 'package:flutter_animate/flutter_animate.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart'; import 'package:hub/shared/components/atoms/atom_terms_of_use.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/storage_util.dart'; import 'package:hub/shared/utils/validator_util.dart'; @@ -101,6 +102,9 @@ class _SignUpTemplateComponentWidgetState final double screenWidth = mediaQuery.size.width; final double screenHeight = mediaQuery.size.height; + double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); + double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); + bool isFormInvalid() { if (_model.nameRegisterFormTextController.text == '' || _model.emailRegisterFormTextController.text == '' || @@ -142,29 +146,27 @@ class _SignUpTemplateComponentWidgetState children: [ Padding( padding: const EdgeInsets.all(20.0), - child: Expanded( - child: Align( - alignment: const AlignmentDirectional(0.0, -1.0), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Text( - FFLocalizations.of(context).getText( - '49609olv' /* INSIRA SEU EMAIL E SENHA, VAMO... */, - ), - textAlign: TextAlign.start, - style: FlutterFlowTheme.of(context) - .displaySmall - .override( - fontFamily: 'Plus Jakarta Sans', - color: FlutterFlowTheme.of(context) - .primaryText, - fontSize: screenWidth * 0.06, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap() - .containsKey('Plus Jakarta Sans'), - ), + child: Align( + alignment: const AlignmentDirectional(0.0, -1.0), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Text( + FFLocalizations.of(context).getText( + '49609olv' /* INSIRA SEU EMAIL E SENHA, VAMO... */, ), + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context) + .displaySmall + .override( + fontFamily: 'Plus Jakarta Sans', + color: FlutterFlowTheme.of(context) + .primaryText, + fontSize: limitedHeaderFontSize, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap() + .containsKey('Plus Jakarta Sans'), + ), ), ), ), @@ -258,7 +260,7 @@ class _SignUpTemplateComponentWidgetState color: FlutterFlowTheme .of(context) .primaryText, - fontSize: 16.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -307,6 +309,17 @@ class _SignUpTemplateComponentWidgetState BorderRadius.circular( 12.0), ), + errorStyle: TextStyle( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .error, + fontSize: limitedInputFontSize, + fontWeight: FontWeight.w400, + fontStyle: FontStyle.normal, + ), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( @@ -344,7 +357,7 @@ class _SignUpTemplateComponentWidgetState FlutterFlowTheme.of( context) .primaryText, - fontSize: 16.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -402,7 +415,7 @@ class _SignUpTemplateComponentWidgetState color: FlutterFlowTheme .of(context) .primaryText, - fontSize: 16.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -451,6 +464,17 @@ class _SignUpTemplateComponentWidgetState BorderRadius.circular( 12.0), ), + errorStyle: TextStyle( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .error, + fontSize: limitedInputFontSize, + fontWeight: FontWeight.w400, + fontStyle: FontStyle.normal, + ), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( @@ -488,7 +512,7 @@ class _SignUpTemplateComponentWidgetState FlutterFlowTheme.of( context) .customColor1, - fontSize: 16.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -549,7 +573,7 @@ class _SignUpTemplateComponentWidgetState color: FlutterFlowTheme .of(context) .primaryText, - fontSize: 16.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -596,6 +620,17 @@ class _SignUpTemplateComponentWidgetState BorderRadius.circular( 12.0), ), + errorStyle: TextStyle( + fontFamily: + 'Plus Jakarta Sans', + color: + FlutterFlowTheme.of( + context) + .error, + fontSize: limitedInputFontSize, + fontWeight: FontWeight.w400, + fontStyle: FontStyle.normal, + ), focusedErrorBorder: OutlineInputBorder( borderSide: @@ -649,7 +684,7 @@ class _SignUpTemplateComponentWidgetState FlutterFlowTheme.of( context) .primaryText, - fontSize: 16.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, @@ -730,7 +765,7 @@ class _SignUpTemplateComponentWidgetState color: FlutterFlowTheme.of( context) .secondaryText, - fontSize: 16.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts @@ -783,6 +818,7 @@ class _SignUpTemplateComponentWidgetState color: FlutterFlowTheme.of( context) .primaryText, + fontSize: limitedInputFontSize, ), ), TextSpan( @@ -801,7 +837,7 @@ class _SignUpTemplateComponentWidgetState FlutterFlowTheme.of( context) .primary, - fontSize: 14.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w600, diff --git a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart index a2c1020a..9f84ff8e 100644 --- a/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart +++ b/lib/components/templates_components/visitor_search_modal_template_component/visitor_search_modal_template_component_widget.dart @@ -60,18 +60,9 @@ class _VisitorSearchModalTemplateComponentWidgetState @override Widget build(BuildContext context) { - final double limitedFontSize = LimitedTextSizeUtil.getLimitedBodyFontSize( - context, - 12, - 16, - 10 - ); - final double limitedHeaderFontSize = LimitedTextSizeUtil.getLimitedBodyFontSize( - context, - 14, - 16, - 12 - ); + final double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); + final double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); + final double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); return Padding( padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0), @@ -124,7 +115,7 @@ class _VisitorSearchModalTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).labelMediumFamily), - fontSize: limitedFontSize, + fontSize: limitedInputFontSize, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -186,7 +177,7 @@ class _VisitorSearchModalTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), - fontSize: limitedFontSize, + fontSize: limitedInputFontSize, ), keyboardType: const TextInputType.numberWithOptions(signed: true), @@ -330,7 +321,7 @@ class _VisitorSearchModalTemplateComponentWidgetState FlutterFlowTheme.of( context) .bodyLargeFamily), - fontSize: limitedFontSize, + fontSize: limitedBodyFontSize, ), ), ), @@ -416,7 +407,7 @@ class _VisitorSearchModalTemplateComponentWidgetState letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).titleSmallFamily), - fontSize: limitedFontSize, + fontSize: limitedInputFontSize, ), elevation: 3.0, borderSide: const BorderSide( diff --git a/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart index 08aafeb2..b2fbb575 100644 --- a/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart +++ b/lib/components/templates_components/welcome_template_component/welcome_template_component_widget.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/components/atomic_components/shared_components_atoms/atom_image_svg_theme.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import '/flutter_flow/flutter_flow_animations.dart'; import '/flutter_flow/flutter_flow_theme.dart'; @@ -89,6 +90,10 @@ class _WelcomeTemplateComponentWidgetState @override Widget build(BuildContext context) { + double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); + double limitedSubHeaderFontSize = LimitedFontSizeUtil.getSubHeaderFontSize(context); + double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); + return Align( alignment: const AlignmentDirectional(0.0, 0.0), child: SingleChildScrollView( @@ -108,7 +113,7 @@ class _WelcomeTemplateComponentWidgetState style: FlutterFlowTheme.of(context).displaySmall.override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).accent1, - fontSize: 24.0, + fontSize: limitedHeaderFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w600, useGoogleFonts: GoogleFonts.asMap() @@ -124,7 +129,7 @@ class _WelcomeTemplateComponentWidgetState style: FlutterFlowTheme.of(context).displaySmall.override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).primaryText, - fontSize: 15.0, + fontSize: limitedSubHeaderFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w600, useGoogleFonts: GoogleFonts.asMap() @@ -215,7 +220,7 @@ class _WelcomeTemplateComponentWidgetState color: FlutterFlowTheme.of(context) .info, - fontSize: 16.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts @@ -266,13 +271,14 @@ class _WelcomeTemplateComponentWidgetState color: FlutterFlowTheme.of(context) .primaryBackground, - fontSize: 16.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts .asMap() .containsKey( 'Plus Jakarta Sans'), + ), elevation: 3.0, borderSide: const BorderSide( diff --git a/lib/flutter_flow/flutter_flow_util.dart b/lib/flutter_flow/flutter_flow_util.dart index 29fa1a0f..dd9fb1f0 100644 --- a/lib/flutter_flow/flutter_flow_util.dart +++ b/lib/flutter_flow/flutter_flow_util.dart @@ -566,18 +566,19 @@ void showSnackbar( void showAlertDialog(BuildContext context, String title, String content, Future Function() action) { - double limitedTextSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 20, 12); - double limitedHeaderSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 20, 28, 18); + double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); + double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); + double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); showDialog( context: context, builder: (context) { return AlertDialog( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, - title: Text(title, style: TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedHeaderSize), textAlign: TextAlign.center), + title: Text(title, style: TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedHeaderFontSize), textAlign: TextAlign.center), content: Padding( padding: const EdgeInsets.all(8.0), - child: Text(content, style: TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedTextSize)), + child: Text(content, style: TextStyle(color: FlutterFlowTheme.of(context).primaryText, fontSize: limitedBodyFontSize)), ), actions: [ Row( @@ -592,7 +593,7 @@ void showAlertDialog(BuildContext context, String title, String content, color: FlutterFlowTheme.of(context).primaryBackground, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedTextSize + fontSize: limitedInputFontSize ), borderSide: BorderSide( color: FlutterFlowTheme.of(context).primaryBackground, @@ -618,7 +619,7 @@ void showAlertDialog(BuildContext context, String title, String content, elevation: 0, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedTextSize + fontSize: limitedInputFontSize ), splashColor: const Color.fromARGB(255, 129, 129, 129), borderSide: BorderSide( diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart index e7c83d82..79d40b78 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -7,6 +7,7 @@ import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/message_history_page/message_history_page_model.dart'; import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/log_util.dart'; class MessageHistoryPageWidget extends StatefulWidget { @@ -166,7 +167,7 @@ class _MessageHistoryPageWidgetState extends State style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).primaryText, - fontSize: 15.0, + fontSize: LimitedFontSizeUtil.getHeaderFontSize(context), fontWeight: FontWeight.bold, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), @@ -178,6 +179,8 @@ class _MessageHistoryPageWidgetState extends State } Widget _body(BuildContext context) { + double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); + double limitedSubHeaderFontSize = LimitedFontSizeUtil.getSubHeaderFontSize(context); return SafeArea( top: true, child: Column( @@ -191,7 +194,7 @@ class _MessageHistoryPageWidgetState extends State unselectedLabelColor: FlutterFlowTheme.of(context).primaryText, labelStyle: FlutterFlowTheme.of(context).titleMedium.override( fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, - fontSize: 13.0, + fontSize: limitedBodyFontSize, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).titleMediumFamily), @@ -231,7 +234,11 @@ class _MessageHistoryPageWidgetState extends State Center( child: Text(FFLocalizations.of(context).getVariableText( ptText: "Nenhuma mensagem encontrada!", - enText: "No message found")), + enText: "No message found"), + style: TextStyle( + color: FlutterFlowTheme.of(context).primaryText, + fontSize: limitedSubHeaderFontSize,) + ), ) ], ), @@ -283,6 +290,8 @@ class _MessageHistoryPageWidgetState extends State } Widget _item(BuildContext context, dynamic jsonBody) { + double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); + double limitedSubHeaderFontSize = LimitedFontSizeUtil.getSubHeaderFontSize(context); return Padding( padding: const EdgeInsets.symmetric(horizontal: 15), child: Card( @@ -317,7 +326,7 @@ class _MessageHistoryPageWidgetState extends State jsonBody['MSG_ORIGEM_DESC'].toString(), style: TextStyle( fontWeight: FontWeight.bold, - fontSize: 15, + fontSize: limitedSubHeaderFontSize, color: FlutterFlowTheme.of(context).primary, ), overflow: TextOverflow.fade, @@ -343,7 +352,7 @@ class _MessageHistoryPageWidgetState extends State jsonBody['MSG_DATE'].toString(), style: TextStyle( fontWeight: FontWeight.bold, - fontSize: 10, + fontSize: limitedBodyFontSize, color: FlutterFlowTheme.of(context).customColor6, ), @@ -368,6 +377,11 @@ class _MessageHistoryPageWidgetState extends State Expanded( child: Text( jsonBody['MSG_TEXTO'].toString(), + style: TextStyle( + fontSize: limitedBodyFontSize, + color: + FlutterFlowTheme.of(context).customColor6, + ), ), ), ].divide(const SizedBox(width: 15)), diff --git a/lib/pages/package_order_page/package_order_page.dart b/lib/pages/package_order_page/package_order_page.dart index f1b5cf91..7deada31 100644 --- a/lib/pages/package_order_page/package_order_page.dart +++ b/lib/pages/package_order_page/package_order_page.dart @@ -268,8 +268,7 @@ class _PackageOrderPage extends State { enText: "No orders found!"), style: TextStyle( color: FlutterFlowTheme.of(context).primaryText, - fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize( - context, 14, 24, 12), + fontSize: LimitedFontSizeUtil.getHeaderFontSize(context), ), )), ], diff --git a/lib/pages/pets_page/pets_history_screen.dart b/lib/pages/pets_page/pets_history_screen.dart index a1d9cdf0..3b39429b 100644 --- a/lib/pages/pets_page/pets_history_screen.dart +++ b/lib/pages/pets_page/pets_history_screen.dart @@ -5,6 +5,7 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/pages/pets_page/pets_page_model.dart'; import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/log_util.dart'; import 'package:hub/shared/utils/storage_util.dart'; @@ -116,6 +117,9 @@ class _PetsHistoryScreenState extends State @override Widget build(BuildContext context) { + double limitedBodyTextSize = LimitedFontSizeUtil.getBodyFontSize(context); + double limitedHeaderTextSize = LimitedFontSizeUtil.getHeaderFontSize(context); + return Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, @@ -129,7 +133,11 @@ class _PetsHistoryScreenState extends State Center( child: Text(FFLocalizations.of(context).getVariableText( ptText: "Nenhum Pet encontrado!", - enText: "No pets found")), + enText: "No pets found"), + style: TextStyle( + fontFamily: 'Nunito', + fontSize: limitedHeaderTextSize,) + ), ) ], ), @@ -155,6 +163,10 @@ class _PetsHistoryScreenState extends State ptText: "Ilimitado", enText: "Unlimited") : "${FFLocalizations.of(context).getVariableText(ptText: "Quantidade de Pets: ", enText: "Amount of Pets: ")}$count/${widget.model.petAmountRegister}", textAlign: TextAlign.right, + style: TextStyle( + fontFamily: 'Nunito', + fontSize: limitedBodyTextSize, + ), ), ); } else { diff --git a/lib/pages/pets_page/pets_page_model.dart b/lib/pages/pets_page/pets_page_model.dart index 958c5f09..e505c51f 100644 --- a/lib/pages/pets_page/pets_page_model.dart +++ b/lib/pages/pets_page/pets_page_model.dart @@ -14,6 +14,7 @@ import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/pets_page/pets_page_widget.dart'; import 'package:hub/shared/utils/dialog_util.dart'; import 'package:hub/shared/utils/image_util.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/storage_util.dart'; import 'package:hub/shared/utils/validator_util.dart'; @@ -408,13 +409,15 @@ class PetsPageModel extends FlutterFlowModel { // model.safeSetState!(); }, options: FFButtonOptions( - width: 130, + width: 100, height: 40, color: FlutterFlowTheme.of(context).primaryBackground, elevation: 0, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, + fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 15), ), + splashColor: const Color.fromARGB(95, 0, 146, 5), borderSide: BorderSide( color: FlutterFlowTheme.of(context).primaryBackground, width: 1, @@ -484,13 +487,15 @@ class PetsPageModel extends FlutterFlowModel { }); }, options: FFButtonOptions( - width: 130, + width: 100, height: 40, color: FlutterFlowTheme.of(context).primaryBackground, elevation: 0, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, + fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 15), ), + splashColor: const Color.fromARGB(131, 255, 17, 0), borderSide: BorderSide( color: FlutterFlowTheme.of(context).primaryBackground, width: 1, diff --git a/lib/pages/pets_page/pets_page_widget.dart b/lib/pages/pets_page/pets_page_widget.dart index c965d7ef..8ff0f1ba 100644 --- a/lib/pages/pets_page/pets_page_widget.dart +++ b/lib/pages/pets_page/pets_page_widget.dart @@ -13,6 +13,7 @@ import 'package:hub/flutter_flow/form_field_controller.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/pets_page/pets_history_screen.dart'; import 'package:hub/pages/pets_page/pets_page_model.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:material_symbols_icons/symbols.dart'; // ignore: must_be_immutable @@ -107,6 +108,10 @@ class _PetsPageWidgetState extends State } Widget _buildRegisterForm(BuildContext context) { + double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); + double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); + double limitedSubHeaderFontSize = LimitedFontSizeUtil.getSubHeaderFontSize(context); + return SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.max, @@ -126,7 +131,9 @@ class _PetsPageWidgetState extends State letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedHeaderFontSize, ), + ), ), ), @@ -177,41 +184,35 @@ class _PetsPageWidgetState extends State onChanged: (value) => setState(() {}), maxLength: 80, ), - Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), - child: CustomInputUtil( - controller: _model.textControllerRace, - validator: _model.textControllerRaceValidator - .asValidator(context), - focusNode: _model.textFieldFocusRace, - labelText: FFLocalizations.of(context) - .getVariableText(ptText: 'Raça', enText: 'Race'), - hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Ex: Labrador, Poodle, Siamês, Persa', - enText: 'e.g. Labrador, Poodle, Siamese, Persian'), - suffixIcon: Icons.pets_outlined, - haveMaxLength: true, - onChanged: (value) => setState(() {}), - maxLength: 80, - ), + CustomInputUtil( + controller: _model.textControllerRace, + validator: _model.textControllerRaceValidator + .asValidator(context), + focusNode: _model.textFieldFocusRace, + labelText: FFLocalizations.of(context) + .getVariableText(ptText: 'Raça', enText: 'Race'), + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Ex: Labrador, Poodle, Siamês, Persa', + enText: 'e.g. Labrador, Poodle, Siamese, Persian'), + suffixIcon: Icons.pets_outlined, + haveMaxLength: true, + onChanged: (value) => setState(() {}), + maxLength: 80, ), - Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), - child: CustomInputUtil( - controller: _model.textControllerColor, - validator: _model.textControllerColorValidator - .asValidator(context), - focusNode: _model.textFieldFocusColor, - labelText: FFLocalizations.of(context) - .getVariableText(ptText: 'Cor', enText: 'Color'), - hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Ex: Preto, Amarelo, Branco', - enText: 'e.g. Black, Yellow, White'), - suffixIcon: Symbols.palette, - haveMaxLength: true, - onChanged: (value) => setState(() {}), - maxLength: 80, - ), + CustomInputUtil( + controller: _model.textControllerColor, + validator: _model.textControllerColorValidator + .asValidator(context), + focusNode: _model.textFieldFocusColor, + labelText: FFLocalizations.of(context) + .getVariableText(ptText: 'Cor', enText: 'Color'), + hintText: FFLocalizations.of(context).getVariableText( + ptText: 'Ex: Preto, Amarelo, Branco', + enText: 'e.g. Black, Yellow, White'), + suffixIcon: Symbols.palette, + haveMaxLength: true, + onChanged: (value) => setState(() {}), + maxLength: 80, ), Padding( padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), @@ -251,6 +252,7 @@ class _PetsPageWidgetState extends State .containsKey( FlutterFlowTheme.of(context) .labelMediumFamily), + fontSize: limitedInputFontSize, ), hintText: FFLocalizations.of(context) .getVariableText( @@ -271,6 +273,7 @@ class _PetsPageWidgetState extends State FlutterFlowTheme.of(context) .labelMediumFamily), lineHeight: 1.0, + fontSize: limitedInputFontSize, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -326,6 +329,7 @@ class _PetsPageWidgetState extends State FlutterFlowTheme.of(context) .bodyMediumFamily), lineHeight: 1.8, + fontSize: limitedInputFontSize, ), textAlign: TextAlign.start, validator: _model @@ -364,7 +368,7 @@ class _PetsPageWidgetState extends State fontFamily: FlutterFlowTheme .of(context) .headlineLargeFamily, - fontSize: 32.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w600, @@ -456,6 +460,7 @@ class _PetsPageWidgetState extends State useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), + fontSize: limitedSubHeaderFontSize, ), ), ), @@ -479,8 +484,9 @@ class _PetsPageWidgetState extends State ptText: 'Fêmea', enText: 'Female') ], hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Selecione o gênero do Pet', - enText: 'Select the gender of the Pet')), + ptText: 'Gênero do Pet', + enText: 'Gender of the Pet') + ), ), Padding( padding: const EdgeInsets.fromLTRB(0, 0, 0, 15), @@ -507,8 +513,8 @@ class _PetsPageWidgetState extends State ptText: 'Gigante', enText: 'Giant'), ], hintText: FFLocalizations.of(context).getVariableText( - ptText: 'Selecione o porte do Pet', - enText: 'Select the size of the Pet')), + ptText: 'Porte do Pet', + enText: 'Size of the Pet')), ), Align( alignment: const AlignmentDirectional(-1.0, 0.0), @@ -533,6 +539,7 @@ class _PetsPageWidgetState extends State useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), + fontSize: limitedInputFontSize, ), ), ), diff --git a/lib/pages/preferences_settings_page/preferences_settings_widget.dart b/lib/pages/preferences_settings_page/preferences_settings_widget.dart index 945092b9..2093c715 100644 --- a/lib/pages/preferences_settings_page/preferences_settings_widget.dart +++ b/lib/pages/preferences_settings_page/preferences_settings_widget.dart @@ -5,6 +5,7 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/preferences_settings_page/preferences_settings_model.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/storage_util.dart'; import 'package:provider/provider.dart'; @@ -20,6 +21,7 @@ class _PreferencesPageWidgetState extends State { void initState() { super.initState(); } + @override Widget build(BuildContext context) { @@ -215,7 +217,7 @@ class _PreferencesPageWidgetState extends State { style: FlutterFlowTheme.of(context).bodySmall.override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, + fontSize: LimitedFontSizeUtil.getInputFontSize(context), letterSpacing: 0.0, fontWeight: FontWeight.normal, fontStyle: FontStyle.normal, diff --git a/lib/pages/qr_code_page/qr_code_page_widget.dart b/lib/pages/qr_code_page/qr_code_page_widget.dart index ef8d0aed..dfc801bb 100644 --- a/lib/pages/qr_code_page/qr_code_page_widget.dart +++ b/lib/pages/qr_code_page/qr_code_page_widget.dart @@ -110,257 +110,272 @@ class _QrCodePageWidgetState extends State screenWidth < screenHeight ? screenWidth : screenHeight; double dimension = smallerDimension * 0.75; double totalTimeInSeconds = 100.0; - double limitedHeaderTextSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 20.0, 38, 18); - double limitedBodyTextSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14.0, 22, 12); + double limitedHeaderTextSize = LimitedFontSizeUtil.getCalculateFontSize(context, 18, 18, 16); + double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); return SafeArea( // top: true, - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - if (_model.isAccess == true && _model.key != null) - Text( - FFLocalizations.of(context).getVariableText( - ptText: 'Use esse QR Code para acesso', - enText: 'Use this QR Code for access', - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, - fontSize: limitedHeaderTextSize, - letterSpacing: 0.0, - fontWeight: FontWeight.bold, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - - ), - ), - Stack( + child: Center( + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ if (_model.isAccess == true && _model.key != null) - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: InkWell( - onTap: () async { - safeSetState(() async { - _resetAnimationAndToggleAccess(); - }); - - _model.isFingerprint - ? await _showBiometricsAuth(context) - : await _showQrCodeBottomSheet(context); - }, - child: _model.buildQrCode( - dimension: dimension, - errorCorrectLevel: QrErrorCorrectLevel.M, - identifier: _model.userDevUUID, - pass: _model.key!, - direction: 5, + Padding( + padding: const EdgeInsets.fromLTRB(0, 0, 0 , 20), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Use esse QR Code para acesso', + enText: 'Use this QR Code for access', ), + textAlign: TextAlign.center, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + fontSize: limitedHeaderTextSize, + letterSpacing: 0.0, + fontWeight: FontWeight.bold, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyMediumFamily), + + ), ), ), - if (_model.isAccess == false && _model.key == null) - Align( - alignment: const AlignmentDirectional(0, 0), - child: BarcodeWidget( - data: 'Barcode', - barcode: Barcode.qrCode(), - width: 300.0, - height: 200.0, - color: FlutterFlowTheme.of(context).primaryText, - backgroundColor: Colors.transparent, - errorBuilder: (context, error) => const SizedBox( - width: 300.0, - height: 200.0, + Stack( + children: [ + if (_model.isAccess == true && _model.key != null) + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: InkWell( + onTap: () async { + safeSetState(() async { + _resetAnimationAndToggleAccess(); + }); + + _model.isFingerprint + ? await _showBiometricsAuth(context) + : await _showQrCodeBottomSheet(context); + }, + child: _model.buildQrCode( + dimension: dimension, + errorCorrectLevel: QrErrorCorrectLevel.M, + identifier: _model.userDevUUID, + pass: _model.key!, + direction: 5, + ), + ), ), - drawText: false, - ).animateOnActionTrigger( - animationsMap['barcodeOnActionTriggerAnimation']!, - ), - ), - if (_model.isAccess == false && _model.key == null) - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onLongPress: () async { - await _model.qrCodeEncoder( - context, - key: _model.key, - ); - setState(() {}); - }, - child: Container( - width: 200.0, - height: 200.0, - decoration: const BoxDecoration(), - child: Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: FFButtonWidget( - onPressed: () async { - _model.isFingerprint - ? await _showBiometricsAuth(context) - : await _showQrCodeBottomSheet(context); - }, - text: FFLocalizations.of(context).getVariableText( - ptText: 'Gerar QR Code', - enText: 'Generate QR Code', - ), - options: FFButtonOptions( - height: 40.0, - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).primary, - textStyle: FlutterFlowTheme.of(context) - .titleSmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .titleSmallFamily, - color: Colors.white, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey(FlutterFlowTheme.of(context) - .titleSmallFamily), - fontSize: LimitedTextSizeUtil.getNoResizeFont(context, 14), + if (_model.isAccess == false && _model.key == null) + Align( + alignment: const AlignmentDirectional(0, 0), + child: BarcodeWidget( + data: 'Barcode', + barcode: Barcode.qrCode(), + width: 300.0, + height: 200.0, + color: FlutterFlowTheme.of(context).primaryText, + backgroundColor: Colors.transparent, + errorBuilder: (context, error) => const SizedBox( + width: 300.0, + height: 200.0, + ), + drawText: false, + ).animateOnActionTrigger( + animationsMap['barcodeOnActionTriggerAnimation']!, + ), + ), + if (_model.isAccess == false && _model.key == null) + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onLongPress: () async { + await _model.qrCodeEncoder( + context, + key: _model.key, + ); + setState(() {}); + }, + child: Container( + width: 200.0, + height: 200.0, + decoration: const BoxDecoration(), + child: Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: FFButtonWidget( + onPressed: () async { + _model.isFingerprint + ? await _showBiometricsAuth(context) + : await _showQrCodeBottomSheet(context); + }, + text: FFLocalizations.of(context).getVariableText( + ptText: 'Gerar QR Code', + enText: 'Generate QR Code', + ), + options: FFButtonOptions( + height: 40.0, + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context).primary, + textStyle: FlutterFlowTheme.of(context) + .titleSmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .titleSmallFamily, + color: Colors.white, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey(FlutterFlowTheme.of(context) + .titleSmallFamily), + fontSize: LimitedFontSizeUtil.getCalculateFontSize(context, 12, 12, 10), + ), + elevation: 3.0, + borderSide: const BorderSide( + color: Colors.transparent, + width: 1.0, ), - elevation: 3.0, - borderSide: const BorderSide( - color: Colors.transparent, - width: 1.0, + borderRadius: BorderRadius.circular(8.0), + ), ), - borderRadius: BorderRadius.circular(8.0), ), ), ), ), - ), - ), - ], - ), - if (_model.isAccess == true && _model.key != null) - Container( - width: 300.0, - decoration: const BoxDecoration(), - child: Visibility( - visible: _model.isAccess == true, - child: Text( - FFLocalizations.of(context).getVariableText( - ptText: - 'Certifique-se de que o QRCode está visivel para o leitor', - enText: 'Make sure the QRCode is visible to the reader', - // '6z6kvmhl' /* Certifique-se de que o QRCode ... */, - ), - style: FlutterFlowTheme.of(context).bodyMedium.override( - fontFamily: - FlutterFlowTheme.of(context).bodyMediumFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyMediumFamily), - fontSize: limitedBodyTextSize, - ), - ), + ], ), - ), - if (_model.isAccess == true && _model.key != null) - Container( - width: 250.0, - height: 80.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(100.0), - border: Border.all( - color: FlutterFlowTheme.of(context).primary, - ), - ), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 10.0, 0.0, 0.0, 0.0), + if (_model.isAccess == true && _model.key != null) + Padding( + padding: const EdgeInsets.fromLTRB(0, 20, 0, 0), + child: Container( + width: 300.0, + decoration: const BoxDecoration(), + child: Visibility( + visible: _model.isAccess == true, child: Text( FFLocalizations.of(context).getVariableText( - ptText: 'Expirando QR code em', - enText: 'Expiring QR code in', - // 'wkjkxd2e' /* Trocando QR code em */, + ptText: + 'Certifique-se de que o QRCode está visivel para o leitor', + enText: 'Make sure the QRCode is visible to the reader', + // '6z6kvmhl' /* Certifique-se de que o QRCode ... */, ), textAlign: TextAlign.center, style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, letterSpacing: 0.0, - fontWeight: FontWeight.w600, useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context) - .bodyMediumFamily), - fontSize: limitedBodyTextSize, + FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedBodyFontSize, ), ), ), ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 20.0, 0.0), - child: StreamBuilder( - stream: getProgressValue(), - builder: (context, snapshot) { - if (snapshot.connectionState == - ConnectionState.waiting) { - return const CircularProgressIndicator(); - } else if (snapshot.hasError) { - return Text('Error: ${snapshot.error}'); - } else if (!snapshot.hasData) { - return const Text('No data'); - } else { - final progress = snapshot.data!; - return CircularPercentIndicator( - percent: progress, - restartAnimation: true, - reverse: false, - radius: 30.0, - lineWidth: 7.0, - animation: true, - animateFromLastPercent: true, - onAnimationEnd: () { - _resetAnimationAndToggleAccess(); - }, - progressColor: - FlutterFlowTheme.of(context).primary, - backgroundColor: - FlutterFlowTheme.of(context).primaryText, - center: Text( - '${(progress * totalTimeInSeconds / 5).toStringAsFixed(1)}s', - style: FlutterFlowTheme.of(context) - .headlineSmall - .override( - fontFamily: FlutterFlowTheme.of(context) - .headlineSmallFamily, - fontSize: 14.0, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap() - .containsKey( - FlutterFlowTheme.of(context) - .headlineSmallFamily), - ), - ), - startAngle: 20.0, - ); - } - }, + ), + if (_model.isAccess == true && _model.key != null) + Padding( + padding: const EdgeInsets.fromLTRB(0, 20, 0, 20), + child: Container( + width: 250.0, + height: 80.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100.0), + border: Border.all( + color: FlutterFlowTheme.of(context).primary, ), ), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 10.0, 0.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getVariableText( + ptText: 'Expirando QR code em', + enText: 'Expiring QR code in', + // 'wkjkxd2e' /* Trocando QR code em */, + ), + textAlign: TextAlign.center, + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: + FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + fontWeight: FontWeight.w600, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context) + .bodyMediumFamily), + fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 14), + ), + ), + ), + ), + Align( + alignment: const AlignmentDirectional(0.0, 0.0), + child: Padding( + padding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 20.0, 0.0), + child: StreamBuilder( + stream: getProgressValue(), + builder: (context, snapshot) { + if (snapshot.connectionState == + ConnectionState.waiting) { + return const CircularProgressIndicator(); + } else if (snapshot.hasError) { + return Text('Error: ${snapshot.error}'); + } else if (!snapshot.hasData) { + return const Text('No data'); + } else { + final progress = snapshot.data!; + return CircularPercentIndicator( + percent: progress, + restartAnimation: true, + reverse: false, + radius: 30.0, + lineWidth: 7.0, + animation: true, + animateFromLastPercent: true, + onAnimationEnd: () { + _resetAnimationAndToggleAccess(); + }, + progressColor: + FlutterFlowTheme.of(context).primary, + backgroundColor: + FlutterFlowTheme.of(context).primaryText, + center: Text( + '${(progress * totalTimeInSeconds / 5).toStringAsFixed(1)}s', + style: FlutterFlowTheme.of(context) + .headlineSmall + .override( + fontFamily: FlutterFlowTheme.of(context) + .headlineSmallFamily, + fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 14), + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap() + .containsKey( + FlutterFlowTheme.of(context) + .headlineSmallFamily), + ), + ), + startAngle: 20.0, + ); + } + }, + ), + ), + ), + ], + ), ), - ], - ), - ), - ], + ), + ], + ), + ), ), ); } diff --git a/lib/pages/reception_page/reception_page_widget.dart b/lib/pages/reception_page/reception_page_widget.dart index e5eca1f6..8ff4618e 100644 --- a/lib/pages/reception_page/reception_page_widget.dart +++ b/lib/pages/reception_page/reception_page_widget.dart @@ -12,6 +12,7 @@ import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/reception_page/reception_page_model.dart'; import 'package:hub/shared/services/localization/localization_service.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/storage_util.dart'; import 'package:provider/provider.dart'; @@ -52,6 +53,10 @@ class _ReceptionPageWidgetState extends State with WidgetsB @override Widget build(BuildContext context) { + double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); + double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); + double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); + StorageUtil().context = context; return ChangeNotifierProvider( create: (context) => ReceptionPageModel(), @@ -66,7 +71,7 @@ class _ReceptionPageWidgetState extends State with WidgetsB mainAxisSize: MainAxisSize.max, children: [ Padding( - padding: const EdgeInsets.fromLTRB(45, 0, 45, 15.0), + padding: const EdgeInsets.fromLTRB(45, 20, 45, 15.0), child: Text( FFLocalizations.of(context).getVariableText( ptText: @@ -79,7 +84,7 @@ class _ReceptionPageWidgetState extends State with WidgetsB .override( fontFamily: 'Plus Jakarta Sans', color: FlutterFlowTheme.of(context).accent1, - fontSize: 20.0, + fontSize: limitedHeaderFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w700, useGoogleFonts: GoogleFonts.asMap() @@ -90,7 +95,7 @@ class _ReceptionPageWidgetState extends State with WidgetsB const AtomImageSvgTheme( filename: 'reception', width: 180, height: 180), Padding( - padding: const EdgeInsets.fromLTRB(70, 30, 70.0, 60), + padding: const EdgeInsets.fromLTRB(70, 30, 70.0, 40), child: Text( FFLocalizations.of(context).getVariableText( ptText: @@ -103,7 +108,7 @@ class _ReceptionPageWidgetState extends State with WidgetsB .override( fontFamily: 'Nunito Sans', color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, + fontSize: limitedBodyFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w600, useGoogleFonts: GoogleFonts.asMap() @@ -128,7 +133,7 @@ class _ReceptionPageWidgetState extends State with WidgetsB fontFamily: 'Nunito Sans', color: FlutterFlowTheme.of(context) .secondaryText, - fontSize: 10.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() @@ -142,7 +147,7 @@ class _ReceptionPageWidgetState extends State with WidgetsB enText: 'My Identifier'), options: FFButtonOptions( width: double.infinity, - height: 44.0, + height:30, padding: const EdgeInsetsDirectional.fromSTEB( 0.0, 0.0, 0.0, 0.0), iconPadding: @@ -155,7 +160,7 @@ class _ReceptionPageWidgetState extends State with WidgetsB fontFamily: 'Nunito Sans', color: FlutterFlowTheme.of(context).info, - fontSize: 14.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() @@ -173,7 +178,7 @@ class _ReceptionPageWidgetState extends State with WidgetsB ), ), Padding( - padding: const EdgeInsets.fromLTRB(60, 0, 60, 0), + padding: const EdgeInsets.fromLTRB(60, 0, 60, 25), child: FFButtonWidget( onPressed: () async { PhpGroup.unregisterDevice(); @@ -196,7 +201,7 @@ class _ReceptionPageWidgetState extends State with WidgetsB ptText: 'Sair da Conta', enText: 'Logout'), options: FFButtonOptions( width: double.infinity, - height: 44.0, + height: 30, padding: const EdgeInsetsDirectional.fromSTEB( 0.0, 0.0, 0.0, 0.0), iconPadding: @@ -210,7 +215,7 @@ class _ReceptionPageWidgetState extends State with WidgetsB fontFamily: 'Nunito Sans', color: FlutterFlowTheme.of(context) .primaryBackground, - fontSize: 14.0, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w500, useGoogleFonts: GoogleFonts.asMap() diff --git a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart index ff57d52b..42c75e7e 100644 --- a/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart +++ b/lib/pages/schedule_complete_visit_page/schedule_complete_visit_page_model.dart @@ -506,7 +506,7 @@ class ScheduleCompleteVisitPageModel elevation: 0, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, - fontSize: LimitedTextSizeUtil.getNoResizeFont(context, 14), + fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 14), ), borderSide: BorderSide( color: FlutterFlowTheme.of(context).primaryBackground, @@ -542,7 +542,7 @@ class ScheduleCompleteVisitPageModel elevation: 0, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, - fontSize: LimitedTextSizeUtil.getNoResizeFont(context, 14), + fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 14), ), borderSide: BorderSide( color: FlutterFlowTheme.of(context).primaryBackground, @@ -578,7 +578,7 @@ URL do Convite: https://visita.freaccess.com.br/${item['VAW_ID']}/$cliUUID/${ite elevation: 0, textStyle: TextStyle( color: FlutterFlowTheme.of(context).primaryText, - fontSize: LimitedTextSizeUtil.getNoResizeFont(context, 14), + fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 14), ), borderSide: BorderSide( color: FlutterFlowTheme.of(context).primaryBackground, 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 69c0af52..e3c786cd 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 @@ -147,7 +147,7 @@ class _ScheduleCompleteVisitPageWidgetState style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).primaryText, - fontSize: 15.0, + fontSize: LimitedFontSizeUtil.getHeaderFontSize(context), letterSpacing: 0.0, fontWeight: FontWeight.bold, useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), @@ -171,8 +171,7 @@ class _ScheduleCompleteVisitPageWidgetState unselectedLabelColor: FlutterFlowTheme.of(context).primaryText, labelStyle: FlutterFlowTheme.of(context).titleMedium.override( fontFamily: FlutterFlowTheme.of(context).titleMediumFamily, - fontSize: LimitedTextSizeUtil.getLimitedBodyFontSize( - context, 12.0, 16.0, 10.0), + fontSize: LimitedFontSizeUtil.getBodyFontSize(context), letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).titleMediumFamily), @@ -224,8 +223,9 @@ class _ScheduleCompleteVisitPageWidgetState final textScaler = MediaQuery.textScalerOf(context); final double baseFontSize = 12.0; final double scaledFontSize = baseFontSize * textScaler.scale(1); - final double limitedFontSize = LimitedTextSizeUtil.getLimitedBodyFontSize( - context, 12, 12, 10.0); + final double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); + final double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); + final double limitedSubHeaderFontSize = LimitedFontSizeUtil.getSubHeaderFontSize(context); final double scaledSizedBoxSize = scaledFontSize > 16.0 ? 100 : 80; return SingleChildScrollView( @@ -257,6 +257,7 @@ class _ScheduleCompleteVisitPageWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), + fontSize: limitedSubHeaderFontSize, ), ), ), @@ -293,7 +294,7 @@ class _ScheduleCompleteVisitPageWidgetState .containsKey( FlutterFlowTheme.of(context) .labelMediumFamily), - fontSize: limitedFontSize, + fontSize: limitedInputFontSize, ), hintText: FFLocalizations.of(context).getText( @@ -313,7 +314,7 @@ class _ScheduleCompleteVisitPageWidgetState FlutterFlowTheme.of(context) .labelMediumFamily), lineHeight: 1.0, - fontSize: limitedFontSize, + fontSize: limitedInputFontSize, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -339,6 +340,12 @@ class _ScheduleCompleteVisitPageWidgetState ), borderRadius: BorderRadius.circular(8.0), ), + errorStyle: TextStyle( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context).error, + fontSize: limitedInputFontSize, + ), focusedErrorBorder: OutlineInputBorder( borderSide: BorderSide( color: @@ -364,7 +371,7 @@ class _ScheduleCompleteVisitPageWidgetState FlutterFlowTheme.of(context) .bodyMediumFamily), lineHeight: 1.8, - fontSize: limitedFontSize, + fontSize: limitedInputFontSize, ), textAlign: TextAlign.start, validator: model.textController1Validator @@ -552,7 +559,7 @@ class _ScheduleCompleteVisitPageWidgetState .containsKey( FlutterFlowTheme.of(context) .labelMediumFamily), - fontSize: limitedFontSize, + fontSize: limitedInputFontSize, ), hintText: FFLocalizations.of(context).getText( 'xpgc5e8d', @@ -570,7 +577,7 @@ class _ScheduleCompleteVisitPageWidgetState FlutterFlowTheme.of(context) .labelMediumFamily), lineHeight: 1.0, - fontSize: limitedFontSize, + fontSize: limitedInputFontSize, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -580,6 +587,12 @@ class _ScheduleCompleteVisitPageWidgetState ), borderRadius: BorderRadius.circular(8.0), ), + errorStyle: TextStyle( + fontFamily: FlutterFlowTheme.of(context) + .bodyMediumFamily, + color: FlutterFlowTheme.of(context).error, + fontSize: limitedInputFontSize, + ), focusedBorder: OutlineInputBorder( borderSide: BorderSide( color: @@ -618,7 +631,7 @@ class _ScheduleCompleteVisitPageWidgetState FlutterFlowTheme.of(context) .bodyMediumFamily), lineHeight: 1.8, - fontSize: limitedFontSize, + fontSize: limitedInputFontSize, ), textAlign: TextAlign.start, validator: model.textController2Validator @@ -654,7 +667,7 @@ class _ScheduleCompleteVisitPageWidgetState fontFamily: FlutterFlowTheme.of(context) .headlineLargeFamily, - fontSize: limitedFontSize, + fontSize: limitedInputFontSize, letterSpacing: 0.0, fontWeight: FontWeight.w600, useGoogleFonts: GoogleFonts @@ -800,6 +813,7 @@ class _ScheduleCompleteVisitPageWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), + fontSize: limitedSubHeaderFontSize, ), ), ), @@ -996,7 +1010,7 @@ class _ScheduleCompleteVisitPageWidgetState .titleSmallFamily, color: FlutterFlowTheme.of(context) .primaryText, - fontSize: limitedFontSize, + fontSize: limitedInputFontSize, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap() .containsKey( @@ -1037,6 +1051,7 @@ class _ScheduleCompleteVisitPageWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), + fontSize: limitedSubHeaderFontSize, ), ), ), @@ -1106,7 +1121,7 @@ class _ScheduleCompleteVisitPageWidgetState FlutterFlowTheme.of( context) .bodyMediumFamily), - fontSize: limitedFontSize, + fontSize: limitedInputFontSize, ), hintText: FFLocalizations.of(context).getVariableText(enText: 'Reason for Visit', ptText: 'Motivo da Visita' @@ -1157,7 +1172,7 @@ class _ScheduleCompleteVisitPageWidgetState style: TextStyle( color: FlutterFlowTheme.of(context) .customColor6, - fontSize: limitedFontSize)), + fontSize: limitedInputFontSize)), ), ), ], @@ -1226,7 +1241,7 @@ class _ScheduleCompleteVisitPageWidgetState FlutterFlowTheme.of( context) .bodyMediumFamily), - fontSize: limitedFontSize, + fontSize: limitedInputFontSize, ), hintText: FFLocalizations.of(context).getVariableText( @@ -1280,7 +1295,7 @@ class _ScheduleCompleteVisitPageWidgetState style: TextStyle( color: FlutterFlowTheme.of(context) .customColor6, - fontSize: limitedFontSize)), + fontSize: limitedInputFontSize)), ), ), ], @@ -1312,6 +1327,7 @@ class _ScheduleCompleteVisitPageWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), + fontSize: limitedSubHeaderFontSize, ), ), ), @@ -1340,7 +1356,7 @@ class _ScheduleCompleteVisitPageWidgetState .containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), - fontSize: limitedFontSize, + fontSize: limitedInputFontSize, ), ), ), @@ -1414,6 +1430,7 @@ class _ScheduleCompleteVisitPageWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), + fontSize: limitedBodyFontSize, ), ), ), @@ -1446,7 +1463,7 @@ class _ScheduleCompleteVisitPageWidgetState useGoogleFonts: GoogleFonts.asMap() .containsKey(FlutterFlowTheme.of(context) .labelMediumFamily), - fontSize: limitedFontSize, + fontSize: limitedInputFontSize, ), hintText: FFLocalizations.of(context).getText( 'w18iztdm', @@ -1462,7 +1479,7 @@ class _ScheduleCompleteVisitPageWidgetState useGoogleFonts: GoogleFonts.asMap() .containsKey(FlutterFlowTheme.of(context) .labelMediumFamily), - fontSize: limitedFontSize, + fontSize: limitedInputFontSize, ), enabledBorder: OutlineInputBorder( borderSide: BorderSide( @@ -1507,7 +1524,7 @@ class _ScheduleCompleteVisitPageWidgetState useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), - fontSize: limitedFontSize, + fontSize: limitedInputFontSize, ), textAlign: TextAlign.start, maxLines: null, @@ -1687,13 +1704,13 @@ class _ScheduleCompleteVisitPageWidgetState } : null, options: FFButtonOptions( - height: 40, + height: 30 * MediaQuery.textScalerOf(context).scale(1), width: MediaQuery.of(context).size.width * 0.5, color: FlutterFlowTheme.of(context).primary, textStyle: FlutterFlowTheme.of(context).subtitle2.override( fontFamily: 'Nunito', color: FlutterFlowTheme.of(context).primaryBackground, - fontSize: 18.0 / MediaQuery.textScalerOf(context).scale(1), + fontSize: limitedInputFontSize, fontWeight: FontWeight.w500, ), borderRadius: const BorderRadius.only( diff --git a/lib/pages/schedule_complete_visit_page/visit_history_page_widget.dart b/lib/pages/schedule_complete_visit_page/visit_history_page_widget.dart index db2b434d..a1038248 100644 --- a/lib/pages/schedule_complete_visit_page/visit_history_page_widget.dart +++ b/lib/pages/schedule_complete_visit_page/visit_history_page_widget.dart @@ -129,7 +129,7 @@ class _VisitHistoryWidgetState extends State @override Widget build(BuildContext context) { - double limitedTextSize = LimitedTextSizeUtil.getLimitedBodyFontSize(context, 14, 24, 12); + double limitedHeaderFontSize = LimitedFontSizeUtil.getHeaderFontSize(context); return Column( mainAxisSize: MainAxisSize.max, @@ -147,7 +147,7 @@ class _VisitHistoryWidgetState extends State enText: "No visit found"), style: TextStyle( color: FlutterFlowTheme.of(context).primaryText, - fontSize: limitedTextSize, + fontSize: limitedHeaderFontSize, fontWeight: FontWeight.bold ) ), diff --git a/lib/shared/components/atoms/atom_terms_of_use.dart b/lib/shared/components/atoms/atom_terms_of_use.dart index e1f29b9b..3c3cf090 100644 --- a/lib/shared/components/atoms/atom_terms_of_use.dart +++ b/lib/shared/components/atoms/atom_terms_of_use.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import '../../../flutter_flow/flutter_flow_theme.dart'; import '../../../flutter_flow/flutter_flow_util.dart'; @@ -24,7 +25,8 @@ class AtomTermsOfUse extends StatelessWidget { color: FlutterFlowTheme.of(context) .primaryText, - fontSize: 14.0, + fontSize: LimitedFontSizeUtil.getInputFontSize( + context), letterSpacing: 0.0, useGoogleFonts: GoogleFonts .asMap() diff --git a/lib/shared/utils/dialog_util.dart b/lib/shared/utils/dialog_util.dart index 24fe1a78..6804443a 100644 --- a/lib/shared/utils/dialog_util.dart +++ b/lib/shared/utils/dialog_util.dart @@ -28,7 +28,6 @@ class DialogUtil { context: context, builder: (context) { return Dialog( - child: SizedBox( height: _height, child: Padding( diff --git a/lib/shared/utils/limited_text_size.dart b/lib/shared/utils/limited_text_size.dart index 28f3c527..e0771033 100644 --- a/lib/shared/utils/limited_text_size.dart +++ b/lib/shared/utils/limited_text_size.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; -class LimitedTextSizeUtil { - static double getLimitedBodyFontSize(BuildContext context, double baseFontSize, double maxFontSize, double limitedFontSize) { +class LimitedFontSizeUtil { + static double getCalculateFontSize(BuildContext context, double baseFontSize, double maxFontSize, double limitedFontSize) { final textScaler = MediaQuery.textScalerOf(context); final double scaledFontSize = baseFontSize * textScaler.scale(1); return scaledFontSize > maxFontSize ? limitedFontSize : scaledFontSize; @@ -18,4 +18,28 @@ class LimitedTextSizeUtil { final double scaledFontSize = baseFontSize * textScaler.scale(1); return scaledFontSize > maxFontSize ? sizeIfExceeded : sizeIfNotExceeded; } + + static double getBodyFontSize(BuildContext context) { + final textScaler = MediaQuery.textScalerOf(context); + final double scaledFontSize = 12 * textScaler.scale(1); + return scaledFontSize > 12 ? 10 : scaledFontSize; + } + + static double getInputFontSize(BuildContext context) { + final textScaler = MediaQuery.textScalerOf(context); + final double scaledFontSize = 12 * textScaler.scale(1); + return scaledFontSize > 12 ? 10 : scaledFontSize; + } + + static double getHeaderFontSize(BuildContext context) { + final textScaler = MediaQuery.textScalerOf(context); + final double scaledFontSize = 16 * textScaler.scale(1); + return scaledFontSize > 16 ? 14 : scaledFontSize; + } + + static double getSubHeaderFontSize(BuildContext context) { + final textScaler = MediaQuery.textScalerOf(context); + final double scaledFontSize = 14 * textScaler.scale(1); + return scaledFontSize > 14 ? 12 : scaledFontSize; + } } \ No newline at end of file From 33a8b614bc90042d50aa203517e4c88e7be30472 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 7 Nov 2024 18:02:17 -0300 Subject: [PATCH 6/7] Ajuste no merge que eu fiz errado --- lib/pages/home_page/home_page_widget.dart | 7 +++---- lib/pages/reception_page/reception_page_widget.dart | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index 7bcbd60d..9733580d 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -20,7 +20,7 @@ class HomePageWidget extends StatefulWidget { } class _HomePageWidgetState extends State { - late HomePageModel _model; + late HomePageModel _model; final scaffoldKey = GlobalKey(); late LocalProfileComponentWidget _localProfileComponentWidget; @@ -35,8 +35,6 @@ class _HomePageWidgetState extends State { _model.dispose(); } - @override - void initState() { @override void initState() { super.initState(); @@ -50,6 +48,7 @@ class _HomePageWidgetState extends State { _model.textFieldFocusNode ??= FocusNode(); } + @override Widget build(BuildContext context) { StorageHelper().context = context; @@ -138,7 +137,7 @@ class _HomePageWidgetState extends State { ), ); } - + Widget buildBody() { return Container( color: FlutterFlowTheme.of(context).primaryBackground, diff --git a/lib/pages/reception_page/reception_page_widget.dart b/lib/pages/reception_page/reception_page_widget.dart index 2221ee17..7a5ff99b 100644 --- a/lib/pages/reception_page/reception_page_widget.dart +++ b/lib/pages/reception_page/reception_page_widget.dart @@ -60,7 +60,7 @@ class _ReceptionPageWidgetState extends State with WidgetsB double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); double limitedInputFontSize = LimitedFontSizeUtil.getInputFontSize(context); - StorageUtil().context = context; + StorageHelper().context = context; return ChangeNotifierProvider( create: (context) => ReceptionPageModel(), child: Scaffold( From 120b9d7116c78034c2f5623cebc64bc036103544 Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 8 Nov 2024 11:47:17 -0300 Subject: [PATCH 7/7] Feat: Ajuste nas SnackBar --- .../shared_components_atoms/custom_input.dart | 1 + .../shared_components_atoms/toast.dart | 3 +- ..._arrow_linked_locals_component_widget.dart | 4 +- ...iter_vistor_template_component_widget.dart | 1 + ...earch_modal_template_component_widget.dart | 527 +++++++++--------- lib/flutter_flow/flutter_flow_util.dart | 1 + lib/flutter_flow/upload_data.dart | 7 +- .../acess_history_page_widget.dart | 2 + .../liberation_history_widget.dart | 5 + .../message_history_page_widget.dart | 4 + .../package_order_page.dart | 4 + lib/pages/pets_page/pets_history_screen.dart | 4 + .../schedule_complete_visit_page_widget.dart | 7 +- .../visit_history_page_widget.dart | 4 + lib/shared/utils/snackbar_util.dart | 5 +- 15 files changed, 305 insertions(+), 274 deletions(-) diff --git a/lib/components/atomic_components/shared_components_atoms/custom_input.dart b/lib/components/atomic_components/shared_components_atoms/custom_input.dart index 50f26559..51d0fbad 100644 --- a/lib/components/atomic_components/shared_components_atoms/custom_input.dart +++ b/lib/components/atomic_components/shared_components_atoms/custom_input.dart @@ -145,6 +145,7 @@ class _CustomInputUtilState extends State { useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).bodyMediumFamily, ), + fontSize: limitedInputTextSize, ), maxLines: null, maxLength: widget.haveMaxLength ? widget.maxLength : null, diff --git a/lib/components/atomic_components/shared_components_atoms/toast.dart b/lib/components/atomic_components/shared_components_atoms/toast.dart index aad47149..1be2a15e 100644 --- a/lib/components/atomic_components/shared_components_atoms/toast.dart +++ b/lib/components/atomic_components/shared_components_atoms/toast.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:fluttertoast/fluttertoast.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; class ToastUtil { static void showToast({ @@ -8,7 +9,7 @@ class ToastUtil { Toast toastLength = Toast.LENGTH_SHORT, Color backgroundColor = Colors.black, Color textColor = Colors.white, - double fontSize = 16.0, + double fontSize = 16, }) { Fluttertoast.showToast( msg: message, diff --git a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart index 8712ddd3..6ee4b9ee 100644 --- a/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart +++ b/lib/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart @@ -6,6 +6,7 @@ import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/shared/helpers/base_storage.dart'; import 'package:hub/shared/helpers/storage_helper.dart'; import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/log_util.dart'; import '../../../shared/services/authentication/authentication_service.dart'; @@ -52,7 +53,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State e).toList(); - final doc = _model.docs.map((e) => e).toList(); - return ListView.builder( - padding: EdgeInsets.zero, - scrollDirection: Axis.vertical, - itemCount: visitor.length, - itemBuilder: (context, visitorIndex) { - final visitorItem = visitor[visitorIndex]; - final docItem = doc[visitorIndex]; - return Padding( - padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 1.0), - child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - child: Container( - width: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - ClipRRect( - borderRadius: BorderRadius.circular(40.0), - child: CachedNetworkImage( - fadeInDuration: const Duration(milliseconds: 500), - fadeOutDuration: const Duration(milliseconds: 500), - imageUrl: - "https://freaccess.com.br/freaccess/getImage.php?devUUID=${_model.devUUID}&userUUID=${_model.userUUID}&cliID=${_model.cliUUID}&atividade=getFoto&Documento=${getJsonField( - visitorItem, - r'''$.VTE_DOCUMENTO''', - ).toString()}&tipo=E", - width: 60.0, - height: 60.0, - fit: BoxFit.cover, - ), - ), - Expanded( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), - child: Text( - valueOrDefault( - getJsonField(visitorItem, r'''$.VTE_NOME''')?.toString(), - 'NOT FOUND', - ), - style: FlutterFlowTheme.of(context).bodyLarge.override( - fontFamily: FlutterFlowTheme.of(context).bodyLargeFamily, - letterSpacing: 0.0, - useGoogleFonts: GoogleFonts.asMap().containsKey( - FlutterFlowTheme.of(context).bodyLargeFamily), - fontSize: limitedBodyFontSize, - ), - ), - ), - ], - ), - ), - FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon(Icons.close, - color: FlutterFlowTheme.of(context).customColor6, size: 20.0), - onPressed: () async { - _model.removeFromVisitors(visitorItem); - _model.removeFromDocs(docItem); - safeSetState(() {}); - }, - ), - ], - ), - ), - ), - ), - ); - }, - ); - }, - ), - ); - } else { - return Container( - width: 100.0, - height: 100.0, - decoration: BoxDecoration(color: FlutterFlowTheme.of(context).primaryBackground), - ); - } - }, - ), + keyboardType: const TextInputType.numberWithOptions(signed: true), + validator: _model.textControllerValidator.asValidator(context), + inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9]'))], ), + ), + if (_model.visitors.isNotEmpty && _model.visitors.isNotEmpty) Row( - mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, children: [ - FFButtonWidget( - onPressed: MediaQuery.of(context).viewInsets.bottom > 0 - ? () async => await addVisitor(context).whenComplete(safeSetState(() {})) - : () async => await sendVisitors(context), - text: MediaQuery.of(context).viewInsets.bottom > 0 - ? FFLocalizations.of(context).getVariableText( - enText: 'Add', - ptText: 'Adicionar', - ) - : FFLocalizations.of(context).getVariableText( - enText: 'Submit', - ptText: 'Enviar', - ), - options: FFButtonOptions( - width: MediaQuery.of(context).size.width * 0.4, - height: 40, - padding: const EdgeInsetsDirectional.fromSTEB( - 24.0, 0.0, 24.0, 0.0), - iconPadding: const EdgeInsetsDirectional.fromSTEB( - 0.0, 0.0, 0.0, 0.0), - color: FlutterFlowTheme.of(context).primary, - textStyle: FlutterFlowTheme.of(context).titleSmall.override( - fontFamily: FlutterFlowTheme.of(context).titleSmallFamily, - color: Colors.white, + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 0.0, 0.0), + child: Text( + FFLocalizations.of(context).getText('9coywebh'), + style: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: FlutterFlowTheme.of(context).labelMediumFamily, + color: FlutterFlowTheme.of(context).primaryText, letterSpacing: 0.0, useGoogleFonts: - GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily), - fontSize: limitedInputFontSize, + GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).labelMediumFamily), + fontSize: limitedHeaderFontSize, + ), + ), + ), + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(4.0, 12.0, 16.0, 0.0), + child: Text( + _model.visitors.length.toString(), + style: FlutterFlowTheme.of(context).bodyMedium.override( + fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily, + letterSpacing: 0.0, + useGoogleFonts: + GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily), + fontSize: limitedHeaderFontSize, ), - elevation: 3.0, - borderSide: const BorderSide(color: Colors.transparent, width: 1.0), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(15), - bottomRight: Radius.circular(15), - topLeft: Radius.circular(15), - topRight: Radius.circular(15)), ), ), ], ), - const SizedBox(height: 30.0) - ], - ), + Expanded( + child: Builder( + builder: (context) { + if (_model.visitors.isNotEmpty) { + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB(8.0, 8.0, 8.0, 0.0), + child: Builder( + builder: (context) { + final visitor = _model.visitors.map((e) => e).toList(); + final doc = _model.docs.map((e) => e).toList(); + return ListView.builder( + padding: EdgeInsets.zero, + scrollDirection: Axis.vertical, + itemCount: visitor.length, + itemBuilder: (context, visitorIndex) { + final visitorItem = visitor[visitorIndex]; + final docItem = doc[visitorIndex]; + return Padding( + padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 1.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + child: Container( + width: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(40.0), + child: CachedNetworkImage( + fadeInDuration: const Duration(milliseconds: 500), + fadeOutDuration: const Duration(milliseconds: 500), + imageUrl: + "https://freaccess.com.br/freaccess/getImage.php?devUUID=${_model.devUUID}&userUUID=${_model.userUUID}&cliID=${_model.cliUUID}&atividade=getFoto&Documento=${getJsonField( + visitorItem, + r'''$.VTE_DOCUMENTO''', + ).toString()}&tipo=E", + width: 60.0, + height: 60.0, + fit: BoxFit.cover, + ), + ), + Expanded( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0), + child: Text( + valueOrDefault( + getJsonField(visitorItem, r'''$.VTE_NOME''')?.toString(), + 'NOT FOUND', + ), + style: FlutterFlowTheme.of(context).bodyLarge.override( + fontFamily: FlutterFlowTheme.of(context).bodyLargeFamily, + letterSpacing: 0.0, + useGoogleFonts: GoogleFonts.asMap().containsKey( + FlutterFlowTheme.of(context).bodyLargeFamily), + fontSize: limitedBodyFontSize, + ), + ), + ), + ], + ), + ), + FlutterFlowIconButton( + borderRadius: 20.0, + borderWidth: 1.0, + buttonSize: 40.0, + icon: Icon(Icons.close, + color: FlutterFlowTheme.of(context).customColor6, size: 20.0), + onPressed: () async { + _model.removeFromVisitors(visitorItem); + _model.removeFromDocs(docItem); + safeSetState(() {}); + }, + ), + ], + ), + ), + ), + ), + ); + }, + ); + }, + ), + ); + } else { + return Container( + width: 100.0, + height: 100.0, + decoration: BoxDecoration(color: FlutterFlowTheme.of(context).primaryBackground), + ); + } + }, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + FFButtonWidget( + onPressed: MediaQuery.of(context).viewInsets.bottom > 0 + ? () async => await addVisitor(context).whenComplete(safeSetState(() {})) + : () async => await sendVisitors(context), + text: MediaQuery.of(context).viewInsets.bottom > 0 + ? FFLocalizations.of(context).getVariableText( + enText: 'Add', + ptText: 'Adicionar', + ) + : FFLocalizations.of(context).getVariableText( + enText: 'Submit', + ptText: 'Enviar', + ), + options: FFButtonOptions( + width: MediaQuery.of(context).size.width * 0.4, + height: 40, + padding: const EdgeInsetsDirectional.fromSTEB( + 24.0, 0.0, 24.0, 0.0), + iconPadding: const EdgeInsetsDirectional.fromSTEB( + 0.0, 0.0, 0.0, 0.0), + color: FlutterFlowTheme.of(context).primary, + textStyle: FlutterFlowTheme.of(context).titleSmall.override( + fontFamily: FlutterFlowTheme.of(context).titleSmallFamily, + color: Colors.white, + letterSpacing: 0.0, + useGoogleFonts: + GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).titleSmallFamily), + fontSize: limitedInputFontSize, + ), + elevation: 3.0, + borderSide: const BorderSide(color: Colors.transparent, width: 1.0), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(15), + bottomRight: Radius.circular(15), + topLeft: Radius.circular(15), + topRight: Radius.circular(15)), + ), + ), + ], + ), + const SizedBox(height: 30.0) + ], ), ); } @@ -381,7 +372,9 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State { SnackBar( content: Text( FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + style: TextStyle(color: Colors.white, fontSize: LimitedFontSizeUtil.getBodyFontSize(context),), ), duration: const Duration(seconds: 3), backgroundColor: FlutterFlowTheme.of(context).primary, diff --git a/lib/pages/liberation_history/liberation_history_widget.dart b/lib/pages/liberation_history/liberation_history_widget.dart index edaeae1b..89847e87 100644 --- a/lib/pages/liberation_history/liberation_history_widget.dart +++ b/lib/pages/liberation_history/liberation_history_widget.dart @@ -10,6 +10,7 @@ import 'package:hub/flutter_flow/flutter_flow_widgets.dart'; import 'package:hub/flutter_flow/nav/nav.dart'; import 'package:hub/pages/liberation_history/liberation_history_model.dart'; import 'package:hub/shared/utils/dialog_util.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import 'package:hub/shared/utils/log_util.dart'; import 'package:hub/shared/utils/validator_util.dart'; @@ -347,6 +348,10 @@ class _LiberationHistoryWidgetState extends State { SnackBar( content: Text( FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + style: TextStyle( + color: Colors.white, + fontSize: LimitedFontSizeUtil.getBodyFontSize(context), + ), ), duration: const Duration(seconds: 3), backgroundColor: FlutterFlowTheme.of(context).primary, diff --git a/lib/pages/message_history_page/message_history_page_widget.dart b/lib/pages/message_history_page/message_history_page_widget.dart index 2d5a19bc..345842d5 100644 --- a/lib/pages/message_history_page/message_history_page_widget.dart +++ b/lib/pages/message_history_page/message_history_page_widget.dart @@ -275,6 +275,10 @@ class _MessageHistoryPageWidgetState extends State wit SnackBar( content: Text( FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + style: TextStyle( + color: Colors.white, + fontSize: LimitedFontSizeUtil.getBodyFontSize(context), + ), ), duration: const Duration(seconds: 3), backgroundColor: FlutterFlowTheme.of(context).primary, diff --git a/lib/pages/package_order_page/package_order_page.dart b/lib/pages/package_order_page/package_order_page.dart index 7d457847..4f42294b 100644 --- a/lib/pages/package_order_page/package_order_page.dart +++ b/lib/pages/package_order_page/package_order_page.dart @@ -80,6 +80,10 @@ class _PackageOrderPage extends State { SnackBar( content: Text( FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + style: TextStyle( + color: Colors.white, + fontSize: LimitedFontSizeUtil.getBodyFontSize(context), + ), ), duration: const Duration(seconds: 3), backgroundColor: FlutterFlowTheme.of(context).primary, diff --git a/lib/pages/pets_page/pets_history_screen.dart b/lib/pages/pets_page/pets_history_screen.dart index 4982a515..bcd69dfc 100644 --- a/lib/pages/pets_page/pets_history_screen.dart +++ b/lib/pages/pets_page/pets_history_screen.dart @@ -105,6 +105,10 @@ class _PetsHistoryScreenState extends State with TickerProvid SnackBar( content: Text( FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + style: TextStyle( + color :Colors.white, + fontSize: LimitedFontSizeUtil.getBodyFontSize(context), + ), ), duration: const Duration(seconds: 3), backgroundColor: FlutterFlowTheme.of(context).primary, 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 678724cc..6777162f 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 @@ -906,8 +906,7 @@ class _ScheduleCompleteVisitPageWidgetState extends State with TickerProv SnackBar( content: Text( FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."), + style: TextStyle( + color: Colors.white, + fontSize: LimitedFontSizeUtil.getBodyFontSize(context), + ), ), duration: const Duration(seconds: 3), backgroundColor: FlutterFlowTheme.of(context).primary, diff --git a/lib/shared/utils/snackbar_util.dart b/lib/shared/utils/snackbar_util.dart index 27150db6..21c43566 100644 --- a/lib/shared/utils/snackbar_util.dart +++ b/lib/shared/utils/snackbar_util.dart @@ -1,14 +1,17 @@ import 'package:flutter/material.dart'; +import 'package:hub/shared/utils/limited_text_size.dart'; import '../../flutter_flow/flutter_flow_theme.dart'; class SnackBarUtil { static void showSnackBar(BuildContext context, String text, {bool isError = false}) { + double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( text, - style: TextStyle(color: FlutterFlowTheme.of(context).info), + overflow: TextOverflow.clip, + style: TextStyle(color: FlutterFlowTheme.of(context).info, fontSize: limitedBodyFontSize), ), backgroundColor: isError ? FlutterFlowTheme.of(context).error : FlutterFlowTheme.of(context).success, duration: const Duration(seconds: 3),