Просмотр исходного кода

修正图像显示时宽高被写死

loki.wu 1 год назад
Родитель
Сommit
9bc76a304d
2 измененных файлов с 7 добавлено и 3 удалено
  1. 6 2
      lib/components/picture_components.dart
  2. 1 1
      pubspec.yaml

+ 6 - 2
lib/components/picture_components.dart

@@ -94,6 +94,8 @@ class FContentImage extends StatelessWidget implements FWidget {
   /// 图像定位描述描述
   final String? locationDescription;
 
+  BoxFit? fit;
+
   FContentImage({
     Key? key,
     this.terminalImage,
@@ -109,6 +111,7 @@ class FContentImage extends StatelessWidget implements FWidget {
     this.locationDescription = '',
     this.contentHeight = 200,
     this.contentWidth = 300,
+    this.fit,
   }) : super(key: key);
 
   @override
@@ -128,8 +131,9 @@ class FContentImage extends StatelessWidget implements FWidget {
         color: Colors.black,
         child: FImage.network(
           terminalImage!.coverImageUrl!,
-          width: contentWidth,
-          height: contentHeight,
+          width: fit == null ? contentWidth : null,
+          height: fit == null ? contentHeight : null,
+          fit: fit,
           errorBuilder: ((context, error, stackTrace) {
             return Container(
               child: Text(i18nBook.common.error.t),

+ 1 - 1
pubspec.yaml

@@ -54,7 +54,7 @@ dependency_overrides:
   fis_ui:
     git:
       url: http://git.ius.plus:88/Project-Wing/fis_lib_ui.git
-      ref: "e0731e6"
+      ref: "2e68102"
       # path: ../fis_lib_ui
 # For information on the generic Dart part of this file, see the
 # following page: https://dart.dev/tools/pub/pubspec