English 中文(简体)
在GredView上使用扩大Tile而不移动其他物品
原标题:Using ExpansionTile on GridView without moving other items
  • 时间:2024-01-21 20:08:35
  •  标签:
  • flutter
  • dart

是否有可能在GridView中拉开一个扩张拖拉机,而不是把名单上的其他物品排在一边,而将其放在首位?

如果没有,我是否可以使用任何其他植被?

我试图实现的是:

A GridView with 4 items per row. Some of those items can be expanded to show more information. Currently If I do so, the grid gets readjusted (so the expanded item opens and around it is empty) I wanted to expand the item and not move the Grid items at all. (to them perhaps Black out the screen a bit)

问题回答

您可以将<代码>ExpansionTile与OverflowBox相加,并订立<代码>alignment至,并同时制定maxHala<>/code>。 这里,我定在<代码>上的真正,以便<代码>ExpansionTile上的最高层的z-axis大于底层。

GridView.count(
  // ...
  reverse: true,
  children: [
    for (final number in List.generate(8, (i) => i + 1))
      OverflowBox(
        maxHeight: 1000,
        alignment: Alignment.topCenter,
        child: ExpansionTile(
          // ...
        ),
      ),
  ],
)

https://imgur.com/a/1No9DR9”rel=“nofollow noreferer”>Demonstration视频

Try it in DartPad (make sure to shrink the output screen width so that the expanded tile will overflow through the other tile)





相关问题
Flutter App cannot be installed on Android TV

I m building a Flutter app that should support Android TV and Mobile devices. Despite Google Play shows that it is supported, I cannot install app on my MiBox device. While trying to install it, both ...

Moving the icon button to the right causes rendering issues

I am trying to align the icon button to the right of the Text field, I tried the row which made the icon button not centered vertically and now I am trying out the Stack widget. Here is my code - ...

热门标签