Browse Source

FConsultationContentImage 增加插件播放功能

loki.wu 2 years ago
parent
commit
25c2fb02cc
1 changed files with 19 additions and 4 deletions
  1. 19 4
      lib/components/consultation_picture_component.dart

+ 19 - 4
lib/components/consultation_picture_component.dart

@@ -38,6 +38,9 @@ class FConsultationContentImage extends StatelessWidget implements FWidget {
   ///图片文字描述
   final String? description;
 
+  ///插件
+  final FWidget? plugin;
+
   FConsultationContentImage({
     Key? key,
     this.isMeasure = false,
@@ -51,6 +54,7 @@ class FConsultationContentImage extends StatelessWidget implements FWidget {
     this.contentWidth = 300,
     this.consultationFileInfo,
     this.fileDataType,
+    this.plugin,
   }) : super(key: key);
 
   @override
@@ -58,9 +62,9 @@ class FConsultationContentImage extends StatelessWidget implements FWidget {
     if (fileDataType == null) {
       fileDataType = consultationFileInfo?.fileDataType;
     }
-
+    FWidget child;
     if (isPureImage) {
-      return FContainer(
+      child = FContainer(
         color: Colors.black,
         child: FImage.network(
           consultationFileInfo?.previewImageUrl ?? "",
@@ -73,11 +77,22 @@ class FConsultationContentImage extends StatelessWidget implements FWidget {
           }),
         ),
       );
-    } else
-      return _buildFContentImage(
+    } else {
+      child = _buildFContentImage(
         fileDataType!,
         consultationFileInfo?.previewImageUrl ?? "",
       );
+    }
+    return FStack(
+      children: [
+        FPositioned(child: child),
+        FPositioned(
+          right: 10,
+          top: 5,
+          child: plugin ?? FSizedBox(),
+        ),
+      ],
+    );
   }
 
   FWidget _buildFContentImage(