Skip to content

Instantly share code, notes, and snippets.

@thq919
Created December 1, 2021 05:51
Show Gist options
  • Save thq919/fb6d6adc142429d70ec71023fff3469f to your computer and use it in GitHub Desktop.
Save thq919/fb6d6adc142429d70ec71023fff3469f to your computer and use it in GitHub Desktop.
FutureBuilder<SearchList?> buildFutureBuilder() {
return FutureBuilder(
future: fillTheList(searchQue),
builder: (BuildContext context, AsyncSnapshot searchListFuture) {
if (searchListFuture.hasData) {
searchList = searchListFuture.data;
return SingleChildScrollView(
child: Column(children: <Widget>[
ListView.builder(
physics: const NeverScrollableScrollPhysics(),
itemCount: searchList.length,
shrinkWrap: true,
itemBuilder: (BuildContext context, int position) {
return Video_single_shelf(searchList.elementAt(position));
}),
]),
);
}
if (searchListFuture.hasError) {
return Text('ощибка');
} else {
return CircularProgressIndicator();
}
},
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment