TF-2084 Add select action hint
(cherry picked from commit 0917989494ba6bba0ce574b7a4498fb69ad791e4)
This commit is contained in:
@@ -32,6 +32,7 @@ class DropDownButtonWidget<T> extends StatelessWidget {
|
||||
final String tooltip;
|
||||
final double? dropdownWidth;
|
||||
final double? dropdownMaxHeight;
|
||||
final String? hintText;
|
||||
|
||||
const DropDownButtonWidget({
|
||||
Key? key,
|
||||
@@ -50,6 +51,7 @@ class DropDownButtonWidget<T> extends StatelessWidget {
|
||||
this.dropdownMaxHeight,
|
||||
this.colorButton = Colors.white,
|
||||
this.tooltip = '',
|
||||
this.hintText,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
@@ -120,7 +122,7 @@ class DropDownButtonWidget<T> extends StatelessWidget {
|
||||
_getTextItemDropdown(context, item: itemSelected),
|
||||
style: TextStyle(fontSize: 16,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: Colors.black.withOpacity(opacity)),
|
||||
color: itemSelected != null ? Colors.black.withOpacity(opacity) : AppColor.textFieldHintColor),
|
||||
maxLines: 1,
|
||||
softWrap: CommonTextStyle.defaultSoftWrap,
|
||||
overflow: CommonTextStyle.defaultTextOverFlow,
|
||||
@@ -192,6 +194,6 @@ class DropDownButtonWidget<T> extends StatelessWidget {
|
||||
if (item is ConditionCombiner) {
|
||||
return item.getTitle(context);
|
||||
}
|
||||
return '';
|
||||
return hintText ?? '';
|
||||
}
|
||||
}
|
||||
+6
-3
@@ -19,17 +19,20 @@ class RuleFilterButtonField<T> extends StatelessWidget {
|
||||
final T? value;
|
||||
final OnTapActionCallback? tapActionCallback;
|
||||
final Color? borderColor;
|
||||
final String? hintText;
|
||||
|
||||
const RuleFilterButtonField({
|
||||
super.key,
|
||||
this.value,
|
||||
this.tapActionCallback,
|
||||
this.borderColor,
|
||||
this.hintText,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final imagePaths = Get.find<ImagePaths>();
|
||||
final Color textColor = value != null ? Colors.black : AppColor.textFieldHintColor;
|
||||
|
||||
return InkWell(
|
||||
onTap: () => tapActionCallback?.call(value),
|
||||
@@ -45,10 +48,10 @@ class RuleFilterButtonField<T> extends StatelessWidget {
|
||||
child: Row(children: [
|
||||
Expanded(child: Text(
|
||||
_getName(context, value),
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: Colors.black),
|
||||
color: textColor),
|
||||
maxLines: 1,
|
||||
softWrap: CommonTextStyle.defaultSoftWrap,
|
||||
overflow: CommonTextStyle.defaultTextOverFlow,
|
||||
@@ -75,6 +78,6 @@ class RuleFilterButtonField<T> extends StatelessWidget {
|
||||
if (value is ConditionCombiner) {
|
||||
return value.getTitle(context);
|
||||
}
|
||||
return '';
|
||||
return hintText ?? '';
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"@@last_modified": "2023-09-24T21:58:41.292766",
|
||||
"@@last_modified": "2023-09-24T22:04:38.879050",
|
||||
"initializing_data": "Initializing data...",
|
||||
"@initializing_data": {
|
||||
"type": "text",
|
||||
@@ -3379,5 +3379,11 @@
|
||||
"type": "text",
|
||||
"placeholders_order": [],
|
||||
"placeholders": {}
|
||||
},
|
||||
"selectAction": "Select action",
|
||||
"@selectAction": {
|
||||
"type": "text",
|
||||
"placeholders_order": [],
|
||||
"placeholders": {}
|
||||
}
|
||||
}
|
||||
@@ -3491,4 +3491,11 @@ class AppLocalizations {
|
||||
name: 'forwardTo',
|
||||
);
|
||||
}
|
||||
|
||||
String get selectAction {
|
||||
return Intl.message(
|
||||
'Select action',
|
||||
name: 'selectAction',
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user