Skip to content

Commit 9ab4ec1

Browse files
committed
chore: rename package
1 parent 2378d66 commit 9ab4ec1

File tree

11 files changed

+68
-77
lines changed

11 files changed

+68
-77
lines changed

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ci
1+
name: main
22

33
concurrency:
44
group: ${{ github.workflow }}-${{ github.ref }}

README.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Key-Value Storage Service Interface
22

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.).
3+
![coverage: xx](https://img.shields.io/badge/coverage-94-green)
4+
[![style: very good analysis](https://img.shields.io/badge/style-very_good_analysis-B22C89.svg)](https://pub.dev/packages/very_good_analysis)
5+
[![License: PolyForm Free Trial](https://img.shields.io/badge/License-PolyForm%20Free%20Trial-blue)](https://polyformproject.org/licenses/free-trial/1.0.0)
6+
7+
8+
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.).
49

510
## Features ✨
611

@@ -21,21 +26,21 @@ Add the package to your `pubspec.yaml`:
2126

2227
```yaml
2328
dependencies:
24-
ht_kv_storage_service:
29+
kv_storage_service:
2530
git:
26-
url: https://github.com/headlines-toolkit/ht-kv-storage-service.git
31+
url: https://github.com/flutter-news-app-full-source-codet/kv-storage-service.git
2732
ref: main
2833
```
2934
3035
### Usage
3136
32-
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`).
3338

3439
```dart
35-
import 'package:ht_kv_storage_service/ht_kv_storage_service.dart';
40+
import 'package:kv_storage_service/kv_storage_service.dart';
3641
import 'package:shared_preferences/shared_preferences.dart';
3742
38-
class HtKVStorageSharedPreferences implements HtKVStorageService {
43+
class HtKVStorageSharedPreferences implements KVStorageService {
3944
HtKVStorageSharedPreferences(this._prefs);
4045
4146
final SharedPreferences _prefs;
@@ -64,14 +69,14 @@ dependencies:
6469
}
6570
```
6671

67-
2. **Use the Service:** Inject or provide an instance of your concrete implementation and use the `HtKVStorageService` interface methods.
72+
2. **Use the Service:** Inject or provide an instance of your concrete implementation and use the `KVStorageService` interface methods.
6873

6974
```dart
70-
import 'package:ht_kv_storage_service/ht_kv_storage_service.dart';
75+
import 'package:kv_storage_service/kv_storage_service.dart';
7176
// import 'package:your_package/your_storage_implementation.dart';
7277
7378
Future<void> main() async {
74-
// Obtain an instance of your HtKVStorageService implementation
79+
// Obtain an instance of your KVStorageService implementation
7580
// (e.g., using dependency injection or direct instantiation)
7681
// final prefs = await SharedPreferences.getInstance();
7782
// final storageService = HtKVStorageSharedPreferences(prefs);
@@ -102,7 +107,7 @@ dependencies:
102107

103108
## Error Handling
104109

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:
106111

107112
* `StorageWriteException`: Thrown by `write*` methods on failure.
108113
* `StorageReadException`: Thrown by `read*` methods on general read failure.
@@ -112,3 +117,9 @@ The `HtKVStorageService` methods may throw specific exceptions derived from `Sto
112117
* `StorageTypeMismatchException`: Thrown by `read*` methods if the stored data type doesn't match the expected type.
113118

114119
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.

coverage/lcov.info

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
SF:lib\src\ht_kv_storage_service.dart
2-
DA:11,2
3-
DA:13,1
4-
DA:15,2
1+
SF:lib\src\kv_storage_service.dart
2+
DA:8,3
53
DA:16,1
6-
DA:17,3
4+
DA:18,2
75
DA:19,1
86
DA:20,3
9-
DA:28,2
10-
DA:39,2
11-
DA:46,1
12-
DA:48,4
13-
DA:49,1
14-
DA:50,3
15-
DA:62,2
16-
DA:68,1
17-
DA:70,4
18-
DA:71,1
19-
DA:72,3
20-
DA:83,2
21-
DA:89,1
22-
DA:91,4
23-
DA:92,1
24-
DA:93,3
25-
DA:101,2
26-
DA:114,2
27-
DA:117,1
28-
DA:119,1
29-
DA:121,4
30-
DA:137,2
31-
DA:142,1
32-
DA:144,1
33-
DA:146,6
7+
DA:22,1
8+
DA:23,3
9+
DA:34,2
10+
DA:42,3
11+
DA:55,1
12+
DA:57,3
13+
DA:58,1
14+
DA:59,3
15+
DA:71,3
16+
DA:80,1
17+
DA:82,3
18+
DA:83,1
19+
DA:84,3
20+
DA:95,3
21+
DA:104,1
22+
DA:106,3
23+
DA:107,1
24+
DA:108,3
25+
DA:119,3
26+
DA:133,2
27+
DA:136,0
28+
DA:141,1
29+
DA:143,3
30+
DA:153,2
31+
DA:158,0
32+
DA:169,1
33+
DA:171,5
3434
LF:32
35-
LH:32
35+
LH:30
3636
end_of_record
3737
SF:lib\src\storage_keys.dart
3838
DA:21,1

coverage_badge.svg

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// Defines an abstract interface for key-value storage services.
2-
library ht_kv_storage_service;
2+
library kv_storage_service;
33

4-
export 'src/ht_kv_storage_service.dart';
4+
export 'src/kv_storage_service.dart';
55
export 'src/storage_keys.dart';

lib/src/ht_kv_storage_service.dart renamed to lib/src/kv_storage_service.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class StorageTypeMismatchException extends StorageException {
182182
/// secure storage). It allows for storing and retrieving basic data types
183183
/// associated with string keys.
184184
/// {@endtemplate}
185-
abstract class HtKVStorageService {
185+
abstract class KVStorageService {
186186
/// Writes a string value associated with the given [key].
187187
///
188188
/// Throws a [StorageWriteException] if the write operation fails.

lib/src/storage_keys.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import 'package:ht_kv_storage_service/src/ht_kv_storage_service.dart';
1+
import 'package:kv_storage_service/src/kv_storage_service.dart';
22

33
/// {@template storage_key}
44
/// Defines enum members representing keys used for accessing values
5-
/// stored within the [HtKVStorageService].
5+
/// stored within the [KVStorageService].
66
///
77
/// This enum prevents the use of magic strings for keys, promoting
88
/// type safety and reducing potential runtime errors. Use the [stringValue]

pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: ht_kv_storage_service
1+
name: kv_storage_service
22
description: Defines an abstract interface for key-value storage services in Dart.
3-
repository: https://github.com/headlines-toolki/ht-kv-storage-service
3+
repository: https://github.com/flutter-news-app-full-source-code/kv-storage-service
44
publish_to: none
55

66
environment:
@@ -9,4 +9,4 @@ environment:
99
dev_dependencies:
1010
mocktail: ^1.0.4
1111
test: ^1.25.8
12-
very_good_analysis: ^7.0.0
12+
very_good_analysis: ^9.0.0

test/src/ht_kv_storage_service_test.dart renamed to test/src/kv_storage_service_test.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import 'package:ht_kv_storage_service/ht_kv_storage_service.dart';
1+
import 'package:kv_storage_service/kv_storage_service.dart';
22
import 'package:mocktail/mocktail.dart';
33
import 'package:test/test.dart';
44

55
// Create a mock implementation of the abstract class
6-
class MockHtKVStorageService extends Mock implements HtKVStorageService {}
6+
class MockKVStorageService extends Mock implements KVStorageService {}
77

88
// Define sample exceptions for testing purposes
99
const testWriteException = StorageWriteException('testKey', 'testValue');
@@ -18,11 +18,11 @@ const testTypeMismatchException = StorageTypeMismatchException(
1818
const testKeyNotFoundException = StorageKeyNotFoundException('testKey');
1919

2020
void main() {
21-
group('HtKVStorageService Abstract Class', () {
22-
late MockHtKVStorageService mockStorageService;
21+
group('KVStorageService Abstract Class', () {
22+
late MockKVStorageService mockStorageService;
2323

2424
setUp(() {
25-
mockStorageService = MockHtKVStorageService();
25+
mockStorageService = MockKVStorageService();
2626

2727
// Register fallback values for methods returning non-nullable types
2828
// or futures of non-nullable types, if needed by specific tests.

test/src/storage_exceptions_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ignore_for_file: lines_longer_than_80_chars
22

3-
import 'package:ht_kv_storage_service/ht_kv_storage_service.dart';
3+
import 'package:kv_storage_service/kv_storage_service.dart';
44
import 'package:test/test.dart';
55

66
void main() {

0 commit comments

Comments
 (0)