novel_comment_cell.dart 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import 'package:flutter/material.dart';
  2. import 'package:cached_network_image/cached_network_image.dart';
  3. import 'package:shuqi/public.dart';
  4. class NovelCommentCell extends StatelessWidget {
  5. final NovelComment comment;
  6. NovelCommentCell(this.comment);
  7. like() {}
  8. Widget buildButton(String image, String title, VoidCallback onPress, bool isSelected) {
  9. return Row(
  10. children: <Widget>[
  11. Image.asset(image),
  12. SizedBox(width: 5),
  13. Text(
  14. title,
  15. style: TextStyle(fontSize: 14, color: isSelected ? Color(0xfff5a623) : SQColor.gray),
  16. )
  17. ],
  18. );
  19. }
  20. Widget buildContent() {
  21. return Container(
  22. padding: EdgeInsets.all(15),
  23. child: Column(
  24. crossAxisAlignment: CrossAxisAlignment.start,
  25. children: <Widget>[
  26. Row(
  27. children: <Widget>[
  28. CircleAvatar(
  29. radius: 13,
  30. backgroundImage: CachedNetworkImageProvider(comment.avatar),
  31. ),
  32. SizedBox(width: 10),
  33. Text(comment.nickname, style: TextStyle(fontSize: 14, color: SQColor.gray)),
  34. ],
  35. ),
  36. Container(
  37. padding: EdgeInsets.fromLTRB(35, 15, 15, 0),
  38. child: Text(comment.content, style: TextStyle(fontSize: 16)),
  39. ),
  40. ],
  41. ),
  42. );
  43. }
  44. @override
  45. Widget build(BuildContext context) {
  46. return Column(
  47. children: <Widget>[
  48. buildContent(),
  49. Divider(height: 1, indent: 15),
  50. ],
  51. );
  52. }
  53. }