Feat: Ajuste na responsividade da tela de Welcome, Login, Registe e Forgot Password
This commit is contained in:
parent
4497df1b04
commit
c22e1bff5e
|
@ -1,7 +1,8 @@
|
||||||
{
|
{
|
||||||
"editor.quickSuggestions": {
|
"editor.quickSuggestions": {
|
||||||
"comments": "off",
|
"comments": "off",
|
||||||
"strings": "off",
|
"strings": "off",
|
||||||
"other": "off"
|
"other": "off"
|
||||||
}
|
},
|
||||||
|
"java.configuration.updateBuildConfiguration": "automatic"
|
||||||
}
|
}
|
|
@ -57,12 +57,12 @@ android {
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
coreLibraryDesugaringEnabled true
|
coreLibraryDesugaringEnabled true
|
||||||
sourceCompatibility JavaVersion.VERSION_18
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
targetCompatibility JavaVersion.VERSION_18
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = "18"
|
jvmTarget = "11"
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import 'package:easy_debounce/easy_debounce.dart';
|
import 'package:easy_debounce/easy_debounce.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
@ -53,173 +52,103 @@ class _ForgotPasswordTemplateComponentWidgetState
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Align(
|
return Align(
|
||||||
alignment: const AlignmentDirectional(0.0, 1.0),
|
alignment: const AlignmentDirectional(0.0, 1.0),
|
||||||
child: Container(
|
child: SingleChildScrollView(
|
||||||
width: double.infinity,
|
child: Container(
|
||||||
height: 300.0,
|
width: double.infinity,
|
||||||
constraints: const BoxConstraints(
|
constraints: const BoxConstraints(
|
||||||
maxWidth: 570.0,
|
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),
|
|
||||||
),
|
),
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
child: Column(
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
mainAxisSize: MainAxisSize.max,
|
borderRadius: const BorderRadius.only(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
bottomLeft: Radius.circular(0.0),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
bottomRight: Radius.circular(0.0),
|
||||||
children: [
|
topLeft: Radius.circular(15.0),
|
||||||
if (responsiveVisibility(
|
topRight: Radius.circular(15.0),
|
||||||
context: context,
|
),
|
||||||
phone: false,
|
),
|
||||||
tablet: false,
|
child: Padding(
|
||||||
))
|
padding: const EdgeInsets.fromLTRB(0, 25, 0, 25),
|
||||||
Padding(
|
child: Column(
|
||||||
padding:
|
mainAxisSize: MainAxisSize.max,
|
||||||
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 16.0, 8.0),
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
child: InkWell(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
key: const ValueKey<String>('BackButton'),
|
children: [
|
||||||
splashColor: Colors.transparent,
|
if (responsiveVisibility(
|
||||||
focusColor: Colors.transparent,
|
context: context,
|
||||||
hoverColor: Colors.transparent,
|
phone: false,
|
||||||
highlightColor: Colors.transparent,
|
tablet: false,
|
||||||
onTap: () async {
|
))
|
||||||
context.safePop();
|
Padding(
|
||||||
},
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
child: Row(
|
16.0, 0.0, 16.0, 8.0),
|
||||||
mainAxisSize: MainAxisSize.max,
|
child: InkWell(
|
||||||
children: [
|
key: const ValueKey<String>('BackButton'),
|
||||||
const Padding(
|
splashColor: Colors.transparent,
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(
|
focusColor: Colors.transparent,
|
||||||
0.0, 12.0, 0.0, 12.0),
|
hoverColor: Colors.transparent,
|
||||||
child: Icon(
|
highlightColor: Colors.transparent,
|
||||||
Icons.arrow_back_rounded,
|
onTap: () async {
|
||||||
color: Color(0xFF15161E),
|
context.safePop();
|
||||||
size: 24.0,
|
},
|
||||||
),
|
child: Row(
|
||||||
),
|
mainAxisSize: MainAxisSize.max,
|
||||||
Padding(
|
children: [
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(12.0, 0.0, 0.0, 0.0),
|
const Padding(
|
||||||
child: Text(
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
'',
|
0.0, 12.0, 0.0, 12.0),
|
||||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
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',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
color: const Color(0xFF15161E),
|
color: const Color(0xFF15161E),
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
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(
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
padding:
|
16.0, 4.0, 16.0, 4.0),
|
||||||
const EdgeInsetsDirectional.fromSTEB(16.0, 0.0, 0.0, 0.0),
|
child: Text(
|
||||||
child: Text(
|
FFLocalizations.of(context).getText(
|
||||||
FFLocalizations.of(context).getText('xxm3ajsy' /* ESQUECEU SUA SENHA? */),
|
'wu2f7yzo' /* Não se preucupe nós vamos te a... */),
|
||||||
style: FlutterFlowTheme.of(context).headlineMedium.override(
|
style: FlutterFlowTheme.of(context).labelMedium.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<String>('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(
|
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
|
@ -228,62 +157,147 @@ class _ForgotPasswordTemplateComponentWidgetState
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
.containsKey('Plus Jakarta Sans'),
|
.containsKey('Plus Jakarta Sans'),
|
||||||
),
|
),
|
||||||
maxLines: null,
|
|
||||||
keyboardType: TextInputType.emailAddress,
|
|
||||||
cursorColor: FlutterFlowTheme.of(context).primary,
|
|
||||||
validator: _model.emailAddressTextControllerValidator
|
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Form(
|
||||||
),
|
key: _model.formKey,
|
||||||
Align(
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
child: Padding(
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
|
|
||||||
child: FFButtonWidget(
|
|
||||||
key: const ValueKey<String>('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(
|
padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
0.0, 0.0, 0.0, 0.0),
|
16.0, 12.0, 16.0, 0.0),
|
||||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(
|
child: SizedBox(
|
||||||
0.0, 0.0, 0.0, 0.0),
|
width: double.infinity,
|
||||||
color: FlutterFlowTheme.of(context).primary,
|
child: TextFormField(
|
||||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
key: const ValueKey<String>('recoveryTextFormField'),
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
controller: _model.emailAddressTextController,
|
||||||
color: Colors.white,
|
focusNode: _model.emailAddressFocusNode,
|
||||||
fontSize: 16.0,
|
onChanged: (_) => EasyDebounce.debounce(
|
||||||
letterSpacing: 0.0,
|
'_model.emailAddressTextController',
|
||||||
fontWeight: FontWeight.w500,
|
const Duration(milliseconds: 500),
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
() => setState(() {}),
|
||||||
.containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
),
|
||||||
elevation: 3.0,
|
autofocus: true,
|
||||||
borderSide: const BorderSide(
|
autofillHints: const [AutofillHints.email],
|
||||||
color: Colors.transparent,
|
obscureText: false,
|
||||||
width: 1.0,
|
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<String>('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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -17,12 +17,16 @@ import 'sign_up_template_component_model.dart';
|
||||||
export 'sign_up_template_component_model.dart';
|
export 'sign_up_template_component_model.dart';
|
||||||
|
|
||||||
class SignUpTemplateComponentWidget extends StatefulWidget {
|
class SignUpTemplateComponentWidget extends StatefulWidget {
|
||||||
const SignUpTemplateComponentWidget({super.key, required this.toggleSignInPage});
|
const SignUpTemplateComponentWidget(
|
||||||
|
{super.key, required this.toggleSignInPage});
|
||||||
final Future Function()? toggleSignInPage;
|
final Future Function()? toggleSignInPage;
|
||||||
@override State<SignUpTemplateComponentWidget> createState() => _SignUpTemplateComponentWidgetState();
|
@override
|
||||||
|
State<SignUpTemplateComponentWidget> createState() =>
|
||||||
|
_SignUpTemplateComponentWidgetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentWidget> with TickerProviderStateMixin {
|
class _SignUpTemplateComponentWidgetState
|
||||||
|
extends State<SignUpTemplateComponentWidget> with TickerProviderStateMixin {
|
||||||
late SignUpTemplateComponentModel _model;
|
late SignUpTemplateComponentModel _model;
|
||||||
final animationsMap = <String, AnimationInfo>{};
|
final animationsMap = <String, AnimationInfo>{};
|
||||||
|
|
||||||
|
@ -137,48 +141,30 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(4.0),
|
padding: const EdgeInsets.all(20.0),
|
||||||
child: Container(
|
child: Expanded(
|
||||||
width: 669.0,
|
child: Align(
|
||||||
height: 112.0,
|
alignment: const AlignmentDirectional(0.0, -1.0),
|
||||||
decoration: BoxDecoration(
|
child: Padding(
|
||||||
borderRadius: BorderRadius.circular(16.0),
|
padding: const EdgeInsets.all(4.0),
|
||||||
),
|
child: Text(
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
FFLocalizations.of(context).getText(
|
||||||
child: Padding(
|
'49609olv' /* INSIRA SEU EMAIL E SENHA, VAMO... */,
|
||||||
padding: const EdgeInsets.all(20.0),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
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'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
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'),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -628,7 +614,9 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
context)
|
context)
|
||||||
.primaryBackground,
|
.primaryBackground,
|
||||||
suffixIcon: InkWell(
|
suffixIcon: InkWell(
|
||||||
key: const ValueKey<String>('passwordVisibilitySuffixIcon'),
|
key: const ValueKey<
|
||||||
|
String>(
|
||||||
|
'passwordVisibilitySuffixIcon'),
|
||||||
onTap: () => setState(
|
onTap: () => setState(
|
||||||
() => _model
|
() => _model
|
||||||
.passwordRegisterFormVisibility =
|
.passwordRegisterFormVisibility =
|
||||||
|
@ -683,24 +671,40 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
padding: const EdgeInsetsDirectional
|
padding: const EdgeInsetsDirectional
|
||||||
.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
key: const ValueKey<String>('SubmitButtonWidget'),
|
key: const ValueKey<String>(
|
||||||
|
'SubmitButtonWidget'),
|
||||||
onPressed: isFormInvalid()
|
onPressed: isFormInvalid()
|
||||||
? null
|
? null
|
||||||
: () async {
|
: () async {
|
||||||
var shouldSetState = false;
|
var shouldSetState = false;
|
||||||
_model.register = await AuthenticationService.signUp(context,
|
_model.register =
|
||||||
email: _model.emailRegisterFormTextController.text,
|
await AuthenticationService
|
||||||
name: _model.nameRegisterFormTextController.text,
|
.signUp(
|
||||||
passwd: _model.passwordRegisterFormTextController.text,
|
context,
|
||||||
device: StorageUtil().deviceType,
|
email: _model
|
||||||
|
.emailRegisterFormTextController
|
||||||
|
.text,
|
||||||
|
name: _model
|
||||||
|
.nameRegisterFormTextController
|
||||||
|
.text,
|
||||||
|
passwd: _model
|
||||||
|
.passwordRegisterFormTextController
|
||||||
|
.text,
|
||||||
|
device: StorageUtil()
|
||||||
|
.deviceType,
|
||||||
);
|
);
|
||||||
shouldSetState = true;
|
shouldSetState = true;
|
||||||
if (_model.register == true) await widget.toggleSignInPage?.call();
|
if (_model.register == true)
|
||||||
|
await widget
|
||||||
|
.toggleSignInPage
|
||||||
|
?.call();
|
||||||
else {
|
else {
|
||||||
if (shouldSetState) setState(() {});
|
if (shouldSetState)
|
||||||
|
setState(() {});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (shouldSetState) setState(() {});
|
if (shouldSetState)
|
||||||
|
setState(() {});
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(context)
|
text: FFLocalizations.of(context)
|
||||||
.getText(
|
.getText(
|
||||||
|
@ -755,12 +759,15 @@ class _SignUpTemplateComponentWidgetState extends State<SignUpTemplateComponentW
|
||||||
padding: const EdgeInsetsDirectional
|
padding: const EdgeInsetsDirectional
|
||||||
.fromSTEB(0.0, 12.0, 0.0, 12.0),
|
.fromSTEB(0.0, 12.0, 0.0, 12.0),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
key: const ValueKey<String>('toggleSignInPage'),
|
key: const ValueKey<String>(
|
||||||
|
'toggleSignInPage'),
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
hoverColor: Colors.transparent,
|
hoverColor: Colors.transparent,
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onTap: () async => await widget.toggleSignInPage?.call(),
|
onTap: () async => await widget
|
||||||
|
.toggleSignInPage
|
||||||
|
?.call(),
|
||||||
child: RichText(
|
child: RichText(
|
||||||
textScaler: MediaQuery.of(context)
|
textScaler: MediaQuery.of(context)
|
||||||
.textScaler,
|
.textScaler,
|
||||||
|
|
|
@ -26,7 +26,9 @@ class WelcomeTemplateComponentWidget extends StatefulWidget {
|
||||||
_WelcomeTemplateComponentWidgetState();
|
_WelcomeTemplateComponentWidgetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _WelcomeTemplateComponentWidgetState extends State<WelcomeTemplateComponentWidget> with TickerProviderStateMixin {
|
class _WelcomeTemplateComponentWidgetState
|
||||||
|
extends State<WelcomeTemplateComponentWidget>
|
||||||
|
with TickerProviderStateMixin {
|
||||||
late WelcomeTemplateComponentModel _model;
|
late WelcomeTemplateComponentModel _model;
|
||||||
final animationsMap = <String, AnimationInfo>{};
|
final animationsMap = <String, AnimationInfo>{};
|
||||||
|
|
||||||
|
@ -41,39 +43,38 @@ class _WelcomeTemplateComponentWidgetState extends State<WelcomeTemplateComponen
|
||||||
super.initState();
|
super.initState();
|
||||||
_model = createModel(context, () => WelcomeTemplateComponentModel());
|
_model = createModel(context, () => WelcomeTemplateComponentModel());
|
||||||
|
|
||||||
animationsMap.addAll(
|
animationsMap.addAll(<String, AnimationInfo>{
|
||||||
<String, AnimationInfo>{
|
'containerOnPageLoadAnimation': AnimationInfo(
|
||||||
'containerOnPageLoadAnimation': AnimationInfo(
|
trigger: AnimationTrigger.onPageLoad,
|
||||||
trigger: AnimationTrigger.onPageLoad,
|
effectsBuilder: () => [
|
||||||
effectsBuilder: () => [
|
VisibilityEffect(duration: 1.ms),
|
||||||
VisibilityEffect(duration: 1.ms),
|
FadeEffect(
|
||||||
FadeEffect(
|
curve: Curves.easeInOut,
|
||||||
curve: Curves.easeInOut,
|
delay: 0.0.ms,
|
||||||
delay: 0.0.ms,
|
duration: 300.0.ms,
|
||||||
duration: 300.0.ms,
|
begin: 0.0,
|
||||||
begin: 0.0,
|
end: 1.0,
|
||||||
end: 1.0,
|
),
|
||||||
),
|
MoveEffect(
|
||||||
MoveEffect(
|
curve: Curves.easeInOut,
|
||||||
curve: Curves.easeInOut,
|
delay: 0.0.ms,
|
||||||
delay: 0.0.ms,
|
duration: 300.0.ms,
|
||||||
duration: 300.0.ms,
|
begin: const Offset(0.0, 140.0),
|
||||||
begin: const Offset(0.0, 140.0),
|
end: const Offset(0.0, 0.0),
|
||||||
end: const Offset(0.0, 0.0),
|
),
|
||||||
),
|
ScaleEffect(
|
||||||
ScaleEffect(
|
curve: Curves.easeInOut,
|
||||||
curve: Curves.easeInOut,
|
delay: 0.0.ms,
|
||||||
delay: 0.0.ms,
|
duration: 300.0.ms,
|
||||||
duration: 300.0.ms,
|
begin: const Offset(0.9, 0.9),
|
||||||
begin: const Offset(0.9, 0.9),
|
end: const Offset(1.0, 1.0),
|
||||||
end: const Offset(1.0, 1.0),
|
),
|
||||||
),
|
TiltEffect(
|
||||||
TiltEffect(
|
curve: Curves.easeInOut,
|
||||||
curve: Curves.easeInOut,
|
delay: 0.0.ms,
|
||||||
delay: 0.0.ms,
|
duration: 300.0.ms,
|
||||||
duration: 300.0.ms,
|
begin: const Offset(-0.349, 0),
|
||||||
begin: const Offset(-0.349, 0),
|
end: const Offset(0, 0),
|
||||||
end: const Offset(0, 0),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -95,66 +96,56 @@ class _WelcomeTemplateComponentWidgetState extends State<WelcomeTemplateComponen
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Padding(
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
padding: const EdgeInsets.all(14.0),
|
||||||
child: SafeArea(
|
child: Column(
|
||||||
child: Container(
|
mainAxisSize: MainAxisSize.min,
|
||||||
width: 648.0,
|
children: [
|
||||||
height: 208.0,
|
Text(
|
||||||
decoration: BoxDecoration(
|
FFLocalizations.of(context)
|
||||||
borderRadius: BorderRadius.circular(16.0),
|
.getText('dsc9tuc8' /* UMA EXPERIÊCIA COMPLETA */),
|
||||||
|
textAlign: TextAlign.start,
|
||||||
|
style: FlutterFlowTheme.of(context).displaySmall.override(
|
||||||
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
|
fontSize: 24.0,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
|
.containsKey('Plus Jakarta Sans'),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
Align(
|
||||||
child: Align(
|
alignment: const AlignmentDirectional(0.0, -1.0),
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
child: Text(
|
||||||
child: Padding(
|
FFLocalizations.of(context).getText(
|
||||||
padding: const EdgeInsets.all(14.0),
|
'5bgqn16z' /* COM CONFORTO ONDE VOCÊ ESTIVER... */),
|
||||||
child: Column(
|
textAlign: TextAlign.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
style: FlutterFlowTheme.of(context).displaySmall.override(
|
||||||
children: [
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
Text( FFLocalizations.of(context).getText('dsc9tuc8' /* UMA EXPERIÊCIA COMPLETA */),
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
textAlign: TextAlign.start,
|
fontSize: 15.0,
|
||||||
style: FlutterFlowTheme.of(context)
|
letterSpacing: 0.0,
|
||||||
.displaySmall
|
fontWeight: FontWeight.w600,
|
||||||
.override(
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
.containsKey('Plus Jakarta Sans'),
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
fontSize: 24.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(0.0, -1.0),
|
|
||||||
child: Text(FFLocalizations.of(context).getText('5bgqn16z' /* COM CONFORTO ONDE VOCÊ ESTIVER... */),
|
|
||||||
textAlign: TextAlign.start,
|
|
||||||
style: FlutterFlowTheme.of(context)
|
|
||||||
.displaySmall
|
|
||||||
.override(
|
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
|
||||||
fontSize: 15.0,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey('Plus Jakarta Sans'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Padding(
|
||||||
width: 284.0,
|
padding: const EdgeInsets.fromLTRB(0, 25, 0, 0),
|
||||||
height: 200.0,
|
child: Container(
|
||||||
decoration: const BoxDecoration(),
|
width: 284.0,
|
||||||
child: ClipRRect(
|
height: 200.0,
|
||||||
borderRadius: BorderRadius.circular(0.0),
|
decoration: const BoxDecoration(),
|
||||||
child: const AtomImageSvgTheme(filename: 'welcome', width: 600, height: double.infinity),
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(0.0),
|
||||||
|
child: const AtomImageSvgTheme(
|
||||||
|
filename: 'welcome', width: 600, height: double.infinity),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Align(
|
Align(
|
||||||
|
@ -171,7 +162,7 @@ class _WelcomeTemplateComponentWidgetState extends State<WelcomeTemplateComponen
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
blurRadius: 0.0,
|
blurRadius: 0.0,
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
offset: Offset(0.0,0.0),
|
offset: Offset(0.0, 0.0),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
|
@ -187,23 +178,33 @@ class _WelcomeTemplateComponentWidgetState extends State<WelcomeTemplateComponen
|
||||||
children: [
|
children: [
|
||||||
Builder(
|
Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
if (MediaQuery.sizeOf(context).width < kBreakpointSmall ? true : false) {
|
if (MediaQuery.sizeOf(context).width <
|
||||||
|
kBreakpointSmall
|
||||||
|
? true
|
||||||
|
: false) {
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
padding:
|
||||||
|
const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0.0, 0.0, 0.0, 16.0),
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
key: const ValueKey<String>('toggleSignInPage'),
|
key: const ValueKey<String>(
|
||||||
|
'toggleSignInPage'),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await widget.toggleSignInPage?.call();
|
await widget.toggleSignInPage?.call();
|
||||||
},
|
},
|
||||||
text: FFLocalizations.of(context).getText( 'dynet730' /* Entrar */),
|
text: FFLocalizations.of(context)
|
||||||
|
.getText('dynet730' /* Entrar */),
|
||||||
options: FFButtonOptions(
|
options: FFButtonOptions(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 44.0,
|
height: 44.0,
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
padding: const EdgeInsetsDirectional
|
||||||
iconPadding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 0.0),
|
.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)
|
color: FlutterFlowTheme.of(context)
|
||||||
.primary,
|
.primary,
|
||||||
textStyle: FlutterFlowTheme.of(
|
textStyle: FlutterFlowTheme.of(
|
||||||
|
@ -297,10 +298,9 @@ class _WelcomeTemplateComponentWidgetState extends State<WelcomeTemplateComponen
|
||||||
padding: const EdgeInsetsDirectional
|
padding: const EdgeInsetsDirectional
|
||||||
.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
key: const ValueKey<String>('toggleSignInPage'),
|
key: const ValueKey<String>(
|
||||||
|
'toggleSignInPage'),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
|
||||||
await widget.toggleSignInPage
|
await widget.toggleSignInPage
|
||||||
?.call();
|
?.call();
|
||||||
},
|
},
|
||||||
|
@ -353,7 +353,8 @@ class _WelcomeTemplateComponentWidgetState extends State<WelcomeTemplateComponen
|
||||||
padding: const EdgeInsetsDirectional
|
padding: const EdgeInsetsDirectional
|
||||||
.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
key: const ValueKey<String>('toggleSignUpPage'),
|
key: const ValueKey<String>(
|
||||||
|
'toggleSignUpPage'),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await widget.toggleSignUpPage
|
await widget.toggleSignUpPage
|
||||||
?.call();
|
?.call();
|
||||||
|
|
|
@ -117,7 +117,7 @@ class App extends StatefulWidget {
|
||||||
context.findAncestorStateOfType<_AppState>()!;
|
context.findAncestorStateOfType<_AppState>()!;
|
||||||
}
|
}
|
||||||
|
|
||||||
class _AppState extends State<App> with WidgetsBindingObserver {
|
class _AppState extends State<App> with WidgetsBindingObserver {
|
||||||
Locale? _locale = FFLocalizations.getStoredLocale();
|
Locale? _locale = FFLocalizations.getStoredLocale();
|
||||||
ThemeMode _themeMode = FlutterFlowTheme.themeMode;
|
ThemeMode _themeMode = FlutterFlowTheme.themeMode;
|
||||||
late AppStateNotifier _appStateNotifier;
|
late AppStateNotifier _appStateNotifier;
|
||||||
|
@ -180,6 +180,7 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
||||||
const Breakpoint(start: 1921, end: 2560, name: HD4K),
|
const Breakpoint(start: 1921, end: 2560, name: HD4K),
|
||||||
const Breakpoint(start: 2561, end: double.infinity, name: ULTRAWIDE),
|
const Breakpoint(start: 2561, end: double.infinity, name: ULTRAWIDE),
|
||||||
];
|
];
|
||||||
|
|
||||||
return ResponsiveBreakpoints.builder(
|
return ResponsiveBreakpoints.builder(
|
||||||
child: BouncingScrollWrapper.builder(context, widget!),
|
child: BouncingScrollWrapper.builder(context, widget!),
|
||||||
breakpoints: breakpoints,
|
breakpoints: breakpoints,
|
||||||
|
@ -264,7 +265,8 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override void initState() {
|
@override
|
||||||
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
WidgetsBinding.instance.addObserver(this);
|
WidgetsBinding.instance.addObserver(this);
|
||||||
|
|
||||||
|
@ -280,18 +282,21 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
||||||
WidgetsBinding.instance.addPersistentFrameCallback((_) => initDeepLinks());
|
WidgetsBinding.instance.addPersistentFrameCallback((_) => initDeepLinks());
|
||||||
}
|
}
|
||||||
|
|
||||||
@override void dispose() {
|
@override
|
||||||
|
void dispose() {
|
||||||
WidgetsBinding.instance.removeObserver(this);
|
WidgetsBinding.instance.removeObserver(this);
|
||||||
_linkSubscription?.cancel();
|
_linkSubscription?.cancel();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override void didChangeAppLifecycleState(AppLifecycleState state) async {
|
@override
|
||||||
|
void didChangeAppLifecycleState(AppLifecycleState state) async {
|
||||||
bool initialize = await StorageUtil().ensureInitialization();
|
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(
|
return MaterialApp.router(
|
||||||
key: navigatorKey,
|
key: navigatorKey,
|
||||||
title: 'FRE ACCESS HUB',
|
title: 'FRE ACCESS HUB',
|
||||||
|
|
|
@ -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,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue