|
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
import 'package:get/get.dart';
|
|
import 'package:get/get.dart';
|
|
|
import 'package:keyboard/base/base_page.dart';
|
|
import 'package:keyboard/base/base_page.dart';
|
|
|
|
|
+import 'package:keyboard/module/intimacy_analyse/intimacy_analyse_upload/popup/ai_model_select_popup.dart';
|
|
|
import 'package:keyboard/module/intimacy_analyse/intimacy_analyse_upload/widget/step_label_widget.dart';
|
|
import 'package:keyboard/module/intimacy_analyse/intimacy_analyse_upload/widget/step_label_widget.dart';
|
|
|
import 'package:keyboard/module/intimacy_analyse/intimacy_analyse_upload/widget/upload_add_widget.dart';
|
|
import 'package:keyboard/module/intimacy_analyse/intimacy_analyse_upload/widget/upload_add_widget.dart';
|
|
|
import 'package:keyboard/module/intimacy_analyse/intimacy_analyse_upload/widget/upload_item_widget.dart';
|
|
import 'package:keyboard/module/intimacy_analyse/intimacy_analyse_upload/widget/upload_item_widget.dart';
|
|
@@ -15,6 +16,7 @@ import '../../../resource/assets.gen.dart';
|
|
|
import '../../../router/app_page_arguments.dart';
|
|
import '../../../router/app_page_arguments.dart';
|
|
|
import '../../../router/app_pages.dart';
|
|
import '../../../router/app_pages.dart';
|
|
|
import '../../../utils/string_format_util.dart';
|
|
import '../../../utils/string_format_util.dart';
|
|
|
|
|
+import '../../../widget/actionbtn/action_btn.dart';
|
|
|
import '../../../widget/gradient_text.dart';
|
|
import '../../../widget/gradient_text.dart';
|
|
|
import '../widget/intimacy_user_widget.dart';
|
|
import '../widget/intimacy_user_widget.dart';
|
|
|
import '../widget/step_card.dart';
|
|
import '../widget/step_card.dart';
|
|
@@ -23,7 +25,10 @@ import 'intimacy_analyse_upload_controller.dart';
|
|
|
/// 亲密度分析上传页
|
|
/// 亲密度分析上传页
|
|
|
class IntimacyAnalyseUploadPage
|
|
class IntimacyAnalyseUploadPage
|
|
|
extends BasePage<IntimacyAnalyseUploadController> {
|
|
extends BasePage<IntimacyAnalyseUploadController> {
|
|
|
- const IntimacyAnalyseUploadPage({super.key});
|
|
|
|
|
|
|
+ IntimacyAnalyseUploadPage({super.key});
|
|
|
|
|
+
|
|
|
|
|
+ /// Ai模型切换按钮的GlobalKey
|
|
|
|
|
+ final GlobalKey _aiModelSwitchBtnAnchorKey = GlobalKey();
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
|
bool immersive() {
|
|
bool immersive() {
|
|
@@ -56,7 +61,14 @@ class IntimacyAnalyseUploadPage
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
child: Column(
|
|
child: Column(
|
|
|
- children: [_buildStatusBar(), _buildTopBar(), _buildContent()],
|
|
|
|
|
|
|
+ children: [
|
|
|
|
|
+ // 状态栏占位
|
|
|
|
|
+ _buildStatusBar(),
|
|
|
|
|
+ // 顶部栏
|
|
|
|
|
+ _buildTopBar(),
|
|
|
|
|
+ // 内容区域
|
|
|
|
|
+ _buildContent(),
|
|
|
|
|
+ ],
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
);
|
|
);
|
|
@@ -306,18 +318,137 @@ class IntimacyAnalyseUploadPage
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// 底部操作按钮
|
|
|
|
|
+ Widget _buildBottomActionBtn() {
|
|
|
|
|
+ return Container(
|
|
|
|
|
+ width: double.maxFinite,
|
|
|
|
|
+ margin: EdgeInsets.only(left: 13.w, top: 8.h, right: 13.w, bottom: 20.h),
|
|
|
|
|
+ child: ActionBtn(
|
|
|
|
|
+ leftBtn: _buildAiModelSwitchBtn(),
|
|
|
|
|
+ rightBtn: _buildNextBtn(),
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /// Ai模型切换按钮
|
|
|
|
|
+ Widget _buildAiModelSwitchBtn() {
|
|
|
|
|
+ return Builder(
|
|
|
|
|
+ builder: (context) {
|
|
|
|
|
+ return GestureDetector(
|
|
|
|
|
+ key: _aiModelSwitchBtnAnchorKey,
|
|
|
|
|
+ onTap: () {
|
|
|
|
|
+ if (AiModelSelectPopup.isShowing()) {
|
|
|
|
|
+ AiModelSelectPopup.dismiss();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 切换模型
|
|
|
|
|
+ AiModelSelectPopup.show(
|
|
|
|
|
+ _aiModelSwitchBtnAnchorKey,
|
|
|
|
|
+ context,
|
|
|
|
|
+ aiModelList: controller.aiModelList.toList(),
|
|
|
|
|
+ currentAiModel: controller.currentAiModel.value,
|
|
|
|
|
+ onChooseAiModelCallback: (String newAiModel) {
|
|
|
|
|
+ controller.switchAiModel(newAiModel);
|
|
|
|
|
+ },
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ 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.currentAiModel.value,
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ fontSize: 14.sp,
|
|
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }),
|
|
|
|
|
+ SizedBox(width: 8.w),
|
|
|
|
|
+ // 箭头
|
|
|
|
|
+ Assets.images.iconModeSwitchArrow.image(
|
|
|
|
|
+ width: 15.w,
|
|
|
|
|
+ height: 15.w,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /// 下一步按钮
|
|
|
|
|
+ Widget _buildNextBtn() {
|
|
|
|
|
+ return Container(
|
|
|
|
|
+ padding: EdgeInsets.only(top: 13.h, bottom: 13.h),
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ color: ColorName.colorBrand,
|
|
|
|
|
+ borderRadius: BorderRadius.all(Radius.circular(30.r)),
|
|
|
|
|
+ ),
|
|
|
|
|
+ child: Row(
|
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
+ children: [
|
|
|
|
|
+ Assets.images.iconLock.image(width: 22.w, height: 22.h),
|
|
|
|
|
+ SizedBox(width: 8.w),
|
|
|
|
|
+ Text(
|
|
|
|
|
+ StringName.nextStep,
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ color: ColorName.white,
|
|
|
|
|
+ fontSize: 16.sp,
|
|
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/// 内容
|
|
/// 内容
|
|
|
Widget _buildContent() {
|
|
Widget _buildContent() {
|
|
|
return Expanded(
|
|
return Expanded(
|
|
|
- child: SingleChildScrollView(
|
|
|
|
|
- child: Column(
|
|
|
|
|
- children: [
|
|
|
|
|
- // 上传卡片
|
|
|
|
|
- _buildUploadStepCard(),
|
|
|
|
|
- // 预测方向卡片
|
|
|
|
|
- _buildPredictionDirectionStepCard(),
|
|
|
|
|
- ],
|
|
|
|
|
- ),
|
|
|
|
|
|
|
+ child: Stack(
|
|
|
|
|
+ children: [
|
|
|
|
|
+ // 长列表
|
|
|
|
|
+ SingleChildScrollView(
|
|
|
|
|
+ child: Column(
|
|
|
|
|
+ children: [
|
|
|
|
|
+ // 上传卡片
|
|
|
|
|
+ _buildUploadStepCard(),
|
|
|
|
|
+ // 预测方向卡片
|
|
|
|
|
+ _buildPredictionDirectionStepCard(),
|
|
|
|
|
+ SizedBox(height: 50.h),
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ // 底部操作按钮
|
|
|
|
|
+ Positioned(
|
|
|
|
|
+ left: 0,
|
|
|
|
|
+ right: 0,
|
|
|
|
|
+ bottom: 0,
|
|
|
|
|
+ child: _buildBottomActionBtn(),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ],
|
|
|
),
|
|
),
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|