TF-624 Handling asynchronous when clearing cache
This commit is contained in:
@@ -11,8 +11,8 @@ class AccountCacheClient extends HiveCacheClient<AccountCache> {
|
|||||||
@override
|
@override
|
||||||
Future<void> clearAllData() {
|
Future<void> clearAllData() {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxToken = await openBox();
|
final boxAccount = await openBox();
|
||||||
boxToken.clear();
|
return boxAccount.clear();
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -21,8 +21,8 @@ class AccountCacheClient extends HiveCacheClient<AccountCache> {
|
|||||||
@override
|
@override
|
||||||
Future<void> deleteItem(String key) {
|
Future<void> deleteItem(String key) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxToken = await openBox();
|
final boxAccount = await openBox();
|
||||||
return boxToken.delete(key);
|
return boxAccount.delete(key);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -31,8 +31,8 @@ class AccountCacheClient extends HiveCacheClient<AccountCache> {
|
|||||||
@override
|
@override
|
||||||
Future<void> deleteMultipleItem(List<String> listKey) {
|
Future<void> deleteMultipleItem(List<String> listKey) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxToken = await openBox();
|
final boxAccount = await openBox();
|
||||||
return boxToken.deleteAll(listKey);
|
return boxAccount.deleteAll(listKey);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -41,8 +41,8 @@ class AccountCacheClient extends HiveCacheClient<AccountCache> {
|
|||||||
@override
|
@override
|
||||||
Future<List<AccountCache>> getAll() {
|
Future<List<AccountCache>> getAll() {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxToken = await openBox();
|
final boxAccount = await openBox();
|
||||||
return boxToken.values.toList();
|
return boxAccount.values.toList();
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -51,8 +51,8 @@ class AccountCacheClient extends HiveCacheClient<AccountCache> {
|
|||||||
@override
|
@override
|
||||||
Future<AccountCache?> getItem(String key) {
|
Future<AccountCache?> getItem(String key) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxToken = await openBox();
|
final boxAccount = await openBox();
|
||||||
return boxToken.get(key);
|
return boxAccount.get(key);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -62,8 +62,8 @@ class AccountCacheClient extends HiveCacheClient<AccountCache> {
|
|||||||
Future<void> insertItem(String key, AccountCache newObject) {
|
Future<void> insertItem(String key, AccountCache newObject) {
|
||||||
log('AccountCacheClient::insertItem(): $key: $newObject');
|
log('AccountCacheClient::insertItem(): $key: $newObject');
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxToken = await openBox();
|
final boxAccount = await openBox();
|
||||||
boxToken.put(key, newObject);
|
return boxAccount.put(key, newObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -72,8 +72,8 @@ class AccountCacheClient extends HiveCacheClient<AccountCache> {
|
|||||||
@override
|
@override
|
||||||
Future<void> insertMultipleItem(Map<String, AccountCache> mapObject) {
|
Future<void> insertMultipleItem(Map<String, AccountCache> mapObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxToken = await openBox();
|
final boxAccount = await openBox();
|
||||||
boxToken.putAll(mapObject);
|
return boxAccount.putAll(mapObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -82,8 +82,8 @@ class AccountCacheClient extends HiveCacheClient<AccountCache> {
|
|||||||
@override
|
@override
|
||||||
Future<bool> isExistItem(String key) {
|
Future<bool> isExistItem(String key) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxToken = await openBox();
|
final boxAccount = await openBox();
|
||||||
return boxToken.containsKey(key);
|
return boxAccount.containsKey(key);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -92,7 +92,7 @@ class AccountCacheClient extends HiveCacheClient<AccountCache> {
|
|||||||
@override
|
@override
|
||||||
Future<bool> isExistTable() {
|
Future<bool> isExistTable() {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
return await Hive.boxExists(tableName);
|
return Hive.boxExists(tableName);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -109,8 +109,8 @@ class AccountCacheClient extends HiveCacheClient<AccountCache> {
|
|||||||
@override
|
@override
|
||||||
Future<void> updateItem(String key, AccountCache newObject) {
|
Future<void> updateItem(String key, AccountCache newObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxToken = await openBox();
|
final boxAccount = await openBox();
|
||||||
boxToken.put(key, newObject);
|
return boxAccount.put(key, newObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -119,11 +119,10 @@ class AccountCacheClient extends HiveCacheClient<AccountCache> {
|
|||||||
@override
|
@override
|
||||||
Future<void> updateMultipleItem(Map<String, AccountCache> mapObject) {
|
Future<void> updateMultipleItem(Map<String, AccountCache> mapObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxToken = await openBox();
|
final boxAccount = await openBox();
|
||||||
boxToken.putAll(mapObject);
|
return boxAccount.putAll(mapObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@ class EmailCacheClient extends HiveCacheClient<EmailCache> {
|
|||||||
Future<void> insertItem(String key, EmailCache newObject) {
|
Future<void> insertItem(String key, EmailCache newObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxEmail = await openBox();
|
final boxEmail = await openBox();
|
||||||
boxEmail.put(key, newObject);
|
return boxEmail.put(key, newObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -72,7 +72,7 @@ class EmailCacheClient extends HiveCacheClient<EmailCache> {
|
|||||||
Future<void> insertMultipleItem(Map<String, EmailCache> mapObject) {
|
Future<void> insertMultipleItem(Map<String, EmailCache> mapObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxEmail = await openBox();
|
final boxEmail = await openBox();
|
||||||
boxEmail.putAll(mapObject);
|
return boxEmail.putAll(mapObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -82,7 +82,7 @@ class EmailCacheClient extends HiveCacheClient<EmailCache> {
|
|||||||
Future<void> updateItem(String key, EmailCache newObject) {
|
Future<void> updateItem(String key, EmailCache newObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxEmail = await openBox();
|
final boxEmail = await openBox();
|
||||||
boxEmail.put(key, newObject);
|
return boxEmail.put(key, newObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -91,7 +91,7 @@ class EmailCacheClient extends HiveCacheClient<EmailCache> {
|
|||||||
@override
|
@override
|
||||||
Future<bool> isExistTable() {
|
Future<bool> isExistTable() {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
return await Hive.boxExists(tableName);
|
return Hive.boxExists(tableName);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -113,7 +113,7 @@ class EmailCacheClient extends HiveCacheClient<EmailCache> {
|
|||||||
Future<void> updateMultipleItem(Map<String, EmailCache> mapObject) {
|
Future<void> updateMultipleItem(Map<String, EmailCache> mapObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxEmail = await openBox();
|
final boxEmail = await openBox();
|
||||||
boxEmail.putAll(mapObject);
|
return boxEmail.putAll(mapObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -136,7 +136,7 @@ class EmailCacheClient extends HiveCacheClient<EmailCache> {
|
|||||||
Future<void> clearAllData() {
|
Future<void> clearAllData() {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxEmail = await openBox();
|
final boxEmail = await openBox();
|
||||||
boxEmail.clear();
|
return boxEmail.clear();
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class MailboxCacheClient extends HiveCacheClient<MailboxCache> {
|
|||||||
Future<void> insertItem(String key, MailboxCache newObject) {
|
Future<void> insertItem(String key, MailboxCache newObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxMailbox = await openBox();
|
final boxMailbox = await openBox();
|
||||||
boxMailbox.put(key, newObject);
|
return boxMailbox.put(key, newObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -70,7 +70,7 @@ class MailboxCacheClient extends HiveCacheClient<MailboxCache> {
|
|||||||
Future<void> insertMultipleItem(Map<String, MailboxCache> mapObject) {
|
Future<void> insertMultipleItem(Map<String, MailboxCache> mapObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxMailbox = await openBox();
|
final boxMailbox = await openBox();
|
||||||
boxMailbox.putAll(mapObject);
|
return boxMailbox.putAll(mapObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -80,7 +80,7 @@ class MailboxCacheClient extends HiveCacheClient<MailboxCache> {
|
|||||||
Future<void> updateItem(String key, MailboxCache newObject) {
|
Future<void> updateItem(String key, MailboxCache newObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxMailbox = await openBox();
|
final boxMailbox = await openBox();
|
||||||
boxMailbox.put(key, newObject);
|
return boxMailbox.put(key, newObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -89,7 +89,7 @@ class MailboxCacheClient extends HiveCacheClient<MailboxCache> {
|
|||||||
@override
|
@override
|
||||||
Future<bool> isExistTable() {
|
Future<bool> isExistTable() {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
return await Hive.boxExists(tableName);
|
return Hive.boxExists(tableName);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -109,7 +109,7 @@ class MailboxCacheClient extends HiveCacheClient<MailboxCache> {
|
|||||||
Future<void> updateMultipleItem(Map<String, MailboxCache> mapObject) {
|
Future<void> updateMultipleItem(Map<String, MailboxCache> mapObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxMailbox = await openBox();
|
final boxMailbox = await openBox();
|
||||||
boxMailbox.putAll(mapObject);
|
return boxMailbox.putAll(mapObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -119,7 +119,7 @@ class MailboxCacheClient extends HiveCacheClient<MailboxCache> {
|
|||||||
Future<void> clearAllData() {
|
Future<void> clearAllData() {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxMailbox = await openBox();
|
final boxMailbox = await openBox();
|
||||||
boxMailbox.clear();
|
return boxMailbox.clear();
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ class RecentSearchCacheClient extends HiveCacheClient<RecentSearchCache> {
|
|||||||
@override
|
@override
|
||||||
Future<void> clearAllData() {
|
Future<void> clearAllData() {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxState = await openBox();
|
final boxRecent = await openBox();
|
||||||
boxState.clear();
|
return boxRecent.clear();
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -21,8 +21,8 @@ class RecentSearchCacheClient extends HiveCacheClient<RecentSearchCache> {
|
|||||||
@override
|
@override
|
||||||
Future<void> deleteItem(String key) {
|
Future<void> deleteItem(String key) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxState = await openBox();
|
final boxRecent = await openBox();
|
||||||
return boxState.delete(key);
|
return boxRecent.delete(key);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -31,8 +31,8 @@ class RecentSearchCacheClient extends HiveCacheClient<RecentSearchCache> {
|
|||||||
@override
|
@override
|
||||||
Future<void> deleteMultipleItem(List<String> listKey) {
|
Future<void> deleteMultipleItem(List<String> listKey) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxEmail = await openBox();
|
final boxRecent = await openBox();
|
||||||
return boxEmail.deleteAll(listKey);
|
return boxRecent.deleteAll(listKey);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -41,8 +41,8 @@ class RecentSearchCacheClient extends HiveCacheClient<RecentSearchCache> {
|
|||||||
@override
|
@override
|
||||||
Future<List<RecentSearchCache>> getAll() {
|
Future<List<RecentSearchCache>> getAll() {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxState = await openBox();
|
final boxRecent = await openBox();
|
||||||
return boxState.values.toList();
|
return boxRecent.values.toList();
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -50,14 +50,19 @@ class RecentSearchCacheClient extends HiveCacheClient<RecentSearchCache> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<RecentSearchCache?> getItem(String key) {
|
Future<RecentSearchCache?> getItem(String key) {
|
||||||
throw UnimplementedError();
|
return Future.sync(() async {
|
||||||
|
final boxRecent = await openBox();
|
||||||
|
return boxRecent.get(key);
|
||||||
|
}).catchError((error) {
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> insertItem(String key, RecentSearchCache newObject) {
|
Future<void> insertItem(String key, RecentSearchCache newObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxState = await openBox();
|
final boxRecent = await openBox();
|
||||||
boxState.put(key, newObject);
|
return boxRecent.put(key, newObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -65,14 +70,19 @@ class RecentSearchCacheClient extends HiveCacheClient<RecentSearchCache> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> insertMultipleItem(Map<String, RecentSearchCache> mapObject) {
|
Future<void> insertMultipleItem(Map<String, RecentSearchCache> mapObject) {
|
||||||
throw UnimplementedError();
|
return Future.sync(() async {
|
||||||
|
final boxRecent = await openBox();
|
||||||
|
return boxRecent.putAll(mapObject);
|
||||||
|
}).catchError((error) {
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<bool> isExistItem(String key) {
|
Future<bool> isExistItem(String key) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxState = await openBox();
|
final boxRecent = await openBox();
|
||||||
return boxState.containsKey(key);
|
return boxRecent.containsKey(key);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -81,7 +91,7 @@ class RecentSearchCacheClient extends HiveCacheClient<RecentSearchCache> {
|
|||||||
@override
|
@override
|
||||||
Future<bool> isExistTable() {
|
Future<bool> isExistTable() {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
return await Hive.boxExists(tableName);
|
return Hive.boxExists(tableName);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -98,8 +108,8 @@ class RecentSearchCacheClient extends HiveCacheClient<RecentSearchCache> {
|
|||||||
@override
|
@override
|
||||||
Future<void> updateItem(String key, RecentSearchCache newObject) {
|
Future<void> updateItem(String key, RecentSearchCache newObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxState = await openBox();
|
final boxRecent = await openBox();
|
||||||
boxState.put(key, newObject);
|
return boxRecent.put(key, newObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -107,6 +117,11 @@ class RecentSearchCacheClient extends HiveCacheClient<RecentSearchCache> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> updateMultipleItem(Map<String, RecentSearchCache> mapObject) {
|
Future<void> updateMultipleItem(Map<String, RecentSearchCache> mapObject) {
|
||||||
throw UnimplementedError();
|
return Future.sync(() async {
|
||||||
|
final boxRecent = await openBox();
|
||||||
|
return boxRecent.putAll(mapObject);
|
||||||
|
}).catchError((error) {
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ class StateCacheClient extends HiveCacheClient<StateCache> {
|
|||||||
Future<void> insertItem(String key, StateCache newObject) {
|
Future<void> insertItem(String key, StateCache newObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxState = await openBox();
|
final boxState = await openBox();
|
||||||
boxState.put(key, newObject);
|
return boxState.put(key, newObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -70,7 +70,7 @@ class StateCacheClient extends HiveCacheClient<StateCache> {
|
|||||||
Future<void> insertMultipleItem(Map<String, StateCache> mapObject) {
|
Future<void> insertMultipleItem(Map<String, StateCache> mapObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxState = await openBox();
|
final boxState = await openBox();
|
||||||
boxState.putAll(mapObject);
|
return boxState.putAll(mapObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -80,7 +80,7 @@ class StateCacheClient extends HiveCacheClient<StateCache> {
|
|||||||
Future<void> updateItem(String key, StateCache newObject) {
|
Future<void> updateItem(String key, StateCache newObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxState = await openBox();
|
final boxState = await openBox();
|
||||||
boxState.put(key, newObject);
|
return boxState.put(key, newObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -99,7 +99,7 @@ class StateCacheClient extends HiveCacheClient<StateCache> {
|
|||||||
Future<void> deleteMultipleItem(List<String> listKey) {
|
Future<void> deleteMultipleItem(List<String> listKey) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxState = await openBox();
|
final boxState = await openBox();
|
||||||
boxState.deleteAll(listKey);
|
return boxState.deleteAll(listKey);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -109,7 +109,7 @@ class StateCacheClient extends HiveCacheClient<StateCache> {
|
|||||||
Future<void> updateMultipleItem(Map<String, StateCache> mapObject) {
|
Future<void> updateMultipleItem(Map<String, StateCache> mapObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxState = await openBox();
|
final boxState = await openBox();
|
||||||
boxState.putAll(mapObject);
|
return boxState.putAll(mapObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -119,7 +119,7 @@ class StateCacheClient extends HiveCacheClient<StateCache> {
|
|||||||
Future<void> clearAllData() {
|
Future<void> clearAllData() {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxState = await openBox();
|
final boxState = await openBox();
|
||||||
boxState.clear();
|
return boxState.clear();
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class TokenOidcCacheClient extends HiveCacheClient<TokenOidcCache> {
|
|||||||
Future<void> clearAllData() {
|
Future<void> clearAllData() {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxToken = await openBox();
|
final boxToken = await openBox();
|
||||||
boxToken.clear();
|
return boxToken.clear();
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -61,7 +61,7 @@ class TokenOidcCacheClient extends HiveCacheClient<TokenOidcCache> {
|
|||||||
Future<void> insertItem(String key, TokenOidcCache newObject) {
|
Future<void> insertItem(String key, TokenOidcCache newObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxToken = await openBox();
|
final boxToken = await openBox();
|
||||||
boxToken.put(key, newObject);
|
return boxToken.put(key, newObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -71,7 +71,7 @@ class TokenOidcCacheClient extends HiveCacheClient<TokenOidcCache> {
|
|||||||
Future<void> insertMultipleItem(Map<String, TokenOidcCache> mapObject) {
|
Future<void> insertMultipleItem(Map<String, TokenOidcCache> mapObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxToken = await openBox();
|
final boxToken = await openBox();
|
||||||
boxToken.putAll(mapObject);
|
return boxToken.putAll(mapObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -90,7 +90,7 @@ class TokenOidcCacheClient extends HiveCacheClient<TokenOidcCache> {
|
|||||||
@override
|
@override
|
||||||
Future<bool> isExistTable() {
|
Future<bool> isExistTable() {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
return await Hive.boxExists(tableName);
|
return Hive.boxExists(tableName);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -108,7 +108,7 @@ class TokenOidcCacheClient extends HiveCacheClient<TokenOidcCache> {
|
|||||||
Future<void> updateItem(String key, TokenOidcCache newObject) {
|
Future<void> updateItem(String key, TokenOidcCache newObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxToken = await openBox();
|
final boxToken = await openBox();
|
||||||
boxToken.put(key, newObject);
|
return boxToken.put(key, newObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
@@ -118,7 +118,7 @@ class TokenOidcCacheClient extends HiveCacheClient<TokenOidcCache> {
|
|||||||
Future<void> updateMultipleItem(Map<String, TokenOidcCache> mapObject) {
|
Future<void> updateMultipleItem(Map<String, TokenOidcCache> mapObject) {
|
||||||
return Future.sync(() async {
|
return Future.sync(() async {
|
||||||
final boxToken = await openBox();
|
final boxToken = await openBox();
|
||||||
boxToken.putAll(mapObject);
|
return boxToken.putAll(mapObject);
|
||||||
}).catchError((error) {
|
}).catchError((error) {
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user