/*
 * @Author       : WuWei
 * @LastEditors  : WuWei
 * @Date         : 2021-10-26 09:28:22
 * @LastEditTime : 2021-10-26 09:28:25
 * @Description  : Do not edit
 */
import 'package:flutter/material.dart';

/// 滑动吸顶的tabbar
class StickyTabBarDelegate extends SliverPersistentHeaderDelegate {
  final child;

  StickyTabBarDelegate({@required this.child});

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

  @override
  double get maxExtent => this.child.child.preferredSize.height;

  @override
  double get minExtent => this.child.child.preferredSize.height;

  @override
  bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) {
    return true;
  }
}
