I wasn't get any data from fake Api : 
CodePudding user response:
Make sure response.body is returning data.
Avoid using ? in futures, otherwise snapshot could be empty the whole time when body is null. The ui will always show loading.
To make your code look more simple:
Inside statefull widget:
late final Future<List<Data>> _futureData;
And in your initState:
@override
void initState(){
_futureData = provider.loadFutureData();
super.initState();
}
Or if you don't are using provider:
@override
void initState(){
_futureData = loadDataFromFunction();
super.initState();
}
