Trocado os ShowDialog para utilizar o Componente de DialogUtil
This commit is contained in:
parent
2f75441939
commit
9f18ed1de9
|
@ -200,8 +200,8 @@ Future<bool> signUpRegisterAction(
|
|||
required String? email,
|
||||
String? device,
|
||||
}) async {
|
||||
try {
|
||||
ApiCallResponse? registerCall;
|
||||
|
||||
if ((email != null && email != '') &&
|
||||
(passwd != null && passwd != '' && passwd.length > 7) &&
|
||||
(name != null && name != '')) {
|
||||
|
@ -239,53 +239,17 @@ Future<bool> signUpRegisterAction(
|
|||
false) {
|
||||
return true;
|
||||
}
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (alertDialogContext) {
|
||||
return AlertDialog(
|
||||
title: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'An error occurred:', ptText: 'Ocorreu um erro:'),
|
||||
),
|
||||
content: Text(registerCall?.jsonBody['error_msg']),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(alertDialogContext),
|
||||
child: Text(
|
||||
FFLocalizations.of(context)
|
||||
.getVariableText(enText: 'Close', ptText: 'Fechar'),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
final errorMessage = registerCall?.jsonBody['error_msg'];
|
||||
DialogUtil.error(context, errorMessage);
|
||||
return false;
|
||||
} else {
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (alertDialogContext) {
|
||||
return AlertDialog(
|
||||
title: Text(FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Error',
|
||||
ptText: 'Erro',
|
||||
)),
|
||||
content: Text(FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Please fill in all fields',
|
||||
ptText: 'Por favor, preencha todos os campos',
|
||||
)),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(alertDialogContext),
|
||||
child: Text(FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Fechar',
|
||||
enText: 'Close',
|
||||
)),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
DialogUtil.errorDefault(context);
|
||||
return false;
|
||||
}
|
||||
} catch (e, s) {
|
||||
DialogUtil.errorDefault(context);
|
||||
LogUtil.requestAPIFailed(
|
||||
'registro.php', email.toString(), "Register", e, s);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -763,7 +763,7 @@ class _SignUpTemplateComponentWidgetState
|
|||
.customColor5,
|
||||
disabledTextColor: Colors.white,
|
||||
),
|
||||
showLoadingIndicator: false,
|
||||
showLoadingIndicator: true,
|
||||
),
|
||||
),
|
||||
|
||||
|
|
Loading…
Reference in New Issue