| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- import 'package:flutter/cupertino.dart';
- import 'package:flutter/material.dart';
- import 'package:flutter/src/widgets/framework.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:get/get.dart';
- import 'package:get/get_core/src/get_main.dart';
- import 'package:location/utils/common_expand.dart';
- import '../../../base/base_page.dart';
- import '../../../resource/colors.gen.dart';
- import '../../../resource/string.gen.dart';
- import '../../../router/app_pages.dart';
- import '../../../widget/common_view.dart';
- import 'news_report_controller.dart';
- import 'news_repost_text_view.dart';
- import 'news_tap_to_dismiss_key_board.dart';
- class NewsReportPage extends BasePage<NewsReportController> {
- const NewsReportPage({super.key});
- static void start() {
- Get.toNamed(RoutePath.newsReport);
- }
- @override
- bool immersive() {
- return false;
- }
- @override
- Widget buildBody(BuildContext context) {
- // TODO: implement buildBody
- return NewsTapToDismissKeyBoard(child: Column(
- children: [
- buildHeadView(onTap: controller.back),
- SizedBox(height: 28.w,),
- Container(
- padding: EdgeInsets.symmetric(horizontal: 16.w),
- child: Column(
- children: [
- Row(
- children: [
- Text("*",
- style: TextStyle(
- fontSize: 14.sp,
- color: '#FF3C3C'.color,
- fontWeight: FontWeight.w500)),
- Text("举报内容",
- style: TextStyle(
- fontSize: 14.sp,
- color: "#333333".color,
- fontWeight: FontWeight.w500))
- ],
- ),
- SizedBox(height: 10.w,),
- Container(
- color: ColorName.white,
- child: NewsRepostTextView(
- controller: controller.reportContetnController,
- onChanged: (text) {
- // 实时监听文本变化
- print('当前内容: $text');
- controller.inputContentText(text);
- },
- ),
- ),
- SizedBox(height: 20.w,),
- Row(
- children: [
- Text("*",
- style: TextStyle(
- fontSize: 14.sp,
- color: '#FF3C3C'.color,
- fontWeight: FontWeight.w500)),
- Text("违规原因",
- style: TextStyle(
- fontSize: 14.sp,
- color: "#333333".color,
- fontWeight: FontWeight.w500))
- ],
- ),
- SizedBox(height: 10.w,),
- Container(
- height: 44.w,
- color: ColorName.white,
- child: TextField(
- controller: controller.reportTitleContetnController,
- onChanged: (text ) {
- controller.inputTitleText(text);
- },
- decoration: InputDecoration(
- hintText: "请输入违规原因",
- border: OutlineInputBorder(
- borderSide: BorderSide(
- color: "#12C2C2C2".color,
- width: 1.0,
- ),
- ),
- enabledBorder: OutlineInputBorder(
- borderSide: BorderSide(
- color: "#12C2C2C2".color,
- width: 1.0,
- ),
- ),
- focusedBorder: OutlineInputBorder(
- borderSide: BorderSide(
- color: "#12C2C2C2".color,
- width: 1.0,
- ),
- ),
- // errorText: _errorText,
- // counterText: '$_currentLength/${widget.maxLength}', // 显示字数统计
- ),
- ),
- ),
- SizedBox(height: 30.w,),
- Container(
- child: Obx(() {
- return GestureDetector(
- onTap: controller.submitBuEnble.value ? controller.onSubmti : null,
- child: Container(
- alignment: Alignment.center,
- decoration: BoxDecoration(
- color: controller.submitBuEnble.value ? "#7B7DFF".color : ColorName.black30,
- borderRadius: BorderRadius.all(Radius.circular(41.w / 2)),
- ),
- width: 114.w,
- height: 41.w,
- child: Text(
- "提 交",
- style: TextStyle(
- fontSize: 16.sp, color: ColorName.white, fontWeight: FontWeight.w400)
- ),
- ),
- );
- }),
- )
- ],
- ),
- )
- ],
- ));
- }
- }
- Widget buildHeadView({GestureTapCallback? onTap}) {
- return Container(
- margin: EdgeInsets.symmetric(horizontal: 12.w, vertical: 14.w),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- GestureDetector(
- onTap: onTap, child: CommonView.getBackBtnView()),
- Text("举报投诉",
- style: TextStyle(
- fontSize: 18.sp,
- color: '#202020'.color,
- fontWeight: FontWeight.bold)),
- SizedBox(width: 24.w, height: 24.w)
- ],
- ),
- );
- }
|