:::

6-5 從遠端抓資料後,塞入可延伸的 ListView 中

Expanded(
  child: FutureBuilder(
    future: getCountriesData(),
    builder: (BuildContext context, AsyncSnapshot snap) {
      if (snap.hasData) {
        Response res = snap.data;
        return ListView.builder(
          itemCount: res.data.length,
          itemBuilder: (context, index) {
            Map<String, dynamic> data = res.data[index];
            return ListTile(
              title: Row(
                children: [
                  Expanded(
                      child: Text()),
                  Text(),
                ],
              ),
            );
          },
        );
      } else {
        return Center(
          child: CircularProgressIndicator(),
        );
      }
    },
  ),
),

 


:::

書籍目錄

展開 | 闔起

https%3A%2F%2Fcampus-xoops.tn.edu.tw%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbsn%3D42%26tbdsn%3D1889

計數器

今天: 1997199719971997
昨天: 4038403840384038
總計: 5565960556596055659605565960556596055659605565960