【发布时间】:2022-01-12 09:12:27
【问题描述】:
如何在颤振上制作这个动画?有人知道可以帮助我的小部件吗? image of animation
【问题讨论】:
-
检查
SliverPersistentHeader
标签: android flutter scroll show-hide flutter-animation
如何在颤振上制作这个动画?有人知道可以帮助我的小部件吗? image of animation
【问题讨论】:
SliverPersistentHeader
标签: android flutter scroll show-hide flutter-animation
您可以使用 CustomScrollView 来实现此类功能。
例子:
CustomScrollView(
slivers: <Widget>[
const SliverAppBar(
pinned: true,
expandedHeight: 250.0,
flexibleSpace: FlexibleSpaceBar(
title: Text('Demo'),
),
),
SliverGrid(
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: 200.0,
mainAxisSpacing: 10.0,
crossAxisSpacing: 10.0,
childAspectRatio: 4.0,
),
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return Container(
alignment: Alignment.center,
color: Colors.teal[100 * (index % 9)],
child: Text('Grid Item $index'),
);
},
childCount: 20,
),
),
SliverFixedExtentList(
itemExtent: 50.0,
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return Container(
alignment: Alignment.center,
color: Colors.lightBlue[100 * (index % 9)],
child: Text('List Item $index'),
);
},
),
),
],
)
【讨论】: