的数据有没有类似的组件在flutter?或者任何专业的家伙可以提供我的代码?谢谢。我找不到这样的效果包,我的要求是显示所有的标签后,Animatedcontainer打开标签栏.
2wnc66cl1#
你可能想要ExpansionTile,我让它变得简单快捷。
ExpansionTile
class ExpansionGrid extends StatelessWidget { const ExpansionGrid({ super.key, required this.itemList, }); final List<YourItem> itemList; @override Widget build(BuildContext context) { return ExpansionTile( tilePadding: EdgeInsets.zero, childrenPadding: const EdgeInsets.only(right: 40), // it's kind dirty. You may use Row() for title instead. title: GridView.builder( shrinkWrap: true, gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 3, mainAxisSpacing: 10, crossAxisSpacing: 10, ), itemBuilder: (context, index) => itemList.sublist(0, 3)[index], itemCount: itemList.sublist(0, 3).length, ), children: [ GridView.builder( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 3, mainAxisSpacing: 10, crossAxisSpacing: 10, ), itemBuilder: (context, index) => itemList.sublist(3)[index], itemCount: itemList.sublist(3).length, ), ], ); } }
个字符您将需要自定义它,使更好,更适合您的形象。希望能帮上忙。
1条答案
按热度按时间2wnc66cl1#
你可能想要
ExpansionTile
,我让它变得简单快捷。个字符
您将需要自定义它,使更好,更适合您的形象。
希望能帮上忙。