fix edit token page

minor fixes
This commit is contained in:
OmarHatem 2025-03-10 11:49:16 +02:00
parent be4e0d6ac8
commit c5f5d1dd4d
2 changed files with 10 additions and 8 deletions

View file

@ -187,7 +187,6 @@ class _DashboardPageView extends BasePage {
int get initialPage => dashboardViewModel.shouldShowMarketPlaceInDashboard ? 1 : 0; int get initialPage => dashboardViewModel.shouldShowMarketPlaceInDashboard ? 1 : 0;
ObservableList<Widget> pages = ObservableList<Widget>(); ObservableList<Widget> pages = ObservableList<Widget>();
bool _isEffectsInstalled = false; bool _isEffectsInstalled = false;
StreamSubscription<bool>? _onInactiveSub;
@override @override
Widget body(BuildContext context) { Widget body(BuildContext context) {
@ -275,7 +274,7 @@ class _DashboardPageView extends BasePage {
} }
void _setEffects(BuildContext context) async { void _setEffects(BuildContext context) async {
if (_isEffectsInstalled) { if (_isEffectsInstalled || !context.mounted) {
return; return;
} }
if (dashboardViewModel.shouldShowMarketPlaceInDashboard) { if (dashboardViewModel.shouldShowMarketPlaceInDashboard) {
@ -305,11 +304,9 @@ class _DashboardPageView extends BasePage {
_showHavenPopup(context); _showHavenPopup(context);
var needToPresentYat = false; var needToPresentYat = false;
var isInactive = false;
_onInactiveSub = rootKey.currentState?.isInactive.listen( rootKey.currentState?.isInactive.listen(
(inactive) { (inactive) {
isInactive = inactive;
if (needToPresentYat) { if (needToPresentYat) {
Future<void>.delayed(Duration(milliseconds: 500)).then( Future<void>.delayed(Duration(milliseconds: 500)).then(

View file

@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:cake_wallet/src/widgets/standard_list.dart'; import 'package:cake_wallet/src/widgets/standard_list.dart';
import 'package:cake_wallet/src/widgets/standard_switch.dart'; import 'package:cake_wallet/src/widgets/standard_switch.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -30,7 +29,13 @@ class SettingsSwitcherCell extends StandardListRow {
height: 56, height: 56,
padding: EdgeInsets.only(left: 12, right: 12), padding: EdgeInsets.only(left: 12, right: 12),
child: TextButton( child: TextButton(
onPressed: () => onValueChange?.call(context, !value), onPressed: () {
if (onTap != null) {
onTap!.call(context);
} else {
onValueChange?.call(context, !value);
}
},
style: ButtonStyle( style: ButtonStyle(
//backgroundColor: MaterialStateProperty.all(Theme.of(context).cardColor), //backgroundColor: MaterialStateProperty.all(Theme.of(context).cardColor),
shape: MaterialStateProperty.all( shape: MaterialStateProperty.all(
@ -45,7 +50,7 @@ class SettingsSwitcherCell extends StandardListRow {
children: <Widget>[ children: <Widget>[
if (leading != null) leading, if (leading != null) leading,
buildCenter(context, hasLeftOffset: leading != null), buildCenter(context, hasLeftOffset: leading != null),
if (trailing != null) trailing, trailing,
], ],
), ),
), ),