|
- import 'package:flutter/material.dart';
- import 'package:zhiying_comm/zhiying_comm.dart';
-
- // ignore: must_be_immutable
- class MainPageSkeleton extends StatelessWidget {
- ScrollController _controller;
-
- MainPageSkeleton({Key key}) : super(key: key) {
- _controller = ScrollController();
- }
-
- @override
- Widget build(BuildContext context) {
- return SafeArea(
- child: CustomScrollView(
- controller: _controller,
- slivers: _createContent(context),
- ),
- );
- }
-
- List<Widget> _createContent(BuildContext context) {
- List<Widget> list = List();
-
- list.addAll(WidgetFactory.create('index_carousel',
- type: WidgetType.skeleton,
- isSliver: true,
- model: Map<String, dynamic>.from({'aaaaa': 'bbbb'})));
- list.addAll(WidgetFactory.create('index_recommend_list',
- type: WidgetType.skeleton, isSliver: true));
- return list;
- }
- }
|