news_report_page.dart 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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: 30.w,),
  63. Container(
  64. child: Obx(() {
  65. return GestureDetector(
  66. onTap: controller.submitBuEnble.value ? controller.onSubmti : null,
  67. child: Container(
  68. alignment: Alignment.center,
  69. decoration: BoxDecoration(
  70. color: controller.submitBuEnble.value ? "#7B7DFF".color : ColorName.black30,
  71. borderRadius: BorderRadius.all(Radius.circular(41.w / 2)),
  72. ),
  73. width: 114.w,
  74. height: 41.w,
  75. child: Text(
  76. "提 交",
  77. style: TextStyle(
  78. fontSize: 16.sp, color: ColorName.white, fontWeight: FontWeight.w400)
  79. ),
  80. ),
  81. );
  82. }),
  83. )
  84. ],
  85. ),
  86. )
  87. ],
  88. ));
  89. }
  90. }
  91. Widget buildHeadView({GestureTapCallback? onTap}) {
  92. return Container(
  93. margin: EdgeInsets.symmetric(horizontal: 12.w, vertical: 14.w),
  94. child: Row(
  95. crossAxisAlignment: CrossAxisAlignment.center,
  96. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  97. children: [
  98. GestureDetector(
  99. onTap: onTap, child: CommonView.getBackBtnView()),
  100. Text("举报投诉",
  101. style: TextStyle(
  102. fontSize: 18.sp,
  103. color: '#202020'.color,
  104. fontWeight: FontWeight.bold)),
  105. SizedBox(width: 24.w, height: 24.w)
  106. ],
  107. ),
  108. );
  109. }