美文网首页
'estimatedMaxScrollOffset >= end

'estimatedMaxScrollOffset >= end

作者: 爱的旋转体 | 来源:发表于2020-04-29 15:20 被阅读0次

1.介绍:
flutter中布局使用了listview的ListView.builder构建,列表除了第一项,其他用了ExpansionTile。
2.报错:

'package:flutter/src/rendering/sliver_list.dart': Failed assertion: line 270 pos 14: 'estimatedMaxScrollOffset >= endScrollOffset - childScrollOffset(firstChild)': is not true.

3.复现:
把列表中每一个ExpansionTile从下往上展开,然后从下往上折叠,当折叠到最后一两个的时候会报上面的错。
4.我的解决办法:
用另外一个listview嵌套这个listview

ListView(children: <Widget>[
      ListView.builder(
          shrinkWrap: true, //为true可以解决子控件必须设置高度的问题
          physics:NeverScrollableScrollPhysics(),//禁用滑动事件
          itemCount: (_showWordTypeList?.length ?? 0) + 1,
          itemBuilder: (BuildContext context, int index) {
            return index == 0
                ? buildHeader(context)
                : _buildWordTableTypeList(
                context, _showWordTypeList[index - 1], index - 1);
          }),
],),

相关文章

  • 'estimatedMaxScrollOffset >= end

    1.介绍:flutter中布局使用了listview的ListView.builder构建,列表除了第一项,其他用...

  • 永恒

    No end, no end to the journeyno end, no end neverhow can ...

  • AI学习笔记——End-to-End(端到端)的深度学习

    1. 什么是End-to-End 学习 要知道什么是End-to-End学习首先要知道传统的非End-to-End...

  • 第一次作业素数求和

    def get_su_num(start,end): a = [] end = end + 1 for...

  • 求素数和作业

    def get_su_num(start,end): a = [] end = end + 1 for...

  • 2017-04-04

    When is the end the end is dead.

  • the end

    我知道我并不是一个讨人喜欢的人 一直都知道 我缺乏安全感,不够自信…… 我也不是个幸运的人 我总是把自己...

  • END

    很久以前,我想过很多次以后的情景,我想过有一天我终于放弃你时候的样子。 我以为我会在某个晴朗的早晨,醒过来的刹那发...

  • end

    你虽有千军万马,终不免孤身一人。

  • THE END

    想过无数种可能, 会怎样收场。 竟然, 就是这样的, 稀松平常, 无处安放, 的冷淡结局。 180822

网友评论

      本文标题:'estimatedMaxScrollOffset >= end

      本文链接:https://www.haomeiwen.com/subject/nwzgwhtx.html