novel_first_hybird_card.dart 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import 'package:flutter/material.dart';
  2. import 'novel_cell.dart';
  3. import 'novel_grid_item.dart';
  4. import 'home_section_view.dart';
  5. import 'home_model.dart';
  6. class NovelFirstHybirdCard extends StatelessWidget {
  7. final HomeModule cardInfo;
  8. NovelFirstHybirdCard(this.cardInfo);
  9. @override
  10. Widget build(BuildContext context) {
  11. var novels = cardInfo.books;
  12. if (novels == null || novels.length < 3) {
  13. return Container();
  14. }
  15. List<Widget> children = [];
  16. var bottomNovels = novels.sublist(1);
  17. bottomNovels.forEach((novel) {
  18. children.add(NovelGridItem(novel));
  19. });
  20. return Container(
  21. color: Colors.white,
  22. child: Column(
  23. children: <Widget>[
  24. HomeSectionView(cardInfo.name),
  25. NovelCell(novels[0]),
  26. Container(
  27. padding: EdgeInsets.fromLTRB(15, 10, 15, 10),
  28. child: Wrap(spacing: 15, runSpacing: 15, children: children),
  29. ),
  30. Container(
  31. height: 10,
  32. color: Color(0xfff5f5f5),
  33. )
  34. ],
  35. ),
  36. );
  37. }
  38. }