我想在银条应用程序栏下创建一个自定义容器,如图像中的右屏幕
https://cdn.dribbble.com/users/1720296/screenshots/6918712/dribbble_blog_2x.jpg
答案 0 :(得分:0)
您可以将自定义标头与SliverPersistentHeaderDelegate
,
这是您的自定义SliverPersistentHeaderDelegate
class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
@override
double get minExtent => 100;
@override
double get maxExtent => 300;
@override
Widget build(
BuildContext context, double shrinkOffset, bool overlapsContent) {
return Container(
...
);
}
@override
bool shouldRebuild(_SliverAppBarDelegate oldDelegate) {
return false;
}
}
并像这样使用它
SliverPersistentHeader(
delegate: _SliverAppBarDelegate(
...
),
pinned: true,
),