mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 03:59:23 +00:00
b72443a8c4
* Add ability for change password for wallets classes. * Update generateWalletPassword * Add WalletLoadingService * Add update monero password after wallet loading. * Update version for Cake Wallet to 4.4.2 (103) * Changed version for Cake Wallet to 4.4.3 (104). * Changed version for Cake Wallet android * Changed version for Monero.com ios and android.
22 lines
929 B
Dart
22 lines
929 B
Dart
import 'package:cake_wallet/di.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
import 'package:cake_wallet/store/app_store.dart';
|
|
import 'package:cake_wallet/core/key_service.dart';
|
|
import 'package:cw_core/wallet_service.dart';
|
|
import 'package:cake_wallet/entities/preferences_key.dart';
|
|
import 'package:cw_core/wallet_type.dart';
|
|
import 'package:cake_wallet/core/wallet_loading_service.dart';
|
|
|
|
Future<void> loadCurrentWallet() async {
|
|
final appStore = getIt.get<AppStore>();
|
|
final name = getIt
|
|
.get<SharedPreferences>()
|
|
.getString(PreferencesKey.currentWalletName);
|
|
final typeRaw =
|
|
getIt.get<SharedPreferences>().getInt(PreferencesKey.currentWalletType) ??
|
|
0;
|
|
final type = deserializeFromInt(typeRaw);
|
|
final walletLoadingService = getIt.get<WalletLoadingService>();
|
|
final wallet = await walletLoadingService.load(type, name);
|
|
appStore.changeCurrentWallet(wallet);
|
|
}
|