How to add a ListView to a Column in Flutter?

后端 未结 13 1192
死守一世寂寞
死守一世寂寞 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条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-30 23:11

    You can use Flex and Flexible widgets. for example:

    Flex(
    direction: Axis.vertical,
    children: [
        ... other widgets ...
        Flexible(
            flex: 1,
            child: ListView.builder(
            itemCount: ...,
            itemBuilder: (context, index) {
                ...
            },
            ),
        ),
    ],
    

    );

提交回复
热议问题