|
- import 'package:flutter/material.dart';
- import 'package:zhiying_base_widget/widgets/home_goods/home_goods.dart';
- import 'package:zhiying_base_widget/widgets/home_goods/home_goods_header.dart';
- import 'package:zhiying_base_widget/widgets/home_goods/skeleton/home_goods_header_sk.dart';
- import 'package:zhiying_base_widget/widgets/home_goods/skeleton/home_goods_sk.dart';
- import 'package:zhiying_comm/zhiying_comm.dart';
-
- class GoodsListCreater extends WidgetCreater {
- @override
- List<Widget> createWidgets(Map<String, dynamic> model) {
- TabController controller =
- TabController(initialIndex: 0, length: 6, vsync: ScrollableState());
- return [
- _createHeader(controller),
- _createBody(controller),
- ];
- }
-
- @override
- List<Widget> createSkeleton(Map<String, dynamic> model) {
- return [
- _createHeaderSkeleton(),
- _createBodySkeleton(),
- ];
- }
-
- Widget _createHeader(TabController controller) {
- return SliverPersistentHeader(
- pinned: true,
- floating: false,
- delegate: HomeGoodsDelegate(controller),
- );
- }
-
- Widget _createHeaderSkeleton() {
- return SliverPersistentHeader(
- pinned: true,
- floating: false,
- delegate: HomeGoodsHeaderSkeletonDelegate(),
- );
- }
-
- Widget _createBody(TabController controller) {
- return SliverToBoxAdapter(
- child: HomeGoods(),
- );
- }
-
- Widget _createBodySkeleton() {
- return SliverToBoxAdapter(
- child: HomeGoodsSkeleton(),
- );
- }
-
- @override
- bool isSliverChild() {
- return true;
- }
- }
|