| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:flutter_spinkit/flutter_spinkit.dart';
- import 'package:get/get.dart';
- import 'package:nomo/app/base/base_view.dart';
- import 'package:nomo/app/widgets/click_opacity.dart';
- import 'package:nomo/app/widgets/ix_app_bar.dart';
- import 'package:nomo/config/theme/theme_extensions/theme_extension.dart';
- import '../controllers/feedback_controller.dart';
- class FeedbackView extends BaseView<FeedbackController> {
- const FeedbackView({super.key});
- @override
- PreferredSizeWidget? get appBar => IXAppBar(title: 'Feedback');
- @override
- Widget buildContent(BuildContext context) {
- return Padding(
- padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 10.w),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- // 反馈内容输入区域
- Expanded(
- child: Container(
- decoration: BoxDecoration(
- color: Get.reactiveTheme.highlightColor,
- borderRadius: BorderRadius.circular(12.r),
- border: Border.all(
- color: Get.reactiveTheme.dividerColor,
- width: 1.w,
- ),
- ),
- child: Padding(
- padding: EdgeInsets.all(14.w),
- child: TextField(
- controller: controller.feedbackController,
- maxLines: null,
- expands: true,
- textAlignVertical: TextAlignVertical.top,
- cursorHeight: 18.w,
- style: TextStyle(
- fontSize: 16.sp,
- height: 1.4,
- color: Get.reactiveTheme.textTheme.bodyLarge!.color,
- fontWeight: FontWeight.w400,
- ),
- decoration: InputDecoration(
- hintText:
- 'An English version for reference: Describe\nyour issue or suggestion...',
- hintStyle: TextStyle(
- fontSize: 16.sp,
- height: 1.4,
- fontWeight: FontWeight.w400,
- color: Get.reactiveTheme.hintColor,
- ),
- border: InputBorder.none,
- contentPadding: EdgeInsets.zero,
- ),
- ),
- ),
- ),
- ),
- 20.verticalSpaceFromWidth,
- // 邮箱输入区域
- Container(
- height: 50.w,
- alignment: Alignment.center,
- decoration: BoxDecoration(
- color: Get.reactiveTheme.highlightColor,
- borderRadius: BorderRadius.circular(12.r),
- border: Border.all(
- color: Get.reactiveTheme.dividerColor,
- width: 1.w,
- ),
- ),
- child: Padding(
- padding: EdgeInsets.symmetric(horizontal: 14.w),
- child: TextField(
- controller: controller.emailController,
- maxLines: 1, // 邮箱输入通常只需要一行
- cursorHeight: 18.w,
- scrollPadding: EdgeInsets.zero,
- style: TextStyle(
- fontSize: 16.sp,
- height: 1.4,
- color: Get.reactiveTheme.textTheme.bodyLarge!.color,
- fontWeight: FontWeight.w400,
- ),
- decoration: InputDecoration(
- hintText: 'Enter your email',
- hintStyle: TextStyle(
- fontSize: 16.sp,
- height: 1.4,
- fontWeight: FontWeight.w400,
- color: Get.reactiveTheme.hintColor,
- ),
- border: InputBorder.none,
- contentPadding: EdgeInsets.zero,
- ),
- ),
- ),
- ),
- 10.verticalSpaceFromWidth,
- Text(
- '• Your email address (for our reply)',
- style: TextStyle(
- fontSize: 13.sp,
- height: 1.4,
- fontWeight: FontWeight.w400,
- color: Get.reactiveTheme.hintColor,
- ),
- ),
- 30.verticalSpaceFromWidth,
- // 发送按钮
- Expanded(
- child: SafeArea(
- child: Container(
- alignment: Alignment.bottomCenter,
- child: Obx(
- () => ClickOpacity(
- onTap: controller.isSubmitting.value
- ? null
- : controller.submitFeedback,
- child: Container(
- width: double.infinity,
- height: 50.w,
- decoration: BoxDecoration(
- color:
- controller.canSubmit &&
- !controller.isSubmitting.value
- ? Get.reactiveTheme.shadowColor
- : Get.reactiveTheme.highlightColor,
- borderRadius: BorderRadius.circular(12.r),
- ),
- child: Center(
- child: controller.isSubmitting.value
- ? SpinKitRing(
- size: 20.w,
- lineWidth: 2.w,
- color: Colors.white,
- )
- : Text(
- 'Send',
- style: TextStyle(
- fontSize: 16.sp,
- fontWeight: FontWeight.w400,
- color: controller.canSubmit
- ? Get
- .reactiveTheme
- .textTheme
- .bodyLarge!
- .color
- : Get.reactiveTheme.hintColor,
- ),
- ),
- ),
- ),
- ),
- ),
- ),
- ),
- ),
- ],
- ),
- );
- }
- }
|