novel_four_grid_view.dart 984 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import 'package:flutter/material.dart';
  2. import 'home_model.dart';
  3. import 'home_section_view.dart';
  4. import 'home_novel_cover_view.dart';
  5. class NovelFourGridView extends StatelessWidget {
  6. final HomeModule cardInfo;
  7. NovelFourGridView(this.cardInfo);
  8. @override
  9. Widget build(BuildContext context) {
  10. var novels = cardInfo.books;
  11. if (novels == null || novels.length < 8) {
  12. return Container();
  13. }
  14. var children = novels.map((novel) => HomeNovelCoverView(novel)).toList();
  15. return Container(
  16. color: Colors.white,
  17. child: Column(
  18. crossAxisAlignment: CrossAxisAlignment.start,
  19. children: <Widget>[
  20. HomeSectionView(cardInfo.name),
  21. Container(
  22. padding: EdgeInsets.fromLTRB(15, 10, 15, 10),
  23. child: Wrap(spacing: 15, runSpacing: 20, children: children),
  24. ),
  25. Container(
  26. height: 10,
  27. color: Color(0xfff5f5f5),
  28. )
  29. ],
  30. ),
  31. );
  32. }
  33. }