小编sha*_*roo的帖子

在布局过程中,为RenderCustomMultiChildLayoutBox对象赋予了无限大小。颤动误差

我是flutter的新手,正在尝试在flutter中实现自定义列表视图。在布局错误期间,其给定的RenderCustomMultiChildLayoutBox对象提供了无限大小

  1. 我无法获得哪个小部件的抛出错误

2还请建议如何调试这些布局错误,因为错误跟踪没有针对其引发错误的特定窗口小部件信息

请找到以下相同的代码:

      class ChatItemSreen extends StatelessWidget {
      var leftSection;
      var middleSection;
      var rightSection;
      ChatModel _chartObj;

      ChatItemSreen(ChatModel _chartObj) {
        this._chartObj = _chartObj;
        //.........the left section ...........................
        CircleAvatar image = new CircleAvatar(
          backgroundColor: Colors.lightGreen,
          backgroundImage: new NetworkImage(this._chartObj.geturl()),
          radius: 24.0,
        );

        leftSection = new Container(child: image);

        //.........the middle section ...........................
        middleSection = new Expanded(
            child: new Container(
          padding: new EdgeInsets.only(left: 8.0),
          child: new Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            children: <Widget>[
              new Text(this._chartObj.getuserName(),
                  style: new TextStyle(
                      color: Colors.black,
                      fontWeight: FontWeight.w300,
                      fontSize: 16.0)), …
Run Code Online (Sandbox Code Playgroud)

android dart flutter flutter-layout

8
推荐指数
1
解决办法
2337
查看次数

标签 统计

android ×1

dart ×1

flutter ×1

flutter-layout ×1