feedback_view.dart 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_screenutil/flutter_screenutil.dart';
  3. import 'package:get/get.dart';
  4. import 'package:nomo/app/base/base_view.dart';
  5. import 'package:nomo/app/widgets/click_opacity.dart';
  6. import 'package:nomo/app/widgets/ix_app_bar.dart';
  7. import 'package:nomo/config/theme/theme_extensions/theme_extension.dart';
  8. import '../controllers/feedback_controller.dart';
  9. class FeedbackView extends BaseView<FeedbackController> {
  10. const FeedbackView({super.key});
  11. @override
  12. Widget buildContent(BuildContext context) {
  13. return Column(
  14. children: [
  15. IXAppBar(title: 'Feedback'),
  16. Expanded(
  17. child: Padding(
  18. padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 20.h),
  19. child: Column(
  20. children: [
  21. // 反馈内容输入区域
  22. Expanded(
  23. child: Container(
  24. decoration: BoxDecoration(
  25. color: Get.reactiveTheme.highlightColor,
  26. borderRadius: BorderRadius.circular(16.r),
  27. ),
  28. child: Padding(
  29. padding: EdgeInsets.all(20.w),
  30. child: TextField(
  31. controller: controller.feedbackController,
  32. maxLines: null,
  33. expands: true,
  34. textAlignVertical: TextAlignVertical.top,
  35. style: TextStyle(fontSize: 16.sp, color: Colors.white),
  36. decoration: InputDecoration(
  37. hintText:
  38. 'An English version for reference: Describe\nyour issue or suggestion...',
  39. hintStyle: TextStyle(
  40. fontSize: 16.sp,
  41. color: Get.reactiveTheme.hintColor,
  42. ),
  43. border: InputBorder.none,
  44. contentPadding: EdgeInsets.zero,
  45. ),
  46. ),
  47. ),
  48. ),
  49. ),
  50. SizedBox(height: 20.h),
  51. // 邮箱输入区域
  52. Container(
  53. decoration: BoxDecoration(
  54. color: Get.reactiveTheme.highlightColor,
  55. borderRadius: BorderRadius.circular(16.r),
  56. ),
  57. child: Padding(
  58. padding: EdgeInsets.all(20.w),
  59. child: Column(
  60. crossAxisAlignment: CrossAxisAlignment.start,
  61. children: [
  62. TextField(
  63. controller: controller.emailController,
  64. style: TextStyle(
  65. fontSize: 16.sp,
  66. color: Colors.white,
  67. ),
  68. decoration: InputDecoration(
  69. hintText: 'Enter your email',
  70. hintStyle: TextStyle(
  71. fontSize: 16.sp,
  72. color: Get.reactiveTheme.hintColor,
  73. ),
  74. border: InputBorder.none,
  75. contentPadding: EdgeInsets.zero,
  76. ),
  77. ),
  78. SizedBox(height: 8.h),
  79. Text(
  80. '• Your email address (for our reply)',
  81. style: TextStyle(
  82. fontSize: 12.sp,
  83. color: Get.reactiveTheme.hintColor,
  84. ),
  85. ),
  86. ],
  87. ),
  88. ),
  89. ),
  90. SizedBox(height: 30.h),
  91. // 发送按钮
  92. Obx(
  93. () => ClickOpacity(
  94. onTap: controller.isSubmitting.value
  95. ? null
  96. : controller.submitFeedback,
  97. child: Container(
  98. width: double.infinity,
  99. height: 52.h,
  100. decoration: BoxDecoration(
  101. color:
  102. controller.canSubmit &&
  103. !controller.isSubmitting.value
  104. ? const Color(0xFF00A8E8)
  105. : Get.reactiveTheme.hintColor.withOpacity(0.3),
  106. borderRadius: BorderRadius.circular(26.r),
  107. ),
  108. child: Center(
  109. child: controller.isSubmitting.value
  110. ? SizedBox(
  111. width: 20.w,
  112. height: 20.w,
  113. child: CircularProgressIndicator(
  114. strokeWidth: 2,
  115. valueColor: AlwaysStoppedAnimation<Color>(
  116. Colors.white,
  117. ),
  118. ),
  119. )
  120. : Text(
  121. 'Send',
  122. style: TextStyle(
  123. fontSize: 16.sp,
  124. fontWeight: FontWeight.w600,
  125. color: controller.canSubmit
  126. ? Colors.white
  127. : Get.reactiveTheme.hintColor,
  128. ),
  129. ),
  130. ),
  131. ),
  132. ),
  133. ),
  134. ],
  135. ),
  136. ),
  137. ),
  138. ],
  139. );
  140. }
  141. }