Selaa lähdekoodia

[fix]亲密度分析,截图回复-识图回复,生成回复结果后,隐藏语气选择卡片

hezihao 7 kuukautta sitten
vanhempi
commit
5b46096b3a

+ 22 - 0
lib/module/intimacy_analyse/screenshot_reply/scan_image_reply/scan_image_reply_controller.dart

@@ -156,6 +156,25 @@ class ScanImageReplyController extends BaseController {
     currentSelectReplyToneOption.value = optionItem;
   }
 
+  /// 重置回复语气选项
+  void resetReplyToneOption() {
+    var newConfigList =
+        replyToneOptionSelectConfigList.toList().map((
+          OptionSelectConfig rowConfig,
+        ) {
+          // 全部取消选中
+          var newOptionList =
+              rowConfig.options.map((item) {
+                item.selected = false;
+                return item;
+              }).toList();
+          rowConfig.options = newOptionList;
+          return rowConfig;
+        }).toList();
+    replyToneOptionSelectConfigList.value = newConfigList;
+    replyToneOptionSelectConfigList.refresh();
+  }
+
   /// 切换回复模型
   void switchReplyMode(ReplyMode newMode) {
     currentReplyMode.value = newMode;
@@ -177,6 +196,9 @@ class ScanImageReplyController extends BaseController {
       // 清空已生成的数据
       isResultGenerating.value = false;
       hasScanResult.value = false;
+      replyToneList.clear();
+      resetReplyToneOption();
+      currentSelectReplyToneOption.value = null;
     }
   }
 

+ 43 - 41
lib/module/intimacy_analyse/screenshot_reply/scan_image_reply/scan_image_reply_view.dart

@@ -57,7 +57,6 @@ class ScanImageReplyView extends BaseView<ScanImageReplyController> {
                   SizedBox(height: 14.h),
                   // 选项卡片
                   _buildOptionCard(),
-                  SizedBox(height: 14.h),
                   // 回复语气列表卡片
                   _buildReplyToneListCard(),
                   // 距离底部有一定间距
@@ -232,53 +231,56 @@ class ScanImageReplyView extends BaseView<ScanImageReplyController> {
 
   /// 选项卡片
   Widget _buildOptionCard() {
-    return Container(
-      width: double.maxFinite,
-      margin: EdgeInsets.only(left: 14.w, right: 14.w),
-      // 圆角背景
-      decoration: BoxDecoration(
-        gradient: LinearGradient(
-          colors: [Color(0xFFEFE9FF), Color(0xFFFBFAFF)],
-          begin: Alignment.topCenter,
-          end: Alignment.bottomRight,
+    return Obx(() {
+      if (controller.replyToneList.isNotEmpty) {
+        return SizedBox.shrink();
+      }
+      return Container(
+        width: double.maxFinite,
+        margin: EdgeInsets.only(left: 14.w, right: 14.w, bottom: 14.h),
+        // 圆角背景
+        decoration: BoxDecoration(
+          gradient: LinearGradient(
+            colors: [Color(0xFFEFE9FF), Color(0xFFFBFAFF)],
+            begin: Alignment.topCenter,
+            end: Alignment.bottomRight,
+          ),
+          shape: BoxShape.rectangle,
+          border: Border.all(color: ColorName.white80, width: 1.w),
+          borderRadius: BorderRadius.all(Radius.circular(20.r)),
         ),
-        shape: BoxShape.rectangle,
-        border: Border.all(color: ColorName.white80, width: 1.w),
-        borderRadius: BorderRadius.all(Radius.circular(20.r)),
-      ),
-      child: Column(
-        children: [
-          Container(
-            margin: EdgeInsets.only(
-              left: 12.w,
-              top: 17.h,
-              right: 12.w,
-              bottom: 12.h,
-            ),
-            padding: EdgeInsets.only(
-              left: 12.w,
-              top: 12.h,
-              right: 12.w,
-              bottom: 12.h,
-            ),
-            decoration: BoxDecoration(
-              color: ColorName.white,
-              borderRadius: BorderRadius.circular(16.r),
-            ),
-            child: Obx(() {
-              return Column(
+        child: Column(
+          children: [
+            Container(
+              margin: EdgeInsets.only(
+                left: 12.w,
+                top: 17.h,
+                right: 12.w,
+                bottom: 12.h,
+              ),
+              padding: EdgeInsets.only(
+                left: 12.w,
+                top: 12.h,
+                right: 12.w,
+                bottom: 12.h,
+              ),
+              decoration: BoxDecoration(
+                color: ColorName.white,
+                borderRadius: BorderRadius.circular(16.r),
+              ),
+              child: Column(
                 children: [
                   // 添加选项行
                   for (var optionConfig
                       in controller.replyToneOptionSelectConfigList)
                     _buildOptionRow(optionConfig),
                 ],
-              );
-            }),
-          ),
-        ],
-      ),
-    );
+              ),
+            ),
+          ],
+        ),
+      );
+    });
   }
 
   /// 回复语气列表卡片

+ 35 - 0
pubspec.lock

@@ -445,6 +445,14 @@ packages:
     description: flutter
     source: sdk
     version: "0.0.0"
+  flutter_bugly:
+    dependency: "direct main"
+    description:
+      name: flutter_bugly
+      sha256: e5e0b64a19a1482fe37fda905ed518513f73ceef8da4de7de25719efd1a3682f
+      url: "https://pub.dev"
+    source: hosted
+    version: "1.1.0"
   flutter_cache_manager:
     dependency: transitive
     description:
@@ -535,6 +543,15 @@ packages:
     description: flutter
     source: sdk
     version: "0.0.0"
+  flutter_umeng:
+    dependency: "direct main"
+    description:
+      path: "."
+      ref: "v0.0.2"
+      resolved-ref: "041f5a7c1a18f2dd4c7fdec1e97a35cb5cc9ab67"
+      url: "http://git.atmob.com:28999/Atmob-Flutter/flutter_umeng.git"
+    source: git
+    version: "0.0.2"
   flutter_web_plugins:
     dependency: transitive
     description: flutter
@@ -644,6 +661,15 @@ packages:
       url: "https://pub.dev"
     source: hosted
     version: "2.3.2"
+  gravity_engine:
+    dependency: "direct main"
+    description:
+      path: "."
+      ref: "v0.0.2"
+      resolved-ref: c82b1570eb8f80b3746df1c6e60e52a233fc7e5e
+      url: "http://git.atmob.com:28999/Atmob-Flutter/gravity_engine.git"
+    source: git
+    version: "0.0.2"
   hashcodes:
     dependency: transitive
     description:
@@ -971,6 +997,15 @@ packages:
       url: "https://pub.dev"
     source: hosted
     version: "0.0.12"
+  oaid:
+    dependency: "direct main"
+    description:
+      path: "."
+      ref: "v0.0.1"
+      resolved-ref: "22c60c77cdbc3aa91277d83a711c659b74d24227"
+      url: "http://git.atmob.com:28999/Atmob-Flutter/Oaid.git"
+    source: git
+    version: "0.0.1"
   octo_image:
     dependency: transitive
     description: