mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-16 09:17:37 +00:00
add reuseAddress pref
This commit is contained in:
parent
218809327a
commit
9ac00e2ed0
1 changed files with 26 additions and 0 deletions
|
@ -1131,4 +1131,30 @@ class Prefs extends ChangeNotifier {
|
|||
) as bool? ??
|
||||
false;
|
||||
}
|
||||
|
||||
// Reuse addresses (ie., don't generate new addresses by default).
|
||||
|
||||
bool _reuseAddress = false;
|
||||
|
||||
bool get reuseAddress => _reuseAddress;
|
||||
|
||||
set reuseAddress(bool reuseAddress) {
|
||||
if (_reuseAddress != reuseAddress) {
|
||||
DB.instance.put<dynamic>(
|
||||
boxName: DB.boxNamePrefs,
|
||||
key: "reuseAddress",
|
||||
value: reuseAddress,
|
||||
);
|
||||
_reuseAddress = reuseAddress;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> _getReuseAddress() async {
|
||||
return await DB.instance.get<dynamic>(
|
||||
boxName: DB.boxNamePrefs,
|
||||
key: "reuseAddress",
|
||||
) as bool? ??
|
||||
true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue