基础组件库
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.
 
 
 
 
 

43 lines
1.1 KiB

  1. import 'package:event_bus/event_bus.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:zhiying_base_widget/widgets/home_goods/bloc/home_goods_header_bloc.dart';
  4. import 'package:zhiying_base_widget/widgets/home_goods/home_goods.dart';
  5. import 'package:zhiying_base_widget/widgets/home_goods/home_goods_header.dart';
  6. import 'package:zhiying_comm/util/base_bloc.dart';
  7. import 'package:zhiying_comm/zhiying_comm.dart';
  8. class GoodsListCreater extends WidgetCreater {
  9. final EventBus _eventBus = EventBus();
  10. @override
  11. List<Widget> createWidgets(Map<String, dynamic> model) {
  12. print('创建商品列表');
  13. Widget _widget = BlocProvider<HomeGoodsHeaderBloc>(
  14. bloc: HomeGoodsHeaderBloc(),
  15. child: HomeGoodsHeader(model, _eventBus),
  16. );
  17. return [
  18. SliverPersistentHeader(
  19. pinned: true,
  20. floating: false,
  21. delegate: HomeGoodsHeaderDelegate(_widget),
  22. ),
  23. SliverToBoxAdapter(
  24. child: HomeGoods(model, eventBus: _eventBus),
  25. ),
  26. ];
  27. }
  28. @override
  29. bool isSliverChild() {
  30. return true;
  31. }
  32. }
  33. class HomeGoodsHeaderEvent {
  34. String provider;
  35. HomeGoodsHeaderEvent(this.provider);
  36. }