admin管理员组文章数量:1122826
I have a ReorderableListView
inside a container with a fixed width and height. When the number of ListTile
widgets exceeds the container's height, the background of the ReorderableListView
overflows outside the container, but the foreground (text) of the ListTile
widgets is clipped, as expected.
I have attached a gif as a visual aid, in which we can notice that the text and icon of each ListTile
gets clipped, but not the background. We can also notice how the AppBar
of my Scaffold
widgget changes color when the list moves all the way up.
Here is my code:
Container(
width: 250,
height: 300,
child: ReorderableListView(
clipBehavior: Clip.hardEdge,
shrinkWrap: true,
onReorder: (int oldIndex, int newIndex) { /* Some code here */ },
children: <Widget>[
for (int index = 0; index < _selectedDataLabelSet.labels.length; index++)
ListTile(
selected: _selectedDataLabelIndex == index,
selectedTileColor: colorScheme.primary,
selectedColor: Colors.white,
key: Key('$index'),
tileColor: index.isOdd ? oddItemColor : evenItemColor,
title: Text(_selectedDataLabelSet.labels[index]),
onTap: () { /* Do something here */ },
),
]),
),
I tried:
- Wrapping the
ReorderableListView
with aConstrainedBox
- Wrapping the
ReorderableListView
with aSingleChildScrollView
- Adding the
shrinkWrap: true
andclipBehavior: Clip.hardEdge
to myReorderableListView
本文标签: flutterReorderableListView background overflows outside of containerStack Overflow
版权声明:本文标题:flutter - ReorderableListView background overflows outside of container - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736307146a1933208.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论