Remove FlutterSecureStorage Reference

This commit is contained in:
OmarHatem 2024-01-28 05:20:20 +02:00
parent 492a8b2c0a
commit 67a96807d1
2 changed files with 8 additions and 8 deletions

View file

@ -1,4 +1,4 @@
import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:cake_wallet/core/secure_storage.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
enum SecretStoreKey { moneroWalletPassword, pinCodePassword, backupPassword } enum SecretStoreKey { moneroWalletPassword, pinCodePassword, backupPassword }
@ -66,7 +66,7 @@ class SecureKey {
static const lastAuthTimeMilliseconds = 'last_auth_time_milliseconds'; static const lastAuthTimeMilliseconds = 'last_auth_time_milliseconds';
static Future<int?> getInt({ static Future<int?> getInt({
required FlutterSecureStorage secureStorage, required SecureStorage secureStorage,
required SharedPreferences sharedPreferences, required SharedPreferences sharedPreferences,
required String key, required String key,
}) async { }) async {
@ -76,7 +76,7 @@ class SecureKey {
} }
static Future<bool?> getBool({ static Future<bool?> getBool({
required FlutterSecureStorage secureStorage, required SecureStorage secureStorage,
required SharedPreferences sharedPreferences, required SharedPreferences sharedPreferences,
required String key, required String key,
}) async { }) async {
@ -91,7 +91,7 @@ class SecureKey {
} }
static Future<String?> getString({ static Future<String?> getString({
required FlutterSecureStorage secureStorage, required SecureStorage secureStorage,
required SharedPreferences sharedPreferences, required SharedPreferences sharedPreferences,
required String key, required String key,
}) async { }) async {

View file

@ -2,6 +2,7 @@ import 'dart:io';
import 'package:cake_wallet/bitcoin/bitcoin.dart'; import 'package:cake_wallet/bitcoin/bitcoin.dart';
import 'package:cake_wallet/bitcoin_cash/bitcoin_cash.dart'; import 'package:cake_wallet/bitcoin_cash/bitcoin_cash.dart';
import 'package:cake_wallet/core/secure_storage.dart';
import 'package:cake_wallet/entities/auto_generate_subaddress_status.dart'; import 'package:cake_wallet/entities/auto_generate_subaddress_status.dart';
import 'package:cake_wallet/entities/provider_types.dart'; import 'package:cake_wallet/entities/provider_types.dart';
import 'package:cake_wallet/entities/cake_2fa_preset_options.dart'; import 'package:cake_wallet/entities/cake_2fa_preset_options.dart';
@ -24,7 +25,6 @@ import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/themes/theme_list.dart'; import 'package:cake_wallet/themes/theme_list.dart';
import 'package:device_info_plus/device_info_plus.dart'; import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:hive/hive.dart'; import 'package:hive/hive.dart';
import 'package:mobx/mobx.dart'; import 'package:mobx/mobx.dart';
import 'package:package_info_plus/package_info_plus.dart'; import 'package:package_info_plus/package_info_plus.dart';
@ -46,7 +46,7 @@ class SettingsStore = SettingsStoreBase with _$SettingsStore;
abstract class SettingsStoreBase with Store { abstract class SettingsStoreBase with Store {
SettingsStoreBase( SettingsStoreBase(
{required FlutterSecureStorage secureStorage, {required SecureStorage secureStorage,
required BackgroundTasks backgroundTasks, required BackgroundTasks backgroundTasks,
required SharedPreferences sharedPreferences, required SharedPreferences sharedPreferences,
required bool initialShouldShowMarketPlaceInDashboard, required bool initialShouldShowMarketPlaceInDashboard,
@ -680,7 +680,7 @@ abstract class SettingsStoreBase with Store {
String deviceName; String deviceName;
final FlutterSecureStorage _secureStorage; final SecureStorage _secureStorage;
final SharedPreferences _sharedPreferences; final SharedPreferences _sharedPreferences;
final BackgroundTasks _backgroundTasks; final BackgroundTasks _backgroundTasks;
@ -723,7 +723,7 @@ abstract class SettingsStoreBase with Store {
BalanceDisplayMode initialBalanceDisplayMode = BalanceDisplayMode.availableBalance, BalanceDisplayMode initialBalanceDisplayMode = BalanceDisplayMode.availableBalance,
ThemeBase? initialTheme}) async { ThemeBase? initialTheme}) async {
final sharedPreferences = await getIt.getAsync<SharedPreferences>(); final sharedPreferences = await getIt.getAsync<SharedPreferences>();
final secureStorage = await getIt.get<FlutterSecureStorage>(); final secureStorage = await getIt.get<SecureStorage>();
final backgroundTasks = getIt.get<BackgroundTasks>(); final backgroundTasks = getIt.get<BackgroundTasks>();
final currentFiatCurrency = FiatCurrency.deserialize( final currentFiatCurrency = FiatCurrency.deserialize(
raw: sharedPreferences.getString(PreferencesKey.currentFiatCurrencyKey)!); raw: sharedPreferences.getString(PreferencesKey.currentFiatCurrencyKey)!);