fix forgot password template
This commit is contained in:
parent
61b5080810
commit
736f3080e1
|
@ -44,8 +44,8 @@
|
||||||
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||||
6436409727A31CDB00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
6436409827A31CD800820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||||
6436409B27A31CDF00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
6436409D27A31CD300820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||||
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
@ -225,8 +225,8 @@
|
||||||
6436409C27A31CD800820AF7 /* InfoPlist.strings */ = {
|
6436409C27A31CD800820AF7 /* InfoPlist.strings */ = {
|
||||||
isa = PBXVariantGroup;
|
isa = PBXVariantGroup;
|
||||||
children = (
|
children = (
|
||||||
6436409727A31CDB00820AF7 /* pt */,
|
6436409827A31CD800820AF7 /* pt */,
|
||||||
6436409B27A31CDF00820AF7 /* en */,
|
6436409D27A31CD300820AF7 /* en */,
|
||||||
);
|
);
|
||||||
name = InfoPlist.strings;
|
name = InfoPlist.strings;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
|
|
@ -8,15 +8,34 @@ class ForgotPasswordTemplateComponentModel
|
||||||
extends FlutterFlowModel<ForgotPasswordTemplateComponentWidget> {
|
extends FlutterFlowModel<ForgotPasswordTemplateComponentWidget> {
|
||||||
/// State fields for stateful widgets in this component.
|
/// State fields for stateful widgets in this component.
|
||||||
|
|
||||||
|
final formKey = GlobalKey<FormState>();
|
||||||
// State field(s) for emailAddress widget.
|
// State field(s) for emailAddress widget.
|
||||||
FocusNode? emailAddressFocusNode;
|
FocusNode? emailAddressFocusNode;
|
||||||
TextEditingController? emailAddressTextController;
|
TextEditingController? emailAddressTextController;
|
||||||
String? Function(BuildContext, String?)? emailAddressTextControllerValidator;
|
String? Function(BuildContext, String?)? emailAddressTextControllerValidator;
|
||||||
|
String? _emailAddressTextControllerValidator(
|
||||||
|
BuildContext context, String? val) {
|
||||||
|
if (val == null || val.isEmpty) {
|
||||||
|
return FFLocalizations.of(context).getText(
|
||||||
|
'3hqg8buh' /* E-mail é Obrigatório */,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!RegExp(kTextValidatorEmailRegex).hasMatch(val)) {
|
||||||
|
return FFLocalizations.of(context).getText(
|
||||||
|
'jh5r2b1w' /* E-mail Inválido */,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// Stores action output result for [Backend Call - API (forgotPassword)] action in Button-Login widget.
|
// Stores action output result for [Backend Call - API (forgotPassword)] action in Button-Login widget.
|
||||||
ApiCallResponse? req;
|
ApiCallResponse? req;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState(BuildContext context) {}
|
void initState(BuildContext context) {
|
||||||
|
emailAddressTextControllerValidator = _emailAddressTextControllerValidator;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
|
|
|
@ -3,6 +3,7 @@ import '/components/molecular_components/throw_exception/throw_exception_widget.
|
||||||
import '/flutter_flow/flutter_flow_theme.dart';
|
import '/flutter_flow/flutter_flow_theme.dart';
|
||||||
import '/flutter_flow/flutter_flow_util.dart';
|
import '/flutter_flow/flutter_flow_util.dart';
|
||||||
import '/flutter_flow/flutter_flow_widgets.dart';
|
import '/flutter_flow/flutter_flow_widgets.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';
|
||||||
import 'forgot_password_template_component_model.dart';
|
import 'forgot_password_template_component_model.dart';
|
||||||
|
@ -148,95 +149,92 @@ class _ForgotPasswordTemplateComponentWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Form(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0),
|
key: _model.formKey,
|
||||||
child: SizedBox(
|
autovalidateMode: AutovalidateMode.disabled,
|
||||||
width: double.infinity,
|
child: Padding(
|
||||||
child: TextFormField(
|
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0),
|
||||||
controller: _model.emailAddressTextController,
|
child: SizedBox(
|
||||||
focusNode: _model.emailAddressFocusNode,
|
width: double.infinity,
|
||||||
autofillHints: const [AutofillHints.email],
|
child: TextFormField(
|
||||||
obscureText: false,
|
controller: _model.emailAddressTextController,
|
||||||
decoration: InputDecoration(
|
focusNode: _model.emailAddressFocusNode,
|
||||||
isDense: true,
|
onChanged: (_) => EasyDebounce.debounce(
|
||||||
labelText: FFLocalizations.of(context).getText(
|
'_model.emailAddressTextController',
|
||||||
'mtz8l7ft' /* Email */,
|
const Duration(milliseconds: 500),
|
||||||
|
() => setState(() {}),
|
||||||
),
|
),
|
||||||
labelStyle:
|
autofocus: true,
|
||||||
FlutterFlowTheme.of(context).labelMedium.override(
|
autofillHints: const [AutofillHints.email],
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
obscureText: false,
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
decoration: InputDecoration(
|
||||||
fontSize: 14.0,
|
isDense: true,
|
||||||
letterSpacing: 0.0,
|
labelText: FFLocalizations.of(context).getText(
|
||||||
fontWeight: FontWeight.w500,
|
'mtz8l7ft' /* E-mail */,
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
),
|
||||||
.containsKey('Plus Jakarta Sans'),
|
labelStyle:
|
||||||
),
|
FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
hintText: FFLocalizations.of(context).getText(
|
fontFamily: 'Plus Jakarta Sans',
|
||||||
'w7y5wlnv' /* digite o seu email..... */,
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
),
|
fontSize: 14.0,
|
||||||
hintStyle:
|
letterSpacing: 0.0,
|
||||||
FlutterFlowTheme.of(context).labelMedium.override(
|
fontWeight: FontWeight.w500,
|
||||||
fontFamily: 'Plus Jakarta Sans',
|
useGoogleFonts: GoogleFonts.asMap()
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
.containsKey('Plus Jakarta Sans'),
|
||||||
fontSize: 14.0,
|
),
|
||||||
letterSpacing: 0.0,
|
enabledBorder: OutlineInputBorder(
|
||||||
fontWeight: FontWeight.w500,
|
borderSide: BorderSide(
|
||||||
useGoogleFonts: GoogleFonts.asMap()
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
.containsKey('Plus Jakarta Sans'),
|
width: 2.0,
|
||||||
),
|
),
|
||||||
enabledBorder: OutlineInputBorder(
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
borderSide: BorderSide(
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).primary,
|
||||||
|
width: 2.0,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
|
),
|
||||||
|
errorBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).error,
|
||||||
|
width: 2.0,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
|
),
|
||||||
|
focusedErrorBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: FlutterFlowTheme.of(context).error,
|
||||||
|
width: 2.0,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
|
),
|
||||||
|
filled: true,
|
||||||
|
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
|
contentPadding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
24.0, 24.0, 20.0, 24.0),
|
||||||
|
suffixIcon: Icon(
|
||||||
|
Icons.email,
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
color: FlutterFlowTheme.of(context).accent1,
|
||||||
width: 2.0,
|
size: 22.0,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).accent3,
|
|
||||||
width: 2.0,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
|
||||||
),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 2.0,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
|
||||||
),
|
|
||||||
focusedErrorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: FlutterFlowTheme.of(context).error,
|
|
||||||
width: 2.0,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
|
||||||
),
|
|
||||||
filled: true,
|
|
||||||
fillColor: FlutterFlowTheme.of(context).primaryBackground,
|
|
||||||
contentPadding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 20.0, 24.0),
|
|
||||||
suffixIcon: Icon(
|
|
||||||
Icons.email,
|
|
||||||
color: FlutterFlowTheme.of(context).accent1,
|
|
||||||
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),
|
||||||
),
|
),
|
||||||
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: const Color(0xFF6F61EF),
|
|
||||||
validator: _model.emailAddressTextControllerValidator
|
|
||||||
.asValidator(context),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -245,37 +243,39 @@ class _ForgotPasswordTemplateComponentWidgetState
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
|
||||||
child: FFButtonWidget(
|
child: FFButtonWidget(
|
||||||
onPressed: () async {
|
onPressed: (_model.emailAddressTextController.text == '')
|
||||||
_model.req = await PhpGroup.forgotPasswordCall.call(
|
? null
|
||||||
email: _model.emailAddressTextController.text,
|
: () async {
|
||||||
);
|
_model.req = await PhpGroup.forgotPasswordCall.call(
|
||||||
|
email: _model.emailAddressTextController.text,
|
||||||
if (PhpGroup.forgotPasswordCall.error(
|
|
||||||
(_model.req?.jsonBody ?? ''),
|
|
||||||
) ==
|
|
||||||
false) {
|
|
||||||
Navigator.pop(context);
|
|
||||||
} else {
|
|
||||||
await showModalBottomSheet(
|
|
||||||
isScrollControlled: true,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
enableDrag: false,
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return Padding(
|
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
|
||||||
child: ThrowExceptionWidget(
|
|
||||||
msg: PhpGroup.forgotPasswordCall.msg(
|
|
||||||
(_model.req?.jsonBody ?? ''),
|
|
||||||
)!,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
|
||||||
).then((value) => safeSetState(() {}));
|
|
||||||
}
|
|
||||||
|
|
||||||
setState(() {});
|
if (PhpGroup.forgotPasswordCall.error(
|
||||||
},
|
(_model.req?.jsonBody ?? ''),
|
||||||
|
) ==
|
||||||
|
false) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
} else {
|
||||||
|
await showModalBottomSheet(
|
||||||
|
isScrollControlled: true,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
enableDrag: false,
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return Padding(
|
||||||
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
|
child: ThrowExceptionWidget(
|
||||||
|
msg: PhpGroup.forgotPasswordCall.msg(
|
||||||
|
(_model.req?.jsonBody ?? ''),
|
||||||
|
)!,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
).then((value) => safeSetState(() {}));
|
||||||
|
}
|
||||||
|
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
text: FFLocalizations.of(context).getText(
|
text: FFLocalizations.of(context).getText(
|
||||||
'74rnd5bu' /* Enviar */,
|
'74rnd5bu' /* Enviar */,
|
||||||
),
|
),
|
||||||
|
|
|
@ -1002,12 +1002,24 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
|
||||||
'Don\'t worry, we will help you, enter the email registered in the application and click send.',
|
'Don\'t worry, we will help you, enter the email registered in the application and click send.',
|
||||||
},
|
},
|
||||||
'mtz8l7ft': {
|
'mtz8l7ft': {
|
||||||
'pt': 'Email',
|
'pt': 'E-mail',
|
||||||
'en': 'Email',
|
'en': 'E-mail',
|
||||||
},
|
},
|
||||||
'w7y5wlnv': {
|
'w7y5wlnv': {
|
||||||
'pt': 'digite o seu email.....',
|
'pt': '',
|
||||||
'en': 'enter your email.....',
|
'en': '',
|
||||||
|
},
|
||||||
|
'3hqg8buh': {
|
||||||
|
'pt': 'E-mail é Obrigatório',
|
||||||
|
'en': '',
|
||||||
|
},
|
||||||
|
'jh5r2b1w': {
|
||||||
|
'pt': 'E-mail Inválido',
|
||||||
|
'en': '',
|
||||||
|
},
|
||||||
|
'1p76vmkn': {
|
||||||
|
'pt': 'Please choose an option from the dropdown',
|
||||||
|
'en': '',
|
||||||
},
|
},
|
||||||
'74rnd5bu': {
|
'74rnd5bu': {
|
||||||
'pt': 'Enviar',
|
'pt': 'Enviar',
|
||||||
|
|
Loading…
Reference in New Issue