import 'package:flutter/cupertino.dart'; class CustomSliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate { final Widget child; CustomSliverPersistentHeaderDelegate({required this.child}); @override double get minExtent => 50.0; // 最小高度 @override double get maxExtent => 50.0; // 最大高度 @override Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) { return child; } @override bool shouldRebuild(covariant SliverPersistentHeaderDelegate oldDelegate) { return true; } }