feedback_page.dart 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/services.dart';
  3. import 'package:flutter_screenutil/flutter_screenutil.dart';
  4. import 'package:keyboard/base/base_page.dart';
  5. import 'package:keyboard/module/feedback/feedback_controller.dart';
  6. import 'package:get/get.dart';
  7. import 'package:keyboard/resource/colors.gen.dart';
  8. import 'package:keyboard/widget/commonAppBar.dart';
  9. import '../../resource/assets.gen.dart';
  10. import '../../resource/string.gen.dart';
  11. import '../../router/app_pages.dart';
  12. import '../../utils/styles.dart';
  13. class FeedbackPage extends BasePage<FeedbackController> {
  14. const FeedbackPage({super.key});
  15. static start(FeedbackType type) {
  16. Get.toNamed(RoutePath.feedback, arguments: {"type": type});
  17. }
  18. @override
  19. bool immersive() {
  20. return false;
  21. }
  22. @override
  23. void backgroundOnTapEvent() {
  24. // TODO: implement backgroundOnTapEvent
  25. super.backgroundOnTapEvent();
  26. FocusManager.instance.primaryFocus?.unfocus();
  27. }
  28. @override
  29. Color backgroundColor() => Color(0xFFF6F5FA);
  30. @override
  31. Widget buildBody(BuildContext context) {
  32. return Scaffold(
  33. resizeToAvoidBottomInset: false,
  34. backgroundColor: backgroundColor(),
  35. appBar: CommonAppBar(
  36. title: controller.getTitleText(),
  37. backgroundColor: backgroundColor,
  38. onBack: () {
  39. controller.backClick();
  40. },
  41. ),
  42. body: Container(
  43. margin: EdgeInsets.only(left: 16.w, right: 16.w, top: 20.h),
  44. child: Column(
  45. crossAxisAlignment: CrossAxisAlignment.stretch,
  46. children: [
  47. Container(
  48. padding: EdgeInsets.all(16.r),
  49. // height: 221.w,
  50. decoration: BoxDecoration(
  51. color: Colors.white,
  52. borderRadius: BorderRadius.circular(12.r),
  53. ),
  54. child: Column(
  55. crossAxisAlignment: CrossAxisAlignment.start,
  56. children: [
  57. Container(
  58. decoration: BoxDecoration(
  59. color: Colors.white,
  60. borderRadius: BorderRadius.circular(8.r),
  61. ),
  62. child: Column(
  63. crossAxisAlignment: CrossAxisAlignment.start,
  64. children: [
  65. Text(
  66. controller.getContentTitle(),
  67. style: TextStyle(
  68. color: Colors.black,
  69. fontSize: 14.sp,
  70. fontWeight: FontWeight.w400,
  71. ),
  72. ),
  73. SizedBox(height: 8.h),
  74. SizedBox(
  75. height: 161.h,
  76. child: TextField(
  77. maxLength: 300,
  78. maxLines: null,
  79. expands: true,
  80. textAlignVertical: TextAlignVertical.top,
  81. decoration: InputDecoration(
  82. hintText: controller.getContentHint(),
  83. hintStyle: TextStyle(
  84. color: Colors.black.withAlpha(66),
  85. ),
  86. border: OutlineInputBorder(
  87. borderRadius: BorderRadius.circular(10.r),
  88. borderSide: BorderSide.none, // 移除边框线
  89. ),
  90. filled: true,
  91. fillColor: const Color(0xFFF5F4F9),
  92. ),
  93. onChanged: (value) {
  94. controller.onContentChanged(value);
  95. },
  96. ),
  97. ),
  98. ],
  99. ),
  100. ),
  101. ],
  102. ),
  103. ),
  104. SizedBox(height: 8.h),
  105. Container(
  106. padding: EdgeInsets.all(16.r),
  107. decoration: BoxDecoration(
  108. color: Colors.white,
  109. borderRadius: BorderRadius.circular(12),
  110. ),
  111. child: Column(
  112. crossAxisAlignment: CrossAxisAlignment.start,
  113. children: [
  114. Text(
  115. StringName.feedbackPhone,
  116. style: TextStyle(
  117. fontSize: 16,
  118. color: Colors.black.withAlpha(204),
  119. ),
  120. ),
  121. const SizedBox(height: 8),
  122. SizedBox(
  123. height: 48.h,
  124. child: TextField(
  125. inputFormatters: [FilteringTextInputFormatter.digitsOnly],
  126. maxLength: 11,
  127. maxLines: null,
  128. expands: true,
  129. textAlignVertical: TextAlignVertical.top,
  130. decoration: InputDecoration(
  131. counterText: "",
  132. hintText: StringName.feedbackPhoneHint,
  133. hintStyle: TextStyle(color: Colors.black.withAlpha(66)),
  134. border: OutlineInputBorder(
  135. borderRadius: BorderRadius.circular(10.r),
  136. borderSide: BorderSide.none,
  137. ),
  138. filled: true,
  139. fillColor: const Color(0xFFF5F4F9),
  140. ),
  141. onChanged: (value) {
  142. controller.onPhoneChanged(value);
  143. },
  144. ),
  145. ),
  146. ],
  147. ),
  148. ),
  149. Spacer(),
  150. GestureDetector(
  151. onTap: () {
  152. controller.submitClick();
  153. },
  154. child: Container(
  155. height: 48.h,
  156. alignment: Alignment.center,
  157. decoration: Styles.getActivateButtonDecoration(31.r),
  158. child: Text(
  159. StringName.feedbackSubmit,
  160. style: Styles.getTextStyleWhiteW500(16.sp),
  161. ),
  162. ),
  163. ),
  164. SizedBox(height: 16.h),
  165. ],
  166. ),
  167. ),
  168. );
  169. }
  170. }