qa_detail.dart 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. import 'package:cached_network_image/cached_network_image.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:jmrh/constant/styles.dart';
  4. import 'package:jmrh/widget/item_comment.dart';
  5. import 'package:jmrh/widget/item_post.dart';
  6. class QaDetail extends StatefulWidget {
  7. QaDetail({Key key}) : super(key: key);
  8. @override
  9. _QaDetailState createState() => _QaDetailState();
  10. }
  11. class _QaDetailState extends State<QaDetail> {
  12. @override
  13. Widget build(BuildContext context) {
  14. return Scaffold(
  15. appBar: appBarLight('问答详情'),
  16. resizeToAvoidBottomInset: true,
  17. resizeToAvoidBottomPadding: true,
  18. body: Column(
  19. children: [
  20. Expanded(
  21. child: CustomScrollView(
  22. slivers: [
  23. SliverToBoxAdapter(
  24. child: Container(
  25. decoration: BoxDecoration(border: Border(bottom: BorderSide(width: 5, color: COLOR_BORDER))),
  26. child: Column(
  27. crossAxisAlignment: CrossAxisAlignment.start,
  28. children: [
  29. Container(
  30. margin: EdgeInsets.only(left: 16, right: 16, top: 16),
  31. child: Row(
  32. children: [
  33. ClipOval(
  34. child: Image.asset('img/img_defaultphoto.png', width: 26, height: 26),
  35. ),
  36. Expanded(
  37. child: Container(
  38. padding: EdgeInsets.symmetric(horizontal: 10),
  39. child: Text(
  40. '官方平台',
  41. style: TextStyle(fontSize: 14, color: Colors.black),
  42. overflow: TextOverflow.ellipsis,
  43. ),
  44. ),
  45. ),
  46. Text(
  47. '05-23',
  48. style: TextStyle(color: COLOR_TEXT_2, fontSize: 13),
  49. )
  50. ],
  51. ),
  52. ),
  53. Container(
  54. margin: EdgeInsets.only(left: 16, right: 16, top: 10),
  55. child: Row(
  56. children: [
  57. Container(
  58. width: 18,
  59. height: 18,
  60. alignment: Alignment.center,
  61. decoration: BoxDecoration(
  62. color: COLOR_PRIMARY, borderRadius: BorderRadius.all(Radius.circular(2))),
  63. child: Text('问', style: TextStyle(color: Colors.white, fontSize: 11)),
  64. ),
  65. Expanded(
  66. child: Container(
  67. margin: EdgeInsets.only(left: 5),
  68. child: Text(
  69. '李克强考察南昌航空城为何强调一个李克强考察南昌航空城为何强调一个李克强考察南昌航空城为何强调一个“捧”字?',
  70. style: TextStyle(color: COLOR_TEXT_1, fontSize: 14, fontWeight: FontWeight.bold),
  71. maxLines: 1,
  72. overflow: TextOverflow.ellipsis,
  73. ),
  74. ),
  75. )
  76. ],
  77. ),
  78. ),
  79. Container(
  80. margin: EdgeInsets.only(left: 16, right: 16, top: 10),
  81. child: Row(
  82. crossAxisAlignment: CrossAxisAlignment.start,
  83. children: [
  84. Container(
  85. width: 18,
  86. height: 18,
  87. alignment: Alignment.center,
  88. decoration: BoxDecoration(
  89. color: Color(0xFFFFC23B), borderRadius: BorderRadius.all(Radius.circular(2))),
  90. child: Text('答', style: TextStyle(color: Colors.white, fontSize: 11)),
  91. ),
  92. Expanded(
  93. child: Container(
  94. margin: EdgeInsets.only(left: 5),
  95. child: Text(
  96. '李克强11月15日上午考察南昌航空城,在首款国产大飞机C919装配厂勉励员工:“安全舒适的大飞机要从你们手中捧出来、飞上天。我为什么要说‘捧’字呢?因为飞机制造是一个高精密的活儿,要像捧宝贝一样。”李克强一一考察了飞机装配的材料、设备和工艺。他对质量检测岗工作人员说,客运飞机最重要的是安全,只有保证绝对安全,才能树立信誉,赢得市场。在职业技能培训中心,李克强察看不同工种实训,并与获得世界技能大赛银奖的技师亲切交流。他说,飞机制造质量,事关人的生命,必须倾注高度的专业技能和极致的工匠精神。总理祝愿中国航空争取早日走向世界、环绕世界、誉满全球。',
  97. style: TextStyle(color: COLOR_TEXT_1, fontSize: 13, height: 1.4),
  98. ),
  99. ),
  100. )
  101. ],
  102. ),
  103. ),
  104. Container(
  105. height: 46,
  106. child: Row(
  107. children: [
  108. Expanded(
  109. child: Row(children: [
  110. Image.asset('img/icon_redu.png'),
  111. Container(
  112. margin: EdgeInsets.only(left: 4),
  113. child: Text(
  114. '26461',
  115. style: TextStyle(color: COLOR_TEXT_3, fontSize: 13),
  116. ),
  117. )
  118. ], mainAxisAlignment: MainAxisAlignment.center),
  119. ),
  120. Expanded(
  121. child: Row(children: [
  122. Image.asset('img/icon_pingjia.png'),
  123. Container(
  124. margin: EdgeInsets.only(left: 4),
  125. child: Text(
  126. '3644',
  127. style: TextStyle(color: COLOR_TEXT_3, fontSize: 13),
  128. ),
  129. )
  130. ], mainAxisAlignment: MainAxisAlignment.center),
  131. ),
  132. Expanded(
  133. child: Row(children: [
  134. Image.asset('img/icon_dianzhan.png'),
  135. Container(
  136. margin: EdgeInsets.only(left: 4),
  137. child: Text(
  138. '11243',
  139. style: TextStyle(color: COLOR_TEXT_3, fontSize: 13),
  140. ),
  141. )
  142. ], mainAxisAlignment: MainAxisAlignment.center),
  143. )
  144. ],
  145. ),
  146. )
  147. ],
  148. ),
  149. ),
  150. ),
  151. SliverToBoxAdapter(
  152. child: Container(
  153. margin: EdgeInsets.only(left: 16, top: 16, bottom: 10),
  154. child: Text(
  155. '评论56',
  156. style: TextStyle(color: COLOR_TEXT_1, fontSize: 14, fontWeight: FontWeight.bold),
  157. ),
  158. ),
  159. ),
  160. SliverList(
  161. delegate:
  162. SliverChildBuilderDelegate((BuildContext context, int index) => ItemComment(), childCount: 10),
  163. )
  164. ],
  165. ),
  166. ),
  167. SafeArea(
  168. child: Container(
  169. height: 50,
  170. padding: EdgeInsets.symmetric(horizontal: 16, vertical: 7),
  171. child: Container(
  172. height: 36,
  173. alignment: Alignment.centerLeft,
  174. padding: EdgeInsets.symmetric(horizontal: 15),
  175. decoration: BoxDecoration(
  176. color: COLOR_INPUT_BG,
  177. borderRadius: BorderRadius.all(
  178. Radius.circular(2),
  179. ),
  180. ),
  181. child: TextField(
  182. style: TextStyle(fontSize: 14),
  183. decoration: InputDecoration.collapsed(
  184. hintText: '发表您的观点…',
  185. hintStyle: TextStyle(
  186. fontSize: 13,
  187. color: COLOR_TEXT_3,
  188. )),
  189. ),
  190. ),
  191. ),
  192. ),
  193. ],
  194. ),
  195. );
  196. }
  197. }