fix seleção de locais sem conexão
This commit is contained in:
parent
942fd253c7
commit
82b716a0e6
|
@ -21,11 +21,19 @@ class LocalizationService {
|
||||||
try {
|
try {
|
||||||
final GetLocalsCall callback = PhpGroup.getLocalsCall;
|
final GetLocalsCall callback = PhpGroup.getLocalsCall;
|
||||||
var response = await callback.call();
|
var response = await callback.call();
|
||||||
final bool isError = response.jsonBody['error'];
|
final bool? isError = response.jsonBody['error'];
|
||||||
|
|
||||||
if (isError) {
|
if (isError == true) {
|
||||||
_handleError(context, response.jsonBody['error_msg']);
|
_handleError(context, response.jsonBody['error_msg']);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
if (isError == null) {
|
||||||
|
final String errorMsg = FFLocalizations.of(context).getVariableText(
|
||||||
|
enText: 'Verify your connection',
|
||||||
|
ptText: 'Verifique sua conexão',
|
||||||
|
);
|
||||||
|
DialogUtil.error(context, errorMsg).whenComplete(() => selectLocal(context));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<dynamic> locals = response.jsonBody['locais'] ?? [];
|
final List<dynamic> locals = response.jsonBody['locais'] ?? [];
|
||||||
|
|
Loading…
Reference in New Issue