novel_cover_view.dart 957 B

123456789101112131415161718192021222324252627282930313233343536
  1. import 'package:flutter/material.dart';
  2. import 'package:shuqi/model/novel.dart';
  3. import 'package:shuqi/widget/novel_cover_image.dart';
  4. import 'package:shuqi/app/app_navigator.dart';
  5. class NovelCoverView extends StatelessWidget {
  6. final Novel novel;
  7. NovelCoverView(this.novel);
  8. @override
  9. Widget build(BuildContext context) {
  10. return GestureDetector(
  11. onTap: () {
  12. AppNavigator.pushNovelDetail(context, novel);
  13. },
  14. child: Container(
  15. width: 90,
  16. margin: EdgeInsets.symmetric(horizontal: 7),
  17. child: Column(
  18. crossAxisAlignment: CrossAxisAlignment.start,
  19. children: <Widget>[
  20. NovelCoverImage(
  21. novel.imgUrl,
  22. width: 90,
  23. height: 120,
  24. ),
  25. SizedBox(height: 10),
  26. Text(novel.name, style: TextStyle(fontSize: 12, fontWeight: FontWeight.bold), maxLines: 2),
  27. ],
  28. ),
  29. ),
  30. );
  31. }
  32. }