feedback_page.dart 6.1 KB

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