Flutter: RenderBox was not laid out

前端 未结 7 1017
清酒与你
清酒与你 2020-11-30 02:20

I\'m trying to create a ListView but when I import the list_form.dart class i get this error. Maybe I made some mistakes with the layout because if I try to run it inside th

7条回答
  •  既然无缘
    2020-11-30 02:53

    I used this code to fix the issue of displaying items in the horizontal list.

    new Container(
          height: 20,
          child: Row(
            mainAxisAlignment: MainAxisAlignment.end,
            children: [
              ListView.builder(
                scrollDirection: Axis.horizontal,
                shrinkWrap: true,
                itemCount: array.length,
                itemBuilder: (context, index){
                  return array[index];
                },
              ),
            ],
          ),
        );
    

提交回复
热议问题