flutter add widgets on top and bottom to a listview

后端 未结 4 1229
渐次进展
渐次进展 2021-02-05 23:37

Trying to add some widgets to before of a listview.... I searched and found to use expanded like:

  return Scaffold(
    appBar: AppBar(
      title: Text(\'Test         


        
4条回答
  •  一向
    一向 (楼主)
    2021-02-06 00:22

    You should be returning ListTile not Container now and your tiles will be titled according to the ListTile title: property field where "providerapp.domains" is the list of strings.

    Container(
                child: Column(children: [
          Text('header'),
          ListView.builder(
            itemCount: providerApp.domains.length,
            itemBuilder: (BuildContext context, int index) {
              return ListTile(
                title: Text('${(providerApp.domains)[index]}'),
              );
            },
          ),
        ]),
    )
    

提交回复
热议问题