bookshelf_item_view.dart 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import 'package:flutter/material.dart';
  2. import 'package:shuqi/public.dart';
  3. class BookshelfItemView extends StatelessWidget {
  4. final Novel novel;
  5. BookshelfItemView(this.novel);
  6. @override
  7. Widget build(BuildContext context) {
  8. var width = (Screen.width - 15 * 2 - 24 * 2) / 3;
  9. return GestureDetector(
  10. onTap: () {
  11. AppNavigator.pushNovelDetail(context, novel);
  12. },
  13. child: Container(
  14. width: width,
  15. child: Column(
  16. crossAxisAlignment: CrossAxisAlignment.start,
  17. children: <Widget>[
  18. DecoratedBox(
  19. child: NovelCoverImage(
  20. novel.imgUrl,
  21. width: width,
  22. height: width / 0.75,
  23. ),
  24. decoration: BoxDecoration(boxShadow: [BoxShadow(color: Color(0x22000000), blurRadius: 5)]),
  25. ),
  26. SizedBox(height: 10),
  27. Text(novel.name, style: TextStyle(fontSize: 14), maxLines: 1, overflow: TextOverflow.ellipsis),
  28. SizedBox(height: 25),
  29. ],
  30. ),
  31. ),
  32. );
  33. }
  34. }