feed_back_page.dart 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 Column(
  22. crossAxisAlignment: CrossAxisAlignment.center,
  23. children: [
  24. CommonView.buildAppBar(StringName.feedBack,
  25. backOnTap: controller.back, titleCenter: false),
  26. SizedBox(height: 12.w),
  27. Align(
  28. alignment: Alignment.centerLeft,
  29. child: Padding(
  30. padding: EdgeInsets.only(left: 14.w),
  31. child: Text(StringName.feedBackTitle,
  32. style: TextStyle(fontSize: 14.sp, color: '#202020'.color)),
  33. ),
  34. ),
  35. SizedBox(height: 12.w),
  36. buildFeedbackPrintView(),
  37. SizedBox(height: 120.w),
  38. GestureDetector(
  39. onTap: controller.submit,
  40. child: Container(
  41. width: 240.w,
  42. height: 50.w,
  43. decoration: BoxDecoration(
  44. color: ColorName.colorPrimary,
  45. borderRadius: BorderRadius.circular(100.w),
  46. ),
  47. child: Center(
  48. child: Text(StringName.feedBackSubmitTxt,
  49. style: TextStyle(fontSize: 16.sp, color: ColorName.white)),
  50. ),
  51. ),
  52. ),
  53. SizedBox(height: 24.w),
  54. GestureDetector(
  55. onTap: controller.onCustomerServiceClick,
  56. child: Text(StringName.feedBackCustomerService,
  57. style: TextStyle(
  58. decoration: TextDecoration.underline,
  59. fontSize: 14.sp,
  60. color: ColorName.black)),
  61. )
  62. ],
  63. );
  64. }
  65. Widget buildFeedbackPrintView() {
  66. return Container(
  67. margin: EdgeInsets.symmetric(horizontal: 12.w),
  68. decoration: BoxDecoration(
  69. color: '#FAFAFA'.color,
  70. borderRadius: BorderRadius.circular(6.w),
  71. ),
  72. child: Stack(children: [
  73. TextField(
  74. keyboardType: TextInputType.multiline,
  75. maxLength: 500,
  76. maxLines: null,
  77. minLines: 12,
  78. style: TextStyle(fontSize: 14.sp, color: ColorName.primaryTextColor),
  79. decoration: InputDecoration(
  80. counterText: "",
  81. border: InputBorder.none,
  82. fillColor: Colors.transparent,
  83. hintText: StringName.feedBackHint,
  84. hintStyle: TextStyle(fontSize: 14.sp, color: '#A7A7A7'.color),
  85. contentPadding: EdgeInsets.only(
  86. left: 12.w, right: 12.w, top: 12.w, bottom: 28.w),
  87. ),
  88. onChanged: (value) {
  89. controller.content = value;
  90. },
  91. ),
  92. Obx(() {
  93. return Positioned(
  94. bottom: 10.w,
  95. right: 12.w,
  96. child: Text('${controller.content.length}/500',
  97. style: TextStyle(fontSize: 14.sp, color: '#A7A7A7'.color)),
  98. );
  99. })
  100. ]),
  101. );
  102. }
  103. }