diff --git a/lib/pages_desktop_specific/coin_control/desktop_coin_control_use_dialog.dart b/lib/pages_desktop_specific/coin_control/desktop_coin_control_use_dialog.dart index 10a495d1d..d0ba9ecbd 100644 --- a/lib/pages_desktop_specific/coin_control/desktop_coin_control_use_dialog.dart +++ b/lib/pages_desktop_specific/coin_control/desktop_coin_control_use_dialog.dart @@ -281,6 +281,7 @@ class _DesktopCoinControlUseDialogState }); } }, + displayPrefix: "Sort by", ) ], ), diff --git a/lib/widgets/custom_buttons/dropdown_button.dart b/lib/widgets/custom_buttons/dropdown_button.dart index fd821fd0b..b31d8e2ed 100644 --- a/lib/widgets/custom_buttons/dropdown_button.dart +++ b/lib/widgets/custom_buttons/dropdown_button.dart @@ -128,11 +128,13 @@ class JDropdownIconButton extends StatefulWidget { const JDropdownIconButton({ Key? key, required this.items, + required this.displayPrefix, this.onSelectionChanged, this.groupValue, this.redrawOnScreenSizeChanged = false, }) : super(key: key); + final String displayPrefix; final void Function(T?)? onSelectionChanged; final T? groupValue; final Set items; @@ -180,6 +182,7 @@ class _JDropdownIconButtonState extends State> { (e) => _JDropdownButtonItem( value: e, groupValue: widget.groupValue, + displayPrefix: widget.displayPrefix, onSelected: (T value) { widget.onSelectionChanged?.call(value); close(); @@ -310,12 +313,14 @@ class _JDropdownButtonItem extends StatelessWidget { required this.groupValue, required this.onSelected, this.height = 53, + this.displayPrefix, }) : super(key: key); final T value; final T? groupValue; final double height; final void Function(T) onSelected; + final String? displayPrefix; @override Widget build(BuildContext context) { @@ -337,7 +342,9 @@ class _JDropdownButtonItem extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Text( - value.toString(), + displayPrefix == null + ? value.toString() + : "$displayPrefix ${value.toString().toLowerCase()}", style: STextStyles.desktopTextExtraSmall(context).copyWith( color: Theme.of(context).extension()!.textDark, ),