You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import'package:dio/dio.dart';
import'package:get/get.dart';
import'model.dart';
classCityControllerextendsGetNotifier<List<StateModel>>
{
finalDio dio =Dio();
// What differentiates GetNotify from StateMix, is the need to start// the Model with a value, that is, the constructor is mandatoryCityController({List<StateModel>? initial})
:super(initial ?? [StateModel(sigla:'empty_sig', nome:'empty_nome')]);
getStates() {
change(null, status:RxStatus.loading());
constString url ='https://servicodados.ibge.gov.br/api/v1/localidades/estados';
dio.get(url).then((result) {
List<StateModel> data =StateModel.listFromJson(result.data);
change(data, status:RxStatus.success());
}, onError: (err) {
change(null, status:RxStatus.error(err.toString()));
});
}
}
Here, the problem is , the WHOLE list content is replaced by a "spinner animation" even I comment out onLoading: const LoadingSpinner() (it means that getx would show a "loading animation" by default).
And what I want is only show the "loading animation" on the bottom of screen.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to just use getx for a pullupable list app. At present, there is package can do so, called pull_to_refresh.
To test, I coded like below:
Here, the problem is , the WHOLE list content is replaced by a "spinner animation" even I comment out
onLoading: const LoadingSpinner()
(it means that getx would show a "loading animation" by default).And what I want is only show the "loading animation" on the bottom of screen.
How to modify my code to do so?
Beta Was this translation helpful? Give feedback.
All reactions