feed_back_page.dart 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. Spacer(),
  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. Spacer(),
  63. ],
  64. );
  65. }
  66. Widget buildFeedbackPrintView() {
  67. return Container(
  68. margin: EdgeInsets.symmetric(horizontal: 12.w),
  69. decoration: BoxDecoration(
  70. color: '#FAFAFA'.color,
  71. borderRadius: BorderRadius.circular(6.w),
  72. ),
  73. child: Stack(children: [
  74. TextField(
  75. keyboardType: TextInputType.multiline,
  76. maxLength: 500,
  77. maxLines: null,
  78. minLines: 12,
  79. style: TextStyle(fontSize: 14.sp, color: ColorName.primaryTextColor),
  80. decoration: InputDecoration(
  81. counterText: "",
  82. border: InputBorder.none,
  83. fillColor: Colors.transparent,
  84. hintText: StringName.feedBackHint,
  85. hintStyle: TextStyle(fontSize: 14.sp, color: '#A7A7A7'.color),
  86. contentPadding: EdgeInsets.only(
  87. left: 12.w, right: 12.w, top: 12.w, bottom: 28.w),
  88. ),
  89. onChanged: (value) {
  90. controller.content = value;
  91. },
  92. ),
  93. Obx(() {
  94. return Positioned(
  95. bottom: 10.w,
  96. right: 12.w,
  97. child: Text('${controller.content.length}/500',
  98. style: TextStyle(fontSize: 14.sp, color: '#A7A7A7'.color)),
  99. );
  100. })
  101. ]),
  102. );
  103. }
  104. }