How to add a ListView to a Column in Flutter?

后端 未结 13 1113
死守一世寂寞
死守一世寂寞 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:08

    Actually, when you read docs the ListView should be inside Expanded Widget so it can work.

      Widget build(BuildContext context) {
    return Scaffold(
        body: Column(
      children: [
        Align(
          child: PayableWidget(),
        ),
        Expanded(
          child: _myListView(context),
        )
      ],
    ));
    

    }

提交回复
热议问题