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