📜  颤振未来的建设者 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:49.200000             🧑  作者: Mango

代码示例2
FutureBuilder(
  future: _fetchListItems(),
  builder: (context, AsyncSnapshot snapshot) {
    if (!snapshot.hasData) {
      return Center(child: CircularProgressIndicator());
    } else {
      Container(
          child: ListView.builder(
              itemCount: snapshot.data.length,
              scrollDirection: Axis.horizontal,
              itemBuilder: (BuildContext context, int index) {
                return Text('${snapshot.data[index].title}');
              }));
    }
  });