Answers for "how to use sliverpersistentheader widget"

1

how to use sliverpersistentheader widget

class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
  _SliverAppBarDelegate({this.child});

  final Widget child;

  @override
  double get minExtent => 100; //Change these values for your likings

  @override
  double get maxExtent => 250;

  @override
  Widget build(
      BuildContext context, double shrinkOffset, bool overlapsContent) {
    return child;
  }

  @override
  bool shouldRebuild(_SliverAppBarDelegate oldDelegate) {
    return false;
  }
}
// Just call this inside delegate of SliverPersistentHeader, 
// give any child and off you go
Posted by: Guest on April-03-2021
1

how to use sliverpersistentheader widget

class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
  _SliverAppBarDelegate({this.child});

  final Widget child;

  @override
  double get minExtent => 100; //Change these values for your likings

  @override
  double get maxExtent => 250;

  @override
  Widget build(
      BuildContext context, double shrinkOffset, bool overlapsContent) {
    return child;
  }

  @override
  bool shouldRebuild(_SliverAppBarDelegate oldDelegate) {
    return false;
  }
}
// Just call this inside delegate of SliverPersistentHeader, 
// give any child and off you go
Posted by: Guest on April-03-2021

Code answers related to "how to use sliverpersistentheader widget"

Browse Popular Code Answers by Language