You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-10Lines changed: 21 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,11 @@
1
1
# Key-Value Storage Service Interface
2
2
3
-
A Dart package defining an abstract interface (`HtKVStorageService`) for key-value storage. This promotes consistency and allows for interchangeable storage implementations (like SharedPreferences, Hive, secure storage, etc.).
A Dart package defining an abstract interface (`KVStorageService`) for key-value storage. This promotes consistency and allows for interchangeable storage implementations (like SharedPreferences, Hive, secure storage, etc.).
4
9
5
10
## Features ✨
6
11
@@ -21,21 +26,21 @@ Add the package to your `pubspec.yaml`:
1. **Implement the Interface:** Create a concrete class that implements `HtKVStorageService` using your desired storage mechanism (e.g., `shared_preferences`).
37
+
1. **Implement the Interface:** Create a concrete class that implements `KVStorageService` using your desired storage mechanism (e.g., `shared_preferences`).
// Obtain an instance of your HtKVStorageService implementation
79
+
// Obtain an instance of your KVStorageService implementation
75
80
// (e.g., using dependency injection or direct instantiation)
76
81
// final prefs = await SharedPreferences.getInstance();
77
82
// final storageService = HtKVStorageSharedPreferences(prefs);
@@ -102,7 +107,7 @@ dependencies:
102
107
103
108
## Error Handling
104
109
105
-
The `HtKVStorageService` methods may throw specific exceptions derived from `StorageException` upon failure:
110
+
The `KVStorageService` methods may throw specific exceptions derived from `StorageException` upon failure:
106
111
107
112
* `StorageWriteException`: Thrown by `write*` methods on failure.
108
113
* `StorageReadException`: Thrown by `read*` methods on general read failure.
@@ -112,3 +117,9 @@ The `HtKVStorageService` methods may throw specific exceptions derived from `Sto
112
117
* `StorageTypeMismatchException`: Thrown by `read*` methods if the stored data type doesn't match the expected type.
113
118
114
119
Implementations should handle these exceptions appropriately (e.g., using `try-catch` blocks).
120
+
121
+
## 🔑 Licensing
122
+
123
+
This package is source-available and licensed under the [PolyForm Free Trial 1.0.0](LICENSE). Please review the terms before use.
124
+
125
+
For commercial licensing options that grant the right to build and distribute unlimited applications, please visit the main [**Flutter News App - Full Source Code Toolkit**](https://github.com/flutter-news-app-full-source-code) organization.
0 commit comments