Quellcode durchsuchen

设置FConfigureLayout的标题宽度

loki.wu vor 1 Jahr
Ursprung
Commit
05dd17d93d
1 geänderte Dateien mit 6 neuen und 2 gelöschten Zeilen
  1. 6 2
      lib/components/from_configure_components/configure_layout.dart

+ 6 - 2
lib/components/from_configure_components/configure_layout.dart

@@ -32,7 +32,7 @@ class FConfigureLayout extends FStatelessWidget {
   static const C_MARGIN_VERTICAL_SIZE = 10.0;
 
   /// TODO:[Gavin] i18n-UI-整合
-  double C_FCONTAITNER_WIDTH = i18nBook.isCurrentChinese ? 80 : 160.0;
+  final double C_FCONTAITNER_WIDTH = i18nBook.isCurrentChinese ? 80 : 160.0;
 
   /// 标题
   final String title;
@@ -49,12 +49,16 @@ class FConfigureLayout extends FStatelessWidget {
   /// 是否显示标题
   final bool? isShowTitle;
 
+  ///标题宽度,若指定此属性,则C_FCONTAITNER_WIDTH不生效
+  final double? titleWidth;
+
   FConfigureLayout({
     required this.title,
     required this.widget,
     this.proportion = 1,
     this.isRequired = false,
     this.isShowTitle = true,
+    this.titleWidth,
   });
 
   @override
@@ -89,7 +93,7 @@ class FConfigureLayout extends FStatelessWidget {
         vertical: C_MARGIN_VERTICAL_SIZE,
         horizontal: C_MARGIN_HORIZONTAL_SIZE,
       ),
-      width: C_FCONTAITNER_WIDTH,
+      width: titleWidth ?? C_FCONTAITNER_WIDTH,
       alignment: Alignment.centerLeft,
       child: FRow(
         mainAxisAlignment: MainAxisAlignment.center,