Fix list UI having double width on some parts (#1687)
* save * fix * re-add support button * update
Matthew Fosse committed
Sep 18, 2024 at 09:22 UTC
b6bc3df62276b046104842617cc497259aa15061
1 file changed
+10
-7
lib/src/screens/dashboard/widgets/menu_widget.dart
+10
-7
@@ -97,7 +97,15 @@ class MenuWidgetState extends State<MenuWidget> {
97
98
@override
99
Widget build(BuildContext context) {
100
- final itemCount = SettingActions.all.length;
100
+ List<SettingActions> items = SettingActions.all;
101
+ if (!widget.dashboardViewModel.hasSilentPayments) {
102
+ items.removeWhere((element) => element.name(context) == S.of(context).silent_payments_settings);
103
+ }
104
+ // if (!widget.dashboardViewModel.hasMweb) {
105
+ // itemCount--;
106
+ // items.removeWhere((element) => element.name(context) == S.of(context).litecoin_mweb_settings);
107
+ // }
108
+ int itemCount = items.length;
109
110
moneroIcon = Image.asset('assets/images/monero_menu.png',
111
color: Theme.of(context).extension<CakeMenuTheme>()!.iconColor);
@@ -181,12 +189,7 @@ class MenuWidgetState extends State<MenuWidget> {
189
190
index--;
191
184
- final item = SettingActions.all[index];
185
-
186
- if (!widget.dashboardViewModel.hasSilentPayments &&
187
- item.name(context) == S.of(context).silent_payments_settings) {
188
- return Container();
189
- }
192
+ final item = items[index];
193
194
final isLastTile = index == itemCount - 1;
195