TF-886 Store encryptionKey in Hive database

This commit is contained in:
dab246
2022-09-07 10:35:12 +07:00
committed by Dat H. Pham
parent f1e512148d
commit 6018cd383a
11 changed files with 209 additions and 21 deletions
@@ -3,6 +3,7 @@ import 'package:flutter/foundation.dart';
import 'package:tmail_ui_user/features/caching/account_cache_client.dart';
import 'package:tmail_ui_user/features/caching/authentication_info_cache_client.dart';
import 'package:tmail_ui_user/features/caching/email_cache_client.dart';
import 'package:tmail_ui_user/features/caching/encryption_key_cache_client.dart';
import 'package:tmail_ui_user/features/caching/mailbox_cache_client.dart';
import 'package:tmail_ui_user/features/caching/recent_search_cache_client.dart';
import 'package:tmail_ui_user/features/caching/state_cache_client.dart';
@@ -16,6 +17,7 @@ class CachingManager {
final RecentSearchCacheClient _recentSearchCacheClient;
final TokenOidcCacheClient _tokenOidcCacheClient;
final AccountCacheClient _accountCacheClient;
final EncryptionKeyCacheClient _encryptionKeyCacheClient;
final AuthenticationInfoCacheClient _authenticationInfoCacheClient;
CachingManager(
@@ -25,6 +27,7 @@ class CachingManager {
this._recentSearchCacheClient,
this._tokenOidcCacheClient,
this._accountCacheClient,
this._encryptionKeyCacheClient,
this._authenticationInfoCacheClient,
);
@@ -37,6 +40,7 @@ class CachingManager {
_recentSearchCacheClient.clearAllData(),
_tokenOidcCacheClient.clearAllData(),
_accountCacheClient.clearAllData(),
_encryptionKeyCacheClient.clearAllData(),
_authenticationInfoCacheClient.clearAllData(),
]);
} else {
@@ -47,6 +51,7 @@ class CachingManager {
_recentSearchCacheClient.deleteBox(),
_tokenOidcCacheClient.deleteBox(),
_accountCacheClient.deleteBox(),
_encryptionKeyCacheClient.deleteBox(),
_authenticationInfoCacheClient.deleteBox(),
]);
}