news_report_page.dart 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter/src/widgets/framework.dart';
  4. import 'package:flutter_screenutil/flutter_screenutil.dart';
  5. import 'package:get/get.dart';
  6. import 'package:get/get_core/src/get_main.dart';
  7. import 'package:location/utils/common_expand.dart';
  8. import '../../../base/base_page.dart';
  9. import '../../../resource/colors.gen.dart';
  10. import '../../../resource/string.gen.dart';
  11. import '../../../router/app_pages.dart';
  12. import '../../../widget/common_view.dart';
  13. import 'news_report_controller.dart';
  14. import 'news_repost_text_view.dart';
  15. import 'news_tap_to_dismiss_key_board.dart';
  16. class NewsReportPage extends BasePage<NewsReportController> {
  17. const NewsReportPage({super.key});
  18. static void start() {
  19. Get.toNamed(RoutePath.newsReport);
  20. }
  21. @override
  22. bool immersive() {
  23. return false;
  24. }
  25. @override
  26. Widget buildBody(BuildContext context) {
  27. // TODO: implement buildBody
  28. return NewsTapToDismissKeyBoard(child: Column(
  29. children: [
  30. buildHeadView(onTap: controller.back),
  31. SizedBox(height: 28.w,),
  32. Container(
  33. padding: EdgeInsets.symmetric(horizontal: 16.w),
  34. child: Column(
  35. children: [
  36. Row(
  37. children: [
  38. Text("*",
  39. style: TextStyle(
  40. fontSize: 14.sp,
  41. color: '#FF3C3C'.color,
  42. fontWeight: FontWeight.w500)),
  43. Text("举报内容",
  44. style: TextStyle(
  45. fontSize: 14.sp,
  46. color: "#333333".color,
  47. fontWeight: FontWeight.w500))
  48. ],
  49. ),
  50. SizedBox(height: 10.w,),
  51. Container(
  52. color: ColorName.white,
  53. child: NewsRepostTextView(
  54. controller: controller.reportContetnController,
  55. onChanged: (text) {
  56. // 实时监听文本变化
  57. print('当前内容: $text');
  58. controller.inputContentText(text);
  59. },
  60. ),
  61. ),
  62. SizedBox(height: 20.w,),
  63. Row(
  64. children: [
  65. Text("*",
  66. style: TextStyle(
  67. fontSize: 14.sp,
  68. color: '#FF3C3C'.color,
  69. fontWeight: FontWeight.w500)),
  70. Text("违规原因",
  71. style: TextStyle(
  72. fontSize: 14.sp,
  73. color: "#333333".color,
  74. fontWeight: FontWeight.w500))
  75. ],
  76. ),
  77. SizedBox(height: 10.w,),
  78. Container(
  79. height: 44.w,
  80. color: ColorName.white,
  81. child: TextField(
  82. controller: controller.reportTitleContetnController,
  83. onChanged: (text ) {
  84. controller.inputTitleText(text);
  85. },
  86. decoration: InputDecoration(
  87. hintText: "请输入违规原因",
  88. border: OutlineInputBorder(
  89. borderSide: BorderSide(
  90. color: "#12C2C2C2".color,
  91. width: 1.0,
  92. ),
  93. ),
  94. enabledBorder: OutlineInputBorder(
  95. borderSide: BorderSide(
  96. color: "#12C2C2C2".color,
  97. width: 1.0,
  98. ),
  99. ),
  100. focusedBorder: OutlineInputBorder(
  101. borderSide: BorderSide(
  102. color: "#12C2C2C2".color,
  103. width: 1.0,
  104. ),
  105. ),
  106. // errorText: _errorText,
  107. // counterText: '$_currentLength/${widget.maxLength}', // 显示字数统计
  108. ),
  109. ),
  110. ),
  111. SizedBox(height: 30.w,),
  112. Container(
  113. child: Obx(() {
  114. return GestureDetector(
  115. onTap: controller.submitBuEnble.value ? controller.onSubmti : null,
  116. child: Container(
  117. alignment: Alignment.center,
  118. decoration: BoxDecoration(
  119. color: controller.submitBuEnble.value ? "#7B7DFF".color : ColorName.black30,
  120. borderRadius: BorderRadius.all(Radius.circular(41.w / 2)),
  121. ),
  122. width: 114.w,
  123. height: 41.w,
  124. child: Text(
  125. "提 交",
  126. style: TextStyle(
  127. fontSize: 16.sp, color: ColorName.white, fontWeight: FontWeight.w400)
  128. ),
  129. ),
  130. );
  131. }),
  132. )
  133. ],
  134. ),
  135. )
  136. ],
  137. ));
  138. }
  139. }
  140. Widget buildHeadView({GestureTapCallback? onTap}) {
  141. return Container(
  142. margin: EdgeInsets.symmetric(horizontal: 12.w, vertical: 14.w),
  143. child: Row(
  144. crossAxisAlignment: CrossAxisAlignment.center,
  145. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  146. children: [
  147. GestureDetector(
  148. onTap: onTap, child: CommonView.getBackBtnView()),
  149. Text("举报投诉",
  150. style: TextStyle(
  151. fontSize: 18.sp,
  152. color: '#202020'.color,
  153. fontWeight: FontWeight.bold)),
  154. SizedBox(width: 24.w, height: 24.w)
  155. ],
  156. ),
  157. );
  158. }