import 'package:flutter/material.dart';
import 'package:zhiying_base_widget/widgets/brand/brandDetailTabBarView/brand_detail_tab_bar_view.dart';
import 'package:zhiying_base_widget/widgets/brand/brand_appbar/brand_appbar.dart';
import 'package:zhiying_base_widget/widgets/brand/brand_detail_appbar/brand_detail_appbar.dart';
import 'package:zhiying_base_widget/widgets/brand/brand_detail_recommend/brand_detail_recommend.dart';
import 'package:zhiying_base_widget/widgets/brand/brand_detail_tab_bar/brand_detail_tab_bar.dart';
import 'package:zhiying_base_widget/widgets/brand/brand_detail_top/brand_detail_top.dart';
import 'package:zhiying_comm/util/custom_sliver_persistent_header_delegate.dart';

class BrandDetailPageSkeleton extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return NestedScrollView(
        headerSliverBuilder: (context, innerBoxIsScrolled) {
          return headerBuild();
        },
        body: BrandTabBarView());
  }

  List<Widget> headerBuild() {
    List<Widget> listWidget = List();
    listWidget.add(BrandDetailAppBar());
    listWidget.add(SliverToBoxAdapter(
      child: BrandDetailTop(),
    ));
    listWidget.add(SliverToBoxAdapter(
      child: BrandDetailRecommend(),
    ));
    listWidget.add(SliverPersistentHeader(
      pinned: true,
      floating: false,
      delegate: CustomSliverPersistentHeaderDelegate(
          max: 48, min: 48, child: BrandDetailTabBar()),
    ));
    return listWidget;
  }
}
