feed_back_page.dart 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter/src/widgets/framework.dart';
  4. import 'package:flutter_screenutil/flutter_screenutil.dart';
  5. import 'package:get/get.dart';
  6. import 'package:get/get_core/src/get_main.dart';
  7. import 'package:location/base/base_page.dart';
  8. import 'package:location/resource/string.gen.dart';
  9. import 'package:location/utils/common_expand.dart';
  10. import '../../resource/colors.gen.dart';
  11. import '../../router/app_pages.dart';
  12. import '../../widget/common_view.dart';
  13. import 'feed_back_controller.dart';
  14. class FeedBackPage extends BasePage<FeedBackController> {
  15. const FeedBackPage({super.key});
  16. static void start() {
  17. Get.toNamed(RoutePath.feedback);
  18. }
  19. @override
  20. Widget buildBody(BuildContext context) {
  21. return Stack(
  22. children: [
  23. GestureDetector(
  24. onTap: () => FocusScope.of(Get.context!).unfocus(),
  25. child: Container(
  26. color: Colors.white,
  27. ),
  28. ),
  29. Column(
  30. crossAxisAlignment: CrossAxisAlignment.center,
  31. children: [
  32. CommonView.buildAppBar(StringName.feedBack,
  33. backOnTap: controller.back, titleCenter: false),
  34. SizedBox(height: 12.w),
  35. Align(
  36. alignment: Alignment.centerLeft,
  37. child: Padding(
  38. padding: EdgeInsets.only(left: 14.w),
  39. child: Text(StringName.feedBackTitle,
  40. style: TextStyle(fontSize: 14.sp, color: '#202020'.color)),
  41. ),
  42. ),
  43. SizedBox(height: 12.w),
  44. buildFeedbackPrintView(),
  45. Spacer(),
  46. GestureDetector(
  47. onTap: controller.submit,
  48. child: Container(
  49. width: 240.w,
  50. height: 50.w,
  51. decoration: BoxDecoration(
  52. color: ColorName.colorPrimary,
  53. borderRadius: BorderRadius.circular(100.w),
  54. ),
  55. child: Center(
  56. child: Text(StringName.feedBackSubmitTxt,
  57. style: TextStyle(fontSize: 16.sp, color: ColorName.white)),
  58. ),
  59. ),
  60. ),
  61. SizedBox(height: 24.w),
  62. GestureDetector(
  63. onTap: controller.onCustomerServiceClick,
  64. child: Text(StringName.feedBackCustomerService,
  65. style: TextStyle(
  66. decoration: TextDecoration.underline,
  67. fontSize: 14.sp,
  68. color: ColorName.black)),
  69. ),
  70. ],
  71. )
  72. ],
  73. );
  74. }
  75. Widget buildFeedbackPrintView() {
  76. return Container(
  77. margin: EdgeInsets.symmetric(horizontal: 12.w),
  78. height: 270.h,
  79. decoration: BoxDecoration(
  80. color: '#FAFAFA'.color,
  81. borderRadius: BorderRadius.circular(6.w),
  82. ),
  83. child: Stack(children: [
  84. TextField(
  85. keyboardType: TextInputType.multiline,
  86. maxLength: 500,
  87. maxLines: null,
  88. minLines: 12,
  89. style: TextStyle(fontSize: 14.sp, color: ColorName.primaryTextColor),
  90. decoration: InputDecoration(
  91. counterText: "",
  92. border: InputBorder.none,
  93. fillColor: Colors.transparent,
  94. hintText: StringName.feedBackHint,
  95. hintStyle: TextStyle(fontSize: 14.sp, color: '#A7A7A7'.color),
  96. contentPadding: EdgeInsets.only(
  97. left: 12.w, right: 12.w, top: 12.w, bottom: 28.w),
  98. ),
  99. onChanged: (value) {
  100. controller.content = value;
  101. },
  102. scrollPhysics: ClampingScrollPhysics(),
  103. ),
  104. Obx(() {
  105. return Positioned(
  106. bottom: 10.w,
  107. right: 12.w,
  108. child: Text('${controller.content.length}/500',
  109. style: TextStyle(fontSize: 14.sp, color: '#A7A7A7'.color)),
  110. );
  111. })
  112. ]),
  113. );
  114. }
  115. }