index.dart 2.9KB

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