基础库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

24 lines
554 B

  1. import 'package:flutter/material.dart';
  2. class SliverTabBarDelegate extends SliverPersistentHeaderDelegate {
  3. final TabBar widget;
  4. const SliverTabBarDelegate(this.widget) : assert(widget != null);
  5. @override
  6. Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) {
  7. return this.widget;
  8. }
  9. @override
  10. bool shouldRebuild(SliverTabBarDelegate oldDelegate) {
  11. return false;
  12. }
  13. @override
  14. double get maxExtent => widget.preferredSize.height;
  15. @override
  16. double get minExtent => widget.preferredSize.height;
  17. }