首页 > 解决方案 > RenderIndexedSemantics 对象在布局期间被赋予无限大小

问题描述

当我listviewbuilder用于我的应用程序时出现此错误这是我的代码

ListView.builder(
        padding: const EdgeInsets.all(0),
        itemCount: 1,
        itemBuilder: (BuildContext context, int index) {
          return Scaffold(
            body: SafeArea( //and the rest of codes... 

标签: flutterdart

解决方案


设置错误。

应该是这样的

SafeArea(
  child: Scaffold(
    body:ListView.builder();
  ),

推荐阅读