Flutter (Dart): Exceptions caused by rendering / A RenderFlex overflowed

前端 未结 4 1683
囚心锁ツ
囚心锁ツ 2020-12-05 09:42

I have a problem with Flutter (Dart) RenderFlex overflowed pixels. An exception of rendering library.

How can I manage or apply scrolling ability to my app page view

4条回答
  •  时光说笑
    2020-12-05 10:04

    try to wrap of Container or any of other Widget in Flexible or Expanded and it Will be done.

    Do like this

               Flexible(
                  child: Container(
                    padding: EdgeInsets.all(5),
                    height: 400,
                    width: double.infinity,
                    child: ListView.builder(
                      scrollDirection: Axis.vertical,
                      shrinkWrap: true,
                      itemCount: 4,
                      itemBuilder: (context, index) {
                        return ListTile(
                          title: Text("Tony Stark"),
                          subtitle: Text("A Iron Man"),
                        );
                      },
                    ),
                  ),
                )
    

提交回复
热议问题