index.dart 3.6KB

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