item_qa.dart 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import 'package:flutter/material.dart';
  2. import 'package:jmrh/constant/styles.dart';
  3. class ItemQa extends StatelessWidget {
  4. @override
  5. Widget build(BuildContext context) {
  6. return InkWell(
  7. child: Container(
  8. padding: EdgeInsets.all(16),
  9. child: Column(
  10. crossAxisAlignment: CrossAxisAlignment.start,
  11. children: [
  12. Row(
  13. children: [
  14. Container(
  15. width: 18,
  16. height: 18,
  17. alignment: Alignment.center,
  18. decoration: BoxDecoration(color: COLOR_PRIMARY, borderRadius: BorderRadius.all(Radius.circular(2))),
  19. child: Text('问', style: TextStyle(color: Colors.white, fontSize: 11)),
  20. ),
  21. Expanded(
  22. child: Container(
  23. margin: EdgeInsets.only(left: 5),
  24. child: Text(
  25. '李克强考察南昌航空城为何强调一个李克强考察南昌航空城为何强调一个李克强考察南昌航空城为何强调一个“捧”字?',
  26. style: TextStyle(color: COLOR_TEXT_1, fontSize: 14, fontWeight: FontWeight.bold),
  27. maxLines: 1,
  28. overflow: TextOverflow.ellipsis,
  29. ),
  30. ),
  31. )
  32. ],
  33. ),
  34. Container(
  35. margin: EdgeInsets.only(top: 10),
  36. child: Row(
  37. crossAxisAlignment: CrossAxisAlignment.start,
  38. children: [
  39. Container(
  40. width: 18,
  41. height: 18,
  42. alignment: Alignment.center,
  43. decoration:
  44. BoxDecoration(color: Color(0xFFFFC23B), borderRadius: BorderRadius.all(Radius.circular(2))),
  45. child: Text('答', style: TextStyle(color: Colors.white, fontSize: 11)),
  46. ),
  47. Expanded(
  48. child: Container(
  49. margin: EdgeInsets.only(left: 5),
  50. child: RichText(
  51. maxLines: 2,
  52. text: TextSpan(
  53. style: TextStyle(color: COLOR_TEXT_1, fontSize: 13, height: 1.4),
  54. text: '李克强11月15日上午考察南昌航空城,在首款国产大飞机C919装配厂勉励员工:“安全舒适的大飞安全舒适的大飞安全舒适的大飞…',
  55. children: [
  56. TextSpan(text: '查看详情', style: TextStyle(color: COLOR_PRIMARY, fontWeight: FontWeight.bold))
  57. ],
  58. ),
  59. ),
  60. ),
  61. )
  62. ],
  63. ),
  64. )
  65. ],
  66. ),
  67. ),
  68. onTap: () {
  69. Navigator.of(context).pushNamed('/qaDetail');
  70. },
  71. );
  72. }
  73. }