|
@@ -8,6 +8,9 @@ import '../../../../data/bean/option_select_item.dart';
|
|
|
import '../../../../resource/assets.gen.dart';
|
|
import '../../../../resource/assets.gen.dart';
|
|
|
import '../../../../resource/colors.gen.dart';
|
|
import '../../../../resource/colors.gen.dart';
|
|
|
import '../../../../resource/string.gen.dart';
|
|
import '../../../../resource/string.gen.dart';
|
|
|
|
|
+import '../../../../widget/actionbtn/action_btn.dart';
|
|
|
|
|
+import '../../../../widget/gradient_text.dart';
|
|
|
|
|
+import '../../intimacy_analyse_upload/popup/reply_mode_select_popup.dart';
|
|
|
import '../../intimacy_analyse_upload/widget/upload_item_widget.dart';
|
|
import '../../intimacy_analyse_upload/widget/upload_item_widget.dart';
|
|
|
import '../../widget/option_select_widget.dart';
|
|
import '../../widget/option_select_widget.dart';
|
|
|
import '../../widget/step_card.dart';
|
|
import '../../widget/step_card.dart';
|
|
@@ -15,7 +18,10 @@ import 'package:keyboard/module/intimacy_analyse/screenshot_reply/scan_image_rep
|
|
|
|
|
|
|
|
/// 识图回复Tab页
|
|
/// 识图回复Tab页
|
|
|
class ScanImageReplyView extends BaseView<ScanImageReplyController> {
|
|
class ScanImageReplyView extends BaseView<ScanImageReplyController> {
|
|
|
- const ScanImageReplyView({super.key});
|
|
|
|
|
|
|
+ ScanImageReplyView({super.key});
|
|
|
|
|
+
|
|
|
|
|
+ /// 回复模式,切换按钮的GlobalKey
|
|
|
|
|
+ final GlobalKey _replyModeSwitchBtnAnchorKey = GlobalKey();
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
|
Color backgroundColor() {
|
|
Color backgroundColor() {
|
|
@@ -273,16 +279,153 @@ class ScanImageReplyView extends BaseView<ScanImageReplyController> {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// 获取回复按钮
|
|
|
|
|
+ Widget _buildGetReplayBtn() {
|
|
|
|
|
+ return GestureDetector(
|
|
|
|
|
+ onTap: () {
|
|
|
|
|
+ controller.clickGetReplyBtn();
|
|
|
|
|
+ },
|
|
|
|
|
+ child: Container(
|
|
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 14.h),
|
|
|
|
|
+ width: double.maxFinite,
|
|
|
|
|
+ decoration: ShapeDecoration(
|
|
|
|
|
+ // 渐变背景
|
|
|
|
|
+ gradient: LinearGradient(
|
|
|
|
|
+ colors: [ColorName.purpleGradient3, ColorName.purpleGradient4],
|
|
|
|
|
+ begin: Alignment.centerLeft,
|
|
|
|
|
+ end: Alignment.centerRight,
|
|
|
|
|
+ ),
|
|
|
|
|
+ shape: RoundedRectangleBorder(
|
|
|
|
|
+ borderRadius: BorderRadius.circular(50.r),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ child: Center(
|
|
|
|
|
+ child: Text(
|
|
|
|
|
+ StringName.intimacyAnalyseGetReply,
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ color: ColorName.white,
|
|
|
|
|
+ fontSize: 16.sp,
|
|
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /// Ai模型切换按钮
|
|
|
|
|
+ Widget _buildReplyModelSwitchBtn() {
|
|
|
|
|
+ return Builder(
|
|
|
|
|
+ builder: (context) {
|
|
|
|
|
+ return GestureDetector(
|
|
|
|
|
+ key: _replyModeSwitchBtnAnchorKey,
|
|
|
|
|
+ onTap: () {
|
|
|
|
|
+ // 显示回复切换的Popup弹窗
|
|
|
|
|
+ if (ReplyModeSelectPopup.isShowing()) {
|
|
|
|
|
+ ReplyModeSelectPopup.dismiss();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 切换回复模式
|
|
|
|
|
+ ReplyModeSelectPopup.show(
|
|
|
|
|
+ _replyModeSwitchBtnAnchorKey,
|
|
|
|
|
+ context,
|
|
|
|
|
+ modeList: controller.replyModelList.toList(),
|
|
|
|
|
+ currentMode: controller.currentReplyMode.value,
|
|
|
|
|
+ onChooseReplyModeCallback: (String newMode) {
|
|
|
|
|
+ controller.switchReplyMode(newMode);
|
|
|
|
|
+ },
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ child: Container(
|
|
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 12.h, horizontal: 14.w),
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ color: ColorName.white,
|
|
|
|
|
+ borderRadius: BorderRadius.all(Radius.circular(30.w)),
|
|
|
|
|
+ border: Border.all(
|
|
|
|
|
+ color: ColorName.bgAiModelSwitchBorderBtn,
|
|
|
|
|
+ width: 1.w,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ child: Row(
|
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
+ children: [
|
|
|
|
|
+ Obx(() {
|
|
|
|
|
+ return
|
|
|
|
|
+ // 文字
|
|
|
|
|
+ GradientText(
|
|
|
|
|
+ colors: [
|
|
|
|
|
+ ColorName.aiModelSwitchBtnColor1,
|
|
|
|
|
+ ColorName.aiModelSwitchBtnColor2,
|
|
|
|
|
+ ],
|
|
|
|
|
+ child: Text(
|
|
|
|
|
+ controller.currentReplyMode.value,
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ fontSize: 14.sp,
|
|
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }),
|
|
|
|
|
+ SizedBox(width: 8.w),
|
|
|
|
|
+ // 箭头
|
|
|
|
|
+ Assets.images.iconModeSwitchArrow.image(
|
|
|
|
|
+ width: 15.w,
|
|
|
|
|
+ height: 15.w,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /// 底部操作按钮
|
|
|
|
|
+ Widget _buildBottomActionBtn() {
|
|
|
|
|
+ if (controller.isUploadPage.value) {
|
|
|
|
|
+ // 上传页,显示上传截图按钮
|
|
|
|
|
+ return Container(
|
|
|
|
|
+ width: double.maxFinite,
|
|
|
|
|
+ margin: EdgeInsets.only(
|
|
|
|
|
+ left: 16.w,
|
|
|
|
|
+ top: 8.h,
|
|
|
|
|
+ right: 16.w,
|
|
|
|
|
+ bottom: 20.h,
|
|
|
|
|
+ ),
|
|
|
|
|
+ child: _buildUploadScreenshotBtn(),
|
|
|
|
|
+ );
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 结果页,显示2个按钮,模式切换按钮和获取回复按钮
|
|
|
|
|
+ return Container(
|
|
|
|
|
+ width: double.maxFinite,
|
|
|
|
|
+ margin: EdgeInsets.only(
|
|
|
|
|
+ left: 16.w,
|
|
|
|
|
+ top: 8.h,
|
|
|
|
|
+ right: 16.w,
|
|
|
|
|
+ bottom: 20.h,
|
|
|
|
|
+ ),
|
|
|
|
|
+ child: ActionBtn(
|
|
|
|
|
+ leftBtn: _buildReplyModelSwitchBtn(),
|
|
|
|
|
+ spaceWidget: SizedBox(width: 10.w,),
|
|
|
|
|
+ rightBtn: _buildGetReplayBtn(),
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/// 底部布局
|
|
/// 底部布局
|
|
|
Widget _buildBottomLayout(BuildContext context) {
|
|
Widget _buildBottomLayout(BuildContext context) {
|
|
|
- return Column(
|
|
|
|
|
- // 高度包裹内容
|
|
|
|
|
- mainAxisSize: MainAxisSize.min,
|
|
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
- children: [
|
|
|
|
|
- // 上传截图按钮
|
|
|
|
|
- _buildUploadScreenshotBtn(), SizedBox(height: 20.h),
|
|
|
|
|
- ],
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ return Obx(() {
|
|
|
|
|
+ return Column(
|
|
|
|
|
+ // 高度包裹内容
|
|
|
|
|
+ mainAxisSize: MainAxisSize.min,
|
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
+ children: [
|
|
|
|
|
+ // 操作按钮
|
|
|
|
|
+ _buildBottomActionBtn(),
|
|
|
|
|
+ ],
|
|
|
|
|
+ );
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|