When you create a list with async data, you may need the StreamBuilder 1. How to use the stream and StreamController.there is the Link: [https://medium.com/@ayushpguptaapg/using-streams-in-flutter-62fed41662e4]()[https://medium.com/@ayushpguptaapg/using-streams-in-flutter-62fed41662e4](https://medium.com/@ayushpguptaapg/using-streams-in-flutter-62fed41662e4)2.create a controller with data >()color:#cc7832;](;
color:#cc7832;](
color:#cc7832;]( Stream> color:#cc7832;font-weight:bold;](get color:#9876aa;](menuItems => color:#9876aa;](controller.color:#9876aa;](streamcolor:#cc7832;](;
color:#cc7832;](
color:#cc7832;]( MenuController({List menus}) {
color:#9876aa;](controller.add(menus ?? _defaultMenus())color:#cc7832;](;
color:#cc7832;]( }
color:#cc7832;font-weight:bold;](static String color:#ffc66d;font-style:italic;](_title(index) {
color:#cc7832;font-weight:bold;](return _MENU_STRINGS[index % _MENU_STRINGS.color:#9876aa;](length][color:#6a8759;]('title']color:#cc7832;](;
color:#cc7832;]( }
color:#cc7832;font-weight:bold;](static List color:#ffc66d;font-style:italic;](_items(index) {
color:#cc7832;font-weight:bold;](return _MENU_STRINGS[index % _MENU_STRINGS.color:#9876aa;](length][color:#6a8759;]('items']color:#cc7832;](;
color:#cc7832;]( }
List color:#ffc66d;](_defaultMenus() {
color:#cc7832;font-weight:bold;](var list = color:#ffc66d;](List()color:#cc7832;](;
color:#cc7832;]( color:#cc7832;font-weight:bold;](for (int i = color:#6897bb;](0color:#cc7832;](; i 3. Use the StreamBuilder [_topBar()color:#cc7832;](, _gridView(shot.color:#9876aa;](data)]color:#cc7832;](,
color:#cc7832;]( )
: color:#ffc66d;](Center(
child: color:#ffc66d;](CircularProgressIndicator()color:#cc7832;](,
color:#cc7832;]( )color:#cc7832;](;
color:#cc7832;]( }color:#cc7832;](,
color:#cc7832;]( stream: controller.color:#9876aa;](menuItemscolor:#cc7832;](,
color:#cc7832;]( )color:#cc7832;](;
}
you can see the StreamBuilder hold and listen to data for complying the async purpose. You can use the Future, but this is convenience.Whole project: [https://github.com/nb312/flutter_ui_app](https://github.com/nb312/flutter_ui_app)
![](../../Uploads/4c840c7c-3451-4c2c-bde4-178490970b8f.pngwidth="50%height="auto](