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

34 lines
894 B

  1. import 'package:flutter/material.dart';
  2. import 'package:zhiying_comm/zhiying_comm.dart';
  3. // ignore: must_be_immutable
  4. class MainPageSkeleton extends StatelessWidget {
  5. ScrollController _controller;
  6. MainPageSkeleton({Key key}) : super(key: key) {
  7. _controller = ScrollController();
  8. }
  9. @override
  10. Widget build(BuildContext context) {
  11. return SafeArea(
  12. child: CustomScrollView(
  13. controller: _controller,
  14. slivers: _createContent(context),
  15. ),
  16. );
  17. }
  18. List<Widget> _createContent(BuildContext context) {
  19. List<Widget> list = List();
  20. list.addAll(WidgetFactory.create('index_carousel',
  21. type: WidgetType.skeleton,
  22. isSliver: true,
  23. model: Map<String, dynamic>.from({'aaaaa': 'bbbb'})));
  24. list.addAll(WidgetFactory.create('index_recommend_list',
  25. type: WidgetType.skeleton, isSliver: true));
  26. return list;
  27. }
  28. }