fix edit token page minor fixes

fix edit token page minor fixes

OmarHatem committed Mar 10, 2025 at 11:49 UTC c5f5d1dd4dc93b31b516b80e6b678e7f02ea0715
2 files changed +10 -8
lib/src/screens/dashboard/dashboard_page.dart
+2 -5
@@ -187,7 +187,6 @@ class _DashboardPageView extends BasePage {
187 int get initialPage => dashboardViewModel.shouldShowMarketPlaceInDashboard ? 1 : 0;
188 ObservableList<Widget> pages = ObservableList<Widget>();
189 bool _isEffectsInstalled = false;
190 - StreamSubscription<bool>? _onInactiveSub;
190
191 @override
192 Widget body(BuildContext context) {
@@ -275,7 +274,7 @@ class _DashboardPageView extends BasePage {
274 }
275
276 void _setEffects(BuildContext context) async {
278 - if (_isEffectsInstalled) {
277 + if (_isEffectsInstalled || !context.mounted) {
278 return;
279 }
280 if (dashboardViewModel.shouldShowMarketPlaceInDashboard) {
@@ -305,11 +304,9 @@ class _DashboardPageView extends BasePage {
304 _showHavenPopup(context);
305
306 var needToPresentYat = false;
308 - var isInactive = false;
307
310 - _onInactiveSub = rootKey.currentState?.isInactive.listen(
308 + rootKey.currentState?.isInactive.listen(
309 (inactive) {
312 - isInactive = inactive;
310
311 if (needToPresentYat) {
312 Future<void>.delayed(Duration(milliseconds: 500)).then(
lib/src/screens/settings/widgets/settings_switcher_cell.dart
+8 -3
@@ -1,4 +1,3 @@
1 -import 'package:flutter/cupertino.dart';
1 import 'package:cake_wallet/src/widgets/standard_list.dart';
2 import 'package:cake_wallet/src/widgets/standard_switch.dart';
3 import 'package:flutter/material.dart';
@@ -30,7 +29,13 @@ class SettingsSwitcherCell extends StandardListRow {
29 height: 56,
30 padding: EdgeInsets.only(left: 12, right: 12),
31 child: TextButton(
33 - onPressed: () => onValueChange?.call(context, !value),
32 + onPressed: () {
33 + if (onTap != null) {
34 + onTap!.call(context);
35 + } else {
36 + onValueChange?.call(context, !value);
37 + }
38 + },
39 style: ButtonStyle(
40 //backgroundColor: MaterialStateProperty.all(Theme.of(context).cardColor),
41 shape: MaterialStateProperty.all(
@@ -45,7 +50,7 @@ class SettingsSwitcherCell extends StandardListRow {
50 children: <Widget>[
51 if (leading != null) leading,
52 buildCenter(context, hasLeftOffset: leading != null),
48 - if (trailing != null) trailing,
53 + trailing,
54 ],
55 ),
56 ),