How to add a ListView to a Column in Flutter?

后端 未结 13 1194
死守一世寂寞
死守一世寂寞 2020-11-30 22:53

I\'m trying to construct a simple login page for my Flutter app. I\'ve successfully built the TextFields and log in/Sign in buttons. I want to add a horizontal ListView.

13条回答
  •  旧时难觅i
    2020-11-30 23:20

      Column(
        children: [
          Text('Leading text widget'),
          ListView(
            shrinkWrap: true,
            physics: NeverScrollableScrollPhysics(),
            children: [
              ListTile(
                leading: Icon(Icons.map),
                title: Text('Map'),
              ),
              ListTile(
                leading: Icon(Icons.photo_album),
                title: Text('Album'),
              ),
              ListTile(
                leading: Icon(Icons.phone),
                title: Text('Phone'),
              ),
            ],
          ),
          Text('More widget'),
        ],
      );
    

    just use

    shrinkWrap: true,
    
    physics: NeverScrollableScrollPhysics(),
    

    properties in listView

提交回复
热议问题