Skip to content

Commit 9b398ac

Browse files
committed
Updated: replaced collectionName with empty String
1 parent ba27e5c commit 9b398ac

File tree

1 file changed

+12
-24
lines changed
  • lib/vaahextendflutter/services/storage/local/services

1 file changed

+12
-24
lines changed

lib/vaahextendflutter/services/storage/local/services/hive.dart

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class LocalStorageWithHive implements LocalStorageService {
1515

1616
@override
1717
Future<void> create({
18-
String collectionName = 'vaah-flutter-hive-box',
18+
String collectionName = '',
1919
required String key,
2020
required String value,
2121
}) async {
@@ -26,20 +26,14 @@ class LocalStorageWithHive implements LocalStorageService {
2626
}
2727

2828
@override
29-
Future<void> createMany({
30-
String collectionName = 'vaah-flutter-hive-box',
31-
required Map<String, String> values,
32-
}) async {
29+
Future<void> createMany({String collectionName = '', required Map<String, String> values}) async {
3330
for (String k in values.keys) {
3431
await create(collectionName: collectionName, key: k, value: values[k]!);
3532
}
3633
}
3734

3835
@override
39-
Future<String?> read({
40-
String collectionName = 'vaah-flutter-hive-box',
41-
required String key,
42-
}) async {
36+
Future<String?> read({String collectionName = '', required String key}) async {
4337
assert(_collections.containsKey(collectionName), 'The Box "$collectionName" does not exists.');
4438

4539
String? result = _collections[collectionName]!.get(key);
@@ -48,7 +42,7 @@ class LocalStorageWithHive implements LocalStorageService {
4842

4943
@override
5044
Future<Map<String, String?>> readMany({
51-
String collectionName = 'vaah-flutter-hive-box',
45+
String collectionName = '',
5246
required List<String> keys,
5347
}) async {
5448
assert(_collections.containsKey(collectionName), 'The Box "$collectionName" does not exists.');
@@ -65,7 +59,7 @@ class LocalStorageWithHive implements LocalStorageService {
6559
}
6660

6761
@override
68-
Future<Map<String, String?>> readAll({String collectionName = 'vaah-flutter-hive-box'}) async {
62+
Future<Map<String, String?>> readAll({String collectionName = ''}) async {
6963
assert(_collections.containsKey(collectionName), 'The Box "$collectionName" does not exists.');
7064

7165
Map<String, String?> result = _collections[collectionName]!
@@ -76,7 +70,7 @@ class LocalStorageWithHive implements LocalStorageService {
7670

7771
@override
7872
Future<void> update({
79-
String collectionName = 'vaah-flutter-hive-box',
73+
String collectionName = '',
8074
required String key,
8175
required String value,
8276
}) async {
@@ -87,18 +81,15 @@ class LocalStorageWithHive implements LocalStorageService {
8781
}
8882

8983
@override
90-
Future<void> updateMany({
91-
String collectionName = 'vaah-flutter-hive-box',
92-
required Map<String, String> values,
93-
}) async {
84+
Future<void> updateMany({String collectionName = '', required Map<String, String> values}) async {
9485
for (String k in values.keys) {
9586
await update(collectionName: collectionName, key: k, value: values[k]!);
9687
}
9788
}
9889

9990
@override
10091
Future<void> createOrUpdate({
101-
String collectionName = 'vaah-flutter-hive-box',
92+
String collectionName = '',
10293
required String key,
10394
required String value,
10495
}) async {
@@ -109,7 +100,7 @@ class LocalStorageWithHive implements LocalStorageService {
109100

110101
@override
111102
Future<void> createOrUpdateMany({
112-
String collectionName = 'vaah-flutter-hive-box',
103+
String collectionName = '',
113104
required Map<String, String> values,
114105
}) async {
115106
for (String k in values.keys) {
@@ -118,17 +109,14 @@ class LocalStorageWithHive implements LocalStorageService {
118109
}
119110

120111
@override
121-
Future<void> delete({String collectionName = 'vaah-flutter-hive-box', dynamic key}) async {
112+
Future<void> delete({String collectionName = '', dynamic key}) async {
122113
assert(_collections.containsKey(collectionName), 'The Box "$collectionName" does not exists.');
123114

124115
await _collections[collectionName]!.delete(key);
125116
}
126117

127118
@override
128-
Future<void> deleteMany({
129-
String collectionName = 'vaah-flutter-hive-box',
130-
List<String> keys = const [],
131-
}) async {
119+
Future<void> deleteMany({String collectionName = '', List<String> keys = const []}) async {
132120
assert(_collections.containsKey(collectionName), 'The Box "$collectionName" does not exists.');
133121

134122
if (keys.isNotEmpty) {
@@ -137,7 +125,7 @@ class LocalStorageWithHive implements LocalStorageService {
137125
}
138126

139127
@override
140-
Future<void> deleteAll({String collectionName = 'vaah-flutter-hive-box'}) async {
128+
Future<void> deleteAll({String collectionName = ''}) async {
141129
assert(_collections.containsKey(collectionName), 'The Box "$collectionName" does not exists.');
142130

143131
await _collections[collectionName]!.clear();

0 commit comments

Comments
 (0)