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,
|
required String? email,
|
||||||
String? device,
|
String? device,
|
||||||
}) async {
|
}) async {
|
||||||
|
try {
|
||||||
ApiCallResponse? registerCall;
|
ApiCallResponse? registerCall;
|
||||||
|
|
||||||
if ((email != null && email != '') &&
|
if ((email != null && email != '') &&
|
||||||
(passwd != null && passwd != '' && passwd.length > 7) &&
|
(passwd != null && passwd != '' && passwd.length > 7) &&
|
||||||
(name != null && name != '')) {
|
(name != null && name != '')) {
|
||||||
|
@ -239,53 +239,17 @@ Future<bool> signUpRegisterAction(
|
||||||
false) {
|
false) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
await showDialog(
|
final errorMessage = registerCall?.jsonBody['error_msg'];
|
||||||
context: context,
|
DialogUtil.error(context, errorMessage);
|
||||||
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'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
await showDialog(
|
DialogUtil.errorDefault(context);
|
||||||
context: context,
|
return false;
|
||||||
builder: (alertDialogContext) {
|
}
|
||||||
return AlertDialog(
|
} catch (e, s) {
|
||||||
title: Text(FFLocalizations.of(context).getVariableText(
|
DialogUtil.errorDefault(context);
|
||||||
enText: 'Error',
|
LogUtil.requestAPIFailed(
|
||||||
ptText: 'Erro',
|
'registro.php', email.toString(), "Register", e, s);
|
||||||
)),
|
|
||||||
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',
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -763,7 +763,7 @@ class _SignUpTemplateComponentWidgetState
|
||||||
.customColor5,
|
.customColor5,
|
||||||
disabledTextColor: Colors.white,
|
disabledTextColor: Colors.white,
|
||||||
),
|
),
|
||||||
showLoadingIndicator: false,
|
showLoadingIndicator: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue