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. 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. 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: controller.getTitleText(),
  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. controller.getContentTitle(),
  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. hintText: controller.getContentHint(),
  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. GestureDetector(
  145. onTap: () {
  146. controller.submitClick();
  147. },
  148. child: Container(
  149. height: 48.h,
  150. alignment: Alignment.center,
  151. decoration: Styles.getActivateButtonDecoration(31.r),
  152. child: Text(
  153. StringName.feedbackSubmit,
  154. style: Styles.getTextStyleWhiteW500(16.sp),
  155. ),
  156. ),
  157. ),
  158. SizedBox(height: 16.h),
  159. ],
  160. ),
  161. ),
  162. );
  163. }
  164. }