我在扩展图块中需要一个可重新排序的列表,但是除非将ReorderableListView放入固定大小的容器中,否则它会出现以下错误。
playerCards
-
BoxConstraints forces an infinite height.
The relevant error-causing widget was
ReorderableListView
-
RenderBox was not laid out: RenderStack#77d94 relayoutBoundary=up18 NEEDS-PAINT
NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1687 pos 12: 'hasSize'
The relevant error-causing widget was
ReorderableListView
如果将其放在固定的盒子中,则在尝试移动项目时会出现以下错误。
RenderBox was not laid out: _RenderTheatre#778cd relayoutBoundary=up17 NEEDS-PAINT
NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1687 pos 12: 'hasSize'
The relevant error-causing widget was
ExpansionTile-[Thing]
答案 0 :(得分:0)
我最终使用this awesome package代替了非常有限的ReorderableListView。
然后,我使用了ReorderableColumn小部件,它的效果很好。 Flutter团队确实应该更新ReorderableListView,以免受到限制。
答案 1 :(得分:0)
这是工作代码的示例:
loader.lua