novel_detail_recommend_view.dart 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import 'package:flutter/material.dart';
  2. import 'package:shuqi/public.dart';
  3. import 'package:shuqi/pages/home/home_novel_cover_view.dart';
  4. class NovelDetailRecommendView extends StatelessWidget {
  5. final List<Novel> novels;
  6. NovelDetailRecommendView(this.novels);
  7. Widget buildItems() {
  8. var children = novels.map((novel) => HomeNovelCoverView(novel)).toList();
  9. return Container(
  10. padding: EdgeInsets.symmetric(horizontal: 15),
  11. child: Wrap(spacing: 15, runSpacing: 20, children: children),
  12. );
  13. }
  14. @override
  15. Widget build(BuildContext context) {
  16. return Container(
  17. color: Colors.white,
  18. padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
  19. child: Column(
  20. crossAxisAlignment: CrossAxisAlignment.start,
  21. children: <Widget>[
  22. Container(
  23. padding: EdgeInsets.symmetric(vertical: 15),
  24. child: Row(
  25. children: <Widget>[
  26. Image.asset('assets/img/home_tip.png'),
  27. SizedBox(width: 13),
  28. Text('看过本书的人还在看', style: TextStyle(fontSize: 16)),
  29. ],
  30. ),
  31. ),
  32. buildItems(),
  33. ],
  34. ),
  35. );
  36. }
  37. }