| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:news_app/constant/size_res.dart';
- import 'package:news_app/widget/my_txt.dart';
- /// @author: bo.zeng
- /// @email: cnhbwds@gmail.com
- /// @date: 2025 2025/4/9 16:00
- /// @description:
- class UserFeedbackPage extends StatefulWidget {
- const UserFeedbackPage({super.key});
- @override
- State<UserFeedbackPage> createState() => _UserFeedbackPageState();
- }
- class _UserFeedbackPageState extends State<UserFeedbackPage> {
- final TextEditingController _controller = TextEditingController();
- @override
- void initState() {
- super.initState();
- _controller.addListener(() {
- setState(() {});
- });
- }
- @override
- void dispose() {
- _controller.dispose();
- super.dispose();
- }
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- backgroundColor: Colors.white,
- appBar: AppBar(
- title: myTxt(
- text: '意见反馈',
- fontSize: 18.sp,
- fontWeight: FontWeight.bold,
- ),
- centerTitle: true,
- ),
- body: SafeArea(
- child: Padding(
- padding: EdgeInsets.all(horizontalPadding),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- padding: EdgeInsets.all(horizontalPadding),
- decoration: BoxDecoration(
- color: Colors.grey.shade100,
- borderRadius: BorderRadius.circular(10),
- ),
- child: Column(
- children: [
- TextField(
- controller: _controller,
- maxLines: 5,
- maxLength: 200,
- decoration: InputDecoration(
- hintText: '请输入您想反馈的问题',
- border: InputBorder.none,
- contentPadding: EdgeInsets.zero,
- hintStyle: TextStyle(color: Colors.grey),
- counterText: '',
- ),
- ),
- Align(
- alignment: Alignment.bottomRight,
- child: Text(
- '${_controller.text.length}/200',
- style: TextStyle(color: Colors.grey),
- ),
- ),
- ],
- ),
- ),
- Spacer(),
- SizedBox(
- width: double.infinity,
- height: 50.h,
- child: ElevatedButton(
- style: ElevatedButton.styleFrom(
- backgroundColor: Colors.blue,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(25),
- ),
- ),
- onPressed: () {},
- child: Text(
- '提交',
- style: TextStyle(fontSize: 18, color: Colors.white),
- ),
- ),
- ),
- SizedBox(height: 20),
- ],
- ),
- ),
- ),
- );
- }
- }
|