|
@@ -17,6 +17,9 @@ class FTitleField extends StatelessWidget implements FWidget {
|
|
|
|
|
|
late double maxLargeFieldWidth;
|
|
|
|
|
|
+
|
|
|
+ late double minTitleWidth;
|
|
|
+
|
|
|
|
|
|
late bool isRequiredField;
|
|
|
FTitleField(
|
|
@@ -26,6 +29,7 @@ class FTitleField extends StatelessWidget implements FWidget {
|
|
|
this.sizeBetween = 5,
|
|
|
this.sizeAfter = 10,
|
|
|
this.maxLargeFieldWidth = 210,
|
|
|
+ this.minTitleWidth = 60,
|
|
|
this.isRequiredField = false,
|
|
|
}) : super(key: key);
|
|
|
@override
|
|
@@ -57,21 +61,24 @@ class FTitleField extends StatelessWidget implements FWidget {
|
|
|
}
|
|
|
|
|
|
FWidget _buildTitle() {
|
|
|
- return FText.rich(
|
|
|
- TextSpan(children: [
|
|
|
- TextSpan(
|
|
|
- text: title,
|
|
|
- style: TextStyle(fontWeight: FontWeight.bold),
|
|
|
- ),
|
|
|
- if (isRequiredField) ...[
|
|
|
+ return FConstrainedBox(
|
|
|
+ constraints: BoxConstraints(minWidth: minTitleWidth),
|
|
|
+ child: FText.rich(
|
|
|
+ TextSpan(children: [
|
|
|
TextSpan(
|
|
|
- text: ' *',
|
|
|
- style: TextStyle(color: Colors.red),
|
|
|
- )
|
|
|
- ] else ...[
|
|
|
- TextSpan(text: '')
|
|
|
- ]
|
|
|
- ]),
|
|
|
+ text: title,
|
|
|
+ style: TextStyle(fontWeight: FontWeight.bold),
|
|
|
+ ),
|
|
|
+ if (isRequiredField) ...[
|
|
|
+ TextSpan(
|
|
|
+ text: ' *',
|
|
|
+ style: TextStyle(color: Colors.red),
|
|
|
+ )
|
|
|
+ ] else ...[
|
|
|
+ TextSpan(text: '')
|
|
|
+ ]
|
|
|
+ ]),
|
|
|
+ ),
|
|
|
);
|
|
|
}
|
|
|
}
|