| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- import 'package:electronic_assistant/base/base_page.dart';
- import 'package:electronic_assistant/module/main/drawer/complaint/controller.dart';
- import 'package:electronic_assistant/resource/assets.gen.dart';
- import 'package:electronic_assistant/resource/colors.gen.dart';
- import 'package:electronic_assistant/utils/expand.dart';
- import 'package:flutter/material.dart';
- import 'package:flutter/services.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:get/get.dart';
- class ComplaintOpinionPage extends BasePage<ComplaintOpinionController> {
- const ComplaintOpinionPage({super.key});
- @override
- bool immersive() {
- return true;
- }
- // 点击空白处收起键盘
- @override
- void backgroundOnTapEvent() {
- super.backgroundOnTapEvent();
- FocusScope.of(Get.context!).requestFocus(FocusNode());
- }
- @override
- Widget buildBody(BuildContext context) {
- return Scaffold(
- resizeToAvoidBottomInset: false,
- backgroundColor: Colors.transparent,
- appBar: AppBar(
- systemOverlayStyle: SystemUiOverlayStyle.dark,
- backgroundColor: Colors.transparent,
- titleTextStyle: TextStyle(
- color: ColorName.primaryTextColor,
- fontSize: 17.sp,
- ),
- centerTitle: true,
- title: Obx(() => Text(controller.title.value,
- style:
- TextStyle(fontSize: 17.sp, color: ColorName.primaryTextColor))),
- leading: IconButton(
- icon: SizedBox(
- width: 24.w, height: 24.w, child: Assets.images.iconBack.image()),
- // Custom icon
- onPressed: () {
- Get.back();
- },
- ),
- ),
- body: _buildContentView(),
- );
- }
- Widget _buildContentView() {
- return SafeArea(
- child: Container(
- padding: EdgeInsets.symmetric(horizontal: 12.w),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Obx(
- () => Text(
- controller.title.value,
- style: TextStyle(
- color: ColorName.secondaryTextColor,
- fontSize: 14.sp,
- fontWeight: FontWeight.w500,
- ),
- ),
- ),
- SizedBox(
- height: 12.h,
- ),
- Container(
- decoration: BoxDecoration(
- color: "#E9E9E9".toColor(),
- borderRadius: BorderRadius.circular(8),
- ),
- height: 260.h,
- child: Obx(
- () => TextField(
- maxLength: 200,
- maxLines: null,
- cursorColor: ColorName.colorPrimary,
- style: TextStyle(
- fontSize: 15.sp, color: ColorName.primaryTextColor),
- decoration: InputDecoration(
- counterText: '',
- border: InputBorder.none,
- fillColor: Colors.transparent,
- hintText: controller.title.value == "投诉举报"
- ? "请输入您的投诉内容"
- : "请输入您的意见建议",
- hintStyle: TextStyle(
- fontSize: 15.sp, color: ColorName.tertiaryTextColor),
- contentPadding: const EdgeInsets.all(12).w,
- ),
- onChanged: (value) {
- controller.numCount.value = value.length;
- controller.content.value = value;
- },
- ),
- ),
- ),
- SizedBox(
- height: 13.h,
- ),
- Row(
- mainAxisAlignment: MainAxisAlignment.end,
- children: [
- Obx(
- () => Text(
- "${controller.numCount}/200",
- style: TextStyle(
- color: ColorName.tertiaryTextColor,
- fontSize: 12.sp,
- ),
- ),
- ),
- ],
- ),
- const Spacer(),
- GestureDetector(
- onTap: () => controller.requestSubmit(),
- child: Container(
- height: 48.w,
- alignment: Alignment.center,
- decoration: BoxDecoration(
- gradient: LinearGradient(
- colors: ['#6177F2'.color, '#8B9DFF'.color],
- begin: Alignment.centerLeft,
- end: Alignment.centerRight,
- stops: const [0.0, 1.0],
- ),
- borderRadius: BorderRadius.circular(8.w),
- ),
- child: Text(
- "提交",
- style: TextStyle(
- fontWeight: FontWeight.bold,
- fontSize: 16.sp,
- color: Colors.white,
- ),
- ),
- ),
- ),
- SizedBox(height: 28.h)
- ],
- ),
- ),
- );
- }
- }
|