Dan Cojocaru
3 years ago
7 changed files with 259 additions and 141 deletions
@ -0,0 +1,38 @@
|
||||
import 'package:flutter/material.dart'; |
||||
|
||||
class SliverPersistentHeaderPadding extends StatelessWidget { |
||||
final double maxHeight; |
||||
|
||||
const SliverPersistentHeaderPadding({required this.maxHeight}); |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return SliverPersistentHeader( |
||||
delegate: _SliverPersistentHeaderPaddingDelegate(maxHeight: maxHeight,), |
||||
floating: false, |
||||
pinned: false, |
||||
); |
||||
} |
||||
} |
||||
|
||||
class _SliverPersistentHeaderPaddingDelegate extends SliverPersistentHeaderDelegate { |
||||
final double maxHeight; |
||||
|
||||
const _SliverPersistentHeaderPaddingDelegate({required this.maxHeight}); |
||||
|
||||
@override |
||||
Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) { |
||||
return Container(); |
||||
} |
||||
|
||||
@override |
||||
double get maxExtent => maxHeight; |
||||
|
||||
@override |
||||
double get minExtent => 0; |
||||
|
||||
@override |
||||
bool shouldRebuild(covariant SliverPersistentHeaderDelegate oldDelegate) { |
||||
return oldDelegate.maxExtent != maxExtent; |
||||
} |
||||
} |
Loading…
Reference in new issue