diff --git a/lib/src/screens/settings/desktop_settings/dashboard_settings_page.dart b/lib/src/screens/settings/desktop_settings/dashboard_settings_page.dart index 9a5c6620d..69cd2ad27 100644 --- a/lib/src/screens/settings/desktop_settings/dashboard_settings_page.dart +++ b/lib/src/screens/settings/desktop_settings/dashboard_settings_page.dart @@ -6,6 +6,7 @@ import 'package:cake_wallet/typography.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/router.dart' as Router; +final _settingsNavigatorKey = GlobalKey(); class DesktopSettingsPage extends StatefulWidget { const DesktopSettingsPage({super.key}); @@ -15,8 +16,6 @@ class DesktopSettingsPage extends StatefulWidget { } class _DesktopSettingsPageState extends State { - GlobalKey _settingsNavigatorKey = GlobalKey(); - final int itemCount = SettingActions.all.length; int? currentPage; @@ -59,7 +58,7 @@ class _DesktopSettingsPageState extends State { onTap: () { if (currentPage != index) { final settingContext = - _settingsNavigatorKey.currentState!.context; + _settingsNavigatorKey.currentState?.context ?? context; item.onTap.call(settingContext); _onItemChange(index); }