From c22e1bff5e9f5c3a4eac4ebb92e5141dfa0b305d Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 1 Nov 2024 09:39:09 -0300 Subject: [PATCH] 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, + ); + } +}