mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-12 09:27:01 +00:00
add showExchange pref
This commit is contained in:
parent
40f8767b11
commit
bc1a0dc586
1 changed files with 26 additions and 0 deletions
|
@ -1130,4 +1130,30 @@ class Prefs extends ChangeNotifier {
|
|||
) as bool? ??
|
||||
false;
|
||||
}
|
||||
|
||||
// Show or hide exchange (buy & swap) features.
|
||||
|
||||
bool _showExchange = true;
|
||||
|
||||
bool get showExchange => _showExchange;
|
||||
|
||||
set showExchange(bool showExchange) {
|
||||
if (_showExchange != showExchange) {
|
||||
DB.instance.put<dynamic>(
|
||||
boxName: DB.boxNamePrefs,
|
||||
key: "showExchange",
|
||||
value: showExchange,
|
||||
);
|
||||
_showExchange = showExchange;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> _getShowExchange() async {
|
||||
return await DB.instance.get<dynamic>(
|
||||
boxName: DB.boxNamePrefs,
|
||||
key: "showExchange",
|
||||
) as bool? ??
|
||||
true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue