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>"; };
|
||||
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>"; };
|
||||
6436409727A31CDB00820AF7 /* 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>"; };
|
||||
6436409827A31CD800820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.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>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
|
@ -225,8 +225,8 @@
|
|||
6436409C27A31CD800820AF7 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
6436409727A31CDB00820AF7 /* pt */,
|
||||
6436409B27A31CDF00820AF7 /* en */,
|
||||
6436409827A31CD800820AF7 /* pt */,
|
||||
6436409D27A31CD300820AF7 /* en */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
|
|
|
@ -8,15 +8,34 @@ class ForgotPasswordTemplateComponentModel
|
|||
extends FlutterFlowModel<ForgotPasswordTemplateComponentWidget> {
|
||||
/// State fields for stateful widgets in this component.
|
||||
|
||||
final formKey = GlobalKey<FormState>();
|
||||
// State field(s) for emailAddress widget.
|
||||
FocusNode? emailAddressFocusNode;
|
||||
TextEditingController? emailAddressTextController;
|
||||
String? Function(BuildContext, String?)? emailAddressTextControllerValidator;
|
||||
String? _emailAddressTextControllerValidator(
|
||||
BuildContext context, String? val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return FFLocalizations.of(context).getText(
|
||||
'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.
|
||||
ApiCallResponse? req;
|
||||
|
||||
@override
|
||||
void initState(BuildContext context) {}
|
||||
void initState(BuildContext context) {
|
||||
emailAddressTextControllerValidator = _emailAddressTextControllerValidator;
|
||||
}
|
||||
|
||||
@override
|
||||
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_util.dart';
|
||||
import '/flutter_flow/flutter_flow_widgets.dart';
|
||||
import 'package:easy_debounce/easy_debounce.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'forgot_password_template_component_model.dart';
|
||||
|
@ -148,95 +149,92 @@ class _ForgotPasswordTemplateComponentWidgetState
|
|||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: TextFormField(
|
||||
controller: _model.emailAddressTextController,
|
||||
focusNode: _model.emailAddressFocusNode,
|
||||
autofillHints: const [AutofillHints.email],
|
||||
obscureText: false,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelText: FFLocalizations.of(context).getText(
|
||||
'mtz8l7ft' /* Email */,
|
||||
Form(
|
||||
key: _model.formKey,
|
||||
autovalidateMode: AutovalidateMode.disabled,
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 12.0, 16.0, 0.0),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: TextFormField(
|
||||
controller: _model.emailAddressTextController,
|
||||
focusNode: _model.emailAddressFocusNode,
|
||||
onChanged: (_) => EasyDebounce.debounce(
|
||||
'_model.emailAddressTextController',
|
||||
const Duration(milliseconds: 500),
|
||||
() => setState(() {}),
|
||||
),
|
||||
labelStyle:
|
||||
FlutterFlowTheme.of(context).labelMedium.override(
|
||||
fontFamily: 'Plus Jakarta Sans',
|
||||
color: FlutterFlowTheme.of(context).accent1,
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
hintText: FFLocalizations.of(context).getText(
|
||||
'w7y5wlnv' /* digite o seu email..... */,
|
||||
),
|
||||
hintStyle:
|
||||
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'),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
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).accent1,
|
||||
fontSize: 14.0,
|
||||
letterSpacing: 0.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
useGoogleFonts: GoogleFonts.asMap()
|
||||
.containsKey('Plus Jakarta Sans'),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
width: 2.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
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,
|
||||
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(
|
||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 24.0, 0.0, 0.0),
|
||||
child: FFButtonWidget(
|
||||
onPressed: () 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 ?? ''),
|
||||
)!,
|
||||
),
|
||||
onPressed: (_model.emailAddressTextController.text == '')
|
||||
? null
|
||||
: () async {
|
||||
_model.req = await PhpGroup.forgotPasswordCall.call(
|
||||
email: _model.emailAddressTextController.text,
|
||||
);
|
||||
},
|
||||
).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(
|
||||
'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.',
|
||||
},
|
||||
'mtz8l7ft': {
|
||||
'pt': 'Email',
|
||||
'en': 'Email',
|
||||
'pt': 'E-mail',
|
||||
'en': 'E-mail',
|
||||
},
|
||||
'w7y5wlnv': {
|
||||
'pt': 'digite o seu email.....',
|
||||
'en': 'enter your email.....',
|
||||
'pt': '',
|
||||
'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': {
|
||||
'pt': 'Enviar',
|
||||
|
|
Loading…
Reference in New Issue