123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. import 'package:farmer_client/models/entities/Address.dart';
  2. import 'package:farmer_client/widgets/DefaultButton.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:flutter_screenutil/flutter_screenutil.dart';
  5. import 'package:fluttertoast/fluttertoast.dart';
  6. import 'package:get/get.dart';
  7. class Feedback extends StatefulWidget {
  8. const Feedback({Key? key}) : super(key: key);
  9. @override
  10. _Feedback createState() => _Feedback();
  11. }
  12. class _Feedback extends State<Feedback> {
  13. String text = '';
  14. bool isEdit=false;
  15. @override
  16. Widget build(BuildContext context) {
  17. return Scaffold(
  18. resizeToAvoidBottomInset: false,
  19. appBar: AppBar(
  20. elevation: 0,
  21. centerTitle: true,
  22. backgroundColor: Colors.white,
  23. title: Text(
  24. '意见反馈',
  25. style: TextStyle(
  26. color: Colors.black,
  27. fontSize: 17.sp,
  28. letterSpacing: 2,
  29. fontWeight: FontWeight.bold),
  30. ),
  31. ),
  32. body: Container(
  33. height: 700.h,
  34. padding: EdgeInsets.all(15.w),
  35. child: Stack(
  36. children: [
  37. Container(
  38. margin: EdgeInsets.fromLTRB(0, 0, 0, 50.h),
  39. padding: EdgeInsets.symmetric(vertical: 5.w, horizontal: 18.5.w),
  40. decoration: BoxDecoration(
  41. color: const Color(0xFFfefefe),
  42. borderRadius: BorderRadius.all(Radius.circular(10.w)),
  43. border: Border.all(
  44. color: const Color(0xcc000000),
  45. width: 1.h,
  46. style: BorderStyle.solid)),
  47. child: TextFormField(
  48. minLines: 6,
  49. maxLines: 6,
  50. style: TextStyle(fontSize: 17.sp, height: 1.5),
  51. decoration: const InputDecoration(
  52. isCollapsed: true,
  53. border: InputBorder.none,
  54. counterText: '', //去掉计数
  55. floatingLabelBehavior: FloatingLabelBehavior.never,
  56. ),
  57. onTap: () {
  58. setState(() {
  59. isEdit=true;
  60. });
  61. },
  62. onChanged: (e) {
  63. setState(() {
  64. text = e;
  65. });
  66. },
  67. ),
  68. ),
  69. if(!isEdit) Positioned(
  70. left: 20.w,
  71. top: 5.w,
  72. child: Row(
  73. children: [
  74. Image.asset(
  75. 'images/icons/feedbackIcon.png',
  76. width: 15.w,
  77. ),
  78. Text(
  79. '请留下您宝贵的意见和建议!',
  80. style: TextStyle(
  81. fontSize: 17.sp,
  82. letterSpacing: 2,
  83. color: Color(0xFFBEBDBD)),
  84. ),
  85. ],
  86. ),
  87. ),
  88. Positioned(
  89. bottom: 25.h,
  90. child: DefaultButton(
  91. color: const Color(0xffffffff),
  92. backColor: const Color(0xFFFF703B),
  93. width: 345.w,
  94. height: 49.h,
  95. text: '提交',
  96. onPressed: () {
  97. if (text == '') {
  98. Fluttertoast.showToast(msg: '请输入内容哦');
  99. } else {
  100. Fluttertoast.showToast(msg: '提交成功!');
  101. Get.back();
  102. }
  103. },
  104. margin: const EdgeInsets.all(0),
  105. fontSize: 20.sp,
  106. radius: 24.5.w,
  107. ),
  108. ),
  109. ],
  110. ),
  111. ),
  112. );
  113. }
  114. }