novel_detail_cell.dart 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import 'package:flutter/material.dart';
  2. import 'package:shuqi/public.dart';
  3. class NovelDetailCell extends StatelessWidget {
  4. final String iconName;
  5. final String title;
  6. final String subtitle;
  7. final Widget? attachedWidget;
  8. NovelDetailCell({required this.iconName, required this.title, required this.subtitle, this.attachedWidget});
  9. @override
  10. Widget build(BuildContext context) {
  11. return Container(
  12. color: Colors.white,
  13. padding: EdgeInsets.symmetric(horizontal: 15),
  14. child: Column(
  15. children: <Widget>[
  16. Divider(height: 1),
  17. Container(
  18. height: 50,
  19. child: Row(
  20. children: <Widget>[
  21. Image.asset(iconName),
  22. SizedBox(width: 5),
  23. Text(title, style: TextStyle(fontSize: 16)),
  24. SizedBox(width: 10),
  25. Expanded(
  26. child: Text(
  27. subtitle,
  28. style: TextStyle(fontSize: 14, color: SQColor.gray),
  29. maxLines: 1,
  30. overflow: TextOverflow.ellipsis,
  31. ),
  32. ),
  33. attachedWidget != null ? attachedWidget! : Container(),
  34. SizedBox(width: 10),
  35. Image.asset('assets/img/arrow_right.png'),
  36. ],
  37. ),
  38. ),
  39. Divider(height: 1),
  40. ],
  41. ),
  42. );
  43. }
  44. }