novel_normal_card.dart 879 B

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