@ -1,7 +1,6 @@
import ' package:flutter/material.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:get/get.dart ' ;
import ' package:get/get.dart ' ;
import ' package:flutter_screenutil/flutter_screenutil.dart ' ;
import ' package:flutter_screenutil/flutter_screenutil.dart ' ;
import ' dart:ui ' ;
import ' ../controllers/feedback_controller.dart ' ;
import ' ../controllers/feedback_controller.dart ' ;
class FeedbackView extends GetView < FeedbackController > {
class FeedbackView extends GetView < FeedbackController > {
@ -51,148 +50,120 @@ class FeedbackView extends GetView<FeedbackController> {
) ,
) ,
SizedBox ( height: 16. h ) ,
SizedBox ( height: 16. h ) ,
/ / 反 馈 内 容 输 入 框
/ / 反 馈 内 容 输 入 框 - 统 一 容 器 样 式
Container (
Container (
decoration: BoxDecoration (
decoration: BoxDecoration (
color: isDarkMode
/ / 保 持 适 合 各 自 模 式 的 背 景 色
? Colors . white . withOpacity ( 0.05 )
color: isDarkMode ? Colors . grey [ 800 ] : Colors . white ,
: Colors . white ,
/ / 统 一 圆 角
borderRadius: BorderRadius . circular ( 16. r ) ,
borderRadius: BorderRadius . circular ( 16. r ) ,
/ / 统 一 阴 影 效 果 - 关 键 改 进 点
boxShadow: [
boxShadow: [
BoxShadow (
BoxShadow (
color: isDarkMode
color: isDarkMode
? Colors . black . withOpacity ( 0.2 )
? Colors . black . withOpacity ( 0.3 )
: Colors . black . withOpacity ( 0.05 ) ,
: Colors . black . withOpacity ( 0.08 ) ,
blurRadius: 10 ,
blurRadius: 12 ,
offset: const Offset ( 0 , 2 ) ,
offset: const Offset ( 0 , 4 ) ,
spreadRadius: 0 ,
) ,
) ,
] ,
] ,
/ / 统 一 边 框 样 式 - 关 键 改 进 点
border: Border . all (
color: isDarkMode ? Colors . grey [ 700 ] ! : Colors . grey [ 200 ] ! ,
width: 1.5 ,
) ,
) ,
) ,
child: ClipRRect (
child: Padding (
borderRadius: BorderRadius . circular ( 16. r ) ,
padding:
child: BackdropFilter (
EdgeInsets . symmetric ( horizontal: 16. w , vertical: 12. h ) ,
filter: isDarkMode
child: TextFormField (
? ImageFilter . blur ( sigmaX: 5 , sigmaY: 5 )
controller: controller . feedbackController ,
: ImageFilter . blur ( sigmaX: 0 , sigmaY: 0 ) ,
maxLines: 8 ,
child: Padding (
maxLength: 500 ,
padding:
style: TextStyle (
EdgeInsets . symmetric ( horizontal: 16. w , vertical: 8. h ) ,
color: isDarkMode ? Colors . white : Colors . black87 ,
child: TextFormField (
fontSize: 14. sp ,
controller: controller . feedbackController ,
height: 1.4 ,
maxLines: 8 ,
) ,
maxLength: 500 ,
decoration: InputDecoration (
style: TextStyle (
hintText: ' feedbackHint ' . tr , / / 请 输 入 您 的 反 馈 内 容 . . .
color: isDarkMode ? Colors . white : Colors . black87 ,
hintStyle: TextStyle (
) ,
color: isDarkMode ? Colors . grey [ 400 ] : Colors . grey [ 500 ] ,
decoration: InputDecoration (
fontSize: 14. sp ,
hintText: ' feedbackHint ' . tr , / / 请 输 入 您 的 反 馈 内 容 . . .
) ,
hintStyle: TextStyle (
border: InputBorder . none ,
color: isDarkMode ? Colors . white38 : Colors . black38 ,
focusedBorder: InputBorder . none ,
) ,
counterStyle: TextStyle (
border: InputBorder . none ,
color: isDarkMode ? Colors . grey [ 400 ] : Colors . grey [ 600 ] ,
counterStyle: TextStyle (
fontSize: 12. sp ,
color: isDarkMode ? Colors . white54 : Colors . black54 ,
) ,
) ,
validator: ( value ) {
if ( value = = null | | value . trim ( ) . isEmpty ) {
return ' feedbackRequired ' . tr ; / / 请 输 入 反 馈 内 容
}
return null ;
} ,
) ,
) ,
contentPadding: EdgeInsets . zero ,
fillColor: Colors . transparent ,
filled: true ,
) ,
) ,
validator: ( value ) {
if ( value = = null | | value . trim ( ) . isEmpty ) {
return ' feedbackRequired ' . tr ; / / 请 输 入 反 馈 内 容
}
return null ;
} ,
) ,
) ,
) ,
) ,
) ,
) ,
SizedBox ( height: 24. h ) ,
SizedBox ( height: 40. h ) ,
/ / 联 系 方 式 标 题
/ / Text (
/ / ' contactInfo ' . tr , / / 联 系 方 式
/ / style: TextStyle (
/ / fontSize: 14. sp ,
/ / color: isDarkMode ? Colors . white70 : Colors . black54 ,
/ / ) ,
/ / ) ,
/ / SizedBox ( height: 16. h ) ,
/ / / / 联 系 方 式 输 入 框
/ / 提 交 按 钮 - 统 一 容 器 样 式
/ / Container (
Obx ( ( ) = > Container (
/ / decoration: BoxDecoration (
/ / 统 一 按 钮 容 器 装 饰
/ / color: isDarkMode
decoration: BoxDecoration (
/ / ? Colors . white . withOpacity ( 0.05 )
borderRadius: BorderRadius . circular ( 16. r ) ,
/ / : Colors . white ,
/ / 统 一 阴 影 效 果
/ / borderRadius: BorderRadius . circular ( 16. r ) ,
boxShadow: controller . isSubmitting . value
/ / boxShadow: [
? [ ]
/ / BoxShadow (
: [
/ / color: isDarkMode
BoxShadow (
/ / ? Colors . black . withOpacity ( 0.2 )
color: Colors . blue . withOpacity ( 0.3 ) ,
/ / : Colors . black . withOpacity ( 0.05 ) ,
blurRadius: 8 ,
/ / blurRadius: 10 ,
offset: const Offset ( 0 , 4 ) ,
/ / offset: const Offset ( 0 , 2 ) ,
spreadRadius: 0 ,
/ / ) ,
) ,
/ / ] ,
] ,
/ / ) ,
/ / child: ClipRRect (
/ / borderRadius: BorderRadius . circular ( 16. r ) ,
/ / child: BackdropFilter (
/ / filter: isDarkMode
/ / ? ImageFilter . blur ( sigmaX: 5 , sigmaY: 5 )
/ / : ImageFilter . blur ( sigmaX: 0 , sigmaY: 0 ) ,
/ / child: Padding (
/ / padding:
/ / EdgeInsets . symmetric ( horizontal: 16. w , vertical: 8. h ) ,
/ / child: TextFormField (
/ / controller: controller . contactController ,
/ / style: TextStyle (
/ / color: isDarkMode ? Colors . white : Colors . black87 ,
/ / ) ,
/ / decoration: InputDecoration (
/ / hintText: ' contactHint ' . tr , / / 邮 箱 / 手 机 号 , 方 便 我 们 联 系 您
/ / hintStyle: TextStyle (
/ / color: isDarkMode ? Colors . white38 : Colors . black38 ,
/ / ) ,
/ / border: InputBorder . none ,
/ / ) ,
/ / ) ,
/ / ) ,
/ / ) ,
/ / ) ,
/ / ) ,
/ / SizedBox ( height: 40. h ) ,
/ / 提 交 按 钮
Obx ( ( ) = > ElevatedButton (
onPressed: controller . isSubmitting . value
? null
: controller . submitFeedback ,
style: ElevatedButton . styleFrom (
backgroundColor: Colors . blue [ 600 ] ,
padding: EdgeInsets . symmetric ( vertical: 12. h ) ,
shape: RoundedRectangleBorder (
borderRadius: BorderRadius . circular ( 16. r ) ,
) ,
elevation: 0 ,
) ,
) ,
child: controller . isSubmitting . value
child: ElevatedButton (
? SizedBox (
onPressed: controller . isSubmitting . value
height: 20. h ,
? null
width: 20. h ,
: controller . submitFeedback ,
child: CircularProgressIndicator (
style: ElevatedButton . styleFrom (
strokeWidth: 2. w ,
backgroundColor: controller . isSubmitting . value
valueColor: const AlwaysStoppedAnimation < Color > (
? Colors . grey [ 400 ]
Colors . white ) ,
: Colors . blue [ 600 ] ,
) ,
padding: EdgeInsets . symmetric ( vertical: 14. h ) ,
)
shape: RoundedRectangleBorder (
: Text (
borderRadius: BorderRadius . circular ( 16. r ) ,
' submit ' . tr , / / 提 交
) ,
style: TextStyle (
elevation: 0 ,
fontSize: 16. sp ,
shadowColor: Colors . transparent ,
fontWeight: FontWeight . w500 ,
) ,
color: Colors . white ,
child: controller . isSubmitting . value
? SizedBox (
height: 20. h ,
width: 20. h ,
child: CircularProgressIndicator (
strokeWidth: 2. w ,
valueColor: const AlwaysStoppedAnimation < Color > (
Colors . white ) ,
) ,
)
: Text (
' submit ' . tr , / / 提 交
style: TextStyle (
fontSize: 16. sp ,
fontWeight: FontWeight . w600 ,
color: Colors . white ,
) ,
) ,
) ,
) ,
) ,
) ) ,
) ) ,
] ,
] ,
) ,
) ,