import 'package:flutter/cupertino.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:zhiying_base_widget/widgets/search/appbar/search_appbar_widget.dart';
import 'package:zhiying_comm/zhiying_comm.dart';
import 'dart:ui';
import 'package:zhiying_comm/util/custom_sliver_persistent_header_delegate.dart';

class SearchAppbarCreater extends WidgetCreater {
  @override
  List<Widget> createWidgets(Map<String, dynamic> model) {
    return [
      SliverPersistentHeader(
        delegate: CustomSliverPersistentHeaderDelegate(
          child: SearchAppbarWidget(model),
          max: MediaQueryData.fromWindow(window).padding.top + 44,
          min: MediaQueryData.fromWindow(window).padding.top + 44,
        ),
        pinned: true,
        floating: false,
      ),
    ];
  }

  @override
  bool isSliverChild() {
    return true;
  }
}
