fix seleção de locais sem conexão
This commit is contained in:
parent
942fd253c7
commit
82b716a0e6
|
@ -21,12 +21,20 @@ class LocalizationService {
|
|||
try {
|
||||
final GetLocalsCall callback = PhpGroup.getLocalsCall;
|
||||
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']);
|
||||
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 bool isEmpty = locals.isEmpty;
|
||||
|
|
Loading…
Reference in New Issue