feedback_page.dart 6.1 KB

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