novel_grid_item.dart 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import 'package:flutter/material.dart';
  2. import 'package:shuqi/public.dart';
  3. class NovelGridItem extends StatelessWidget {
  4. final Novel novel;
  5. NovelGridItem(this.novel);
  6. @override
  7. Widget build(BuildContext context) {
  8. var width = (Screen.width - 15 * 2 - 15) / 2;
  9. return GestureDetector(
  10. onTap: () {
  11. AppNavigator.pushNovelDetail(context, this.novel);
  12. },
  13. child: Container(
  14. width: width,
  15. child: Row(
  16. children: <Widget>[
  17. NovelCoverImage(novel.imgUrl, width: 50, height: 66),
  18. SizedBox(width: 10),
  19. Expanded(
  20. child: Column(
  21. crossAxisAlignment: CrossAxisAlignment.start,
  22. children: <Widget>[
  23. Text(
  24. novel.name,
  25. maxLines: 2,
  26. style: TextStyle(fontSize: 16, height: 0.9, fontWeight: FontWeight.bold),
  27. ),
  28. Text(
  29. novel.recommendCountStr(),
  30. style: TextStyle(fontSize: 12, color: SQColor.gray),
  31. )
  32. ],
  33. ),
  34. )
  35. ],
  36. ),
  37. ),
  38. );
  39. }
  40. }