Skip to content

Commit 390e330

Browse files
committed
chore: renamed package
1 parent cd50db5 commit 390e330

File tree

5 files changed

+18
-37
lines changed

5 files changed

+18
-37
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
[![style: very good analysis](https://img.shields.io/badge/style-very_good_analysis-B22C89.svg)](https://pub.dev/packages/very_good_analysis)
55
[![License: PolyForm Free Trial](https://img.shields.io/badge/License-PolyForm%20Free%20Trial-blue)](https://polyformproject.org/licenses/free-trial/1.0.0)
66

7-
A repository package that provides an abstraction layer over authentication operations. It wraps an `AuthClient` implementation, offering a clean interface for authentication flows, ensuring standardized exception propagation, and handling authentication token persistence using `HtKVStorageService`.
7+
A repository package that provides an abstraction layer over authentication operations. It wraps an `AuthClient` implementation, offering a clean interface for authentication flows, ensuring standardized exception propagation, and handling authentication token persistence using `KvStorageService`.
88

99
## Getting Started
1010

1111
Add the package to your `pubspec.yaml`:
1212

1313
```yaml
1414
dependencies:
15-
auth_repository: any # Use the latest version
16-
```
15+
auth-repository:
16+
git:
17+
url: https://github.com/flutter-news-app-full-source-code/auth-repository.git
1718

1819
## Features
1920

@@ -25,23 +26,23 @@ dependencies:
2526
- `verifySignInCode`: Verifies the code, saves the auth token, and returns the user.
2627
- `signInAnonymously`: Signs in anonymously, saves the auth token, and returns the user.
2728
- `signOut`: Signs out the user and clears the auth token.
28-
- Manages authentication token persistence internally using `HtKVStorageService`.
29+
- Manages authentication token persistence internally using `KvStorageService`.
2930
- Exposes `saveAuthToken(String token)`, `getAuthToken()`, and `clearAuthToken()` for direct token manipulation if needed, but these are typically handled by the main auth flow methods.
3031
- Propagates standardized `HttpException`s from the underlying client and `StorageException`s from the storage service.
3132

3233
## Usage
3334

34-
Instantiate `AuthRepository` by providing implementations of `AuthClient` and `HtKVStorageService`:
35+
Instantiate `AuthRepository` by providing implementations of `AuthClient` and `KvStorageService`:
3536

3637
```dart
3738
import 'package:auth_client/auth_client.dart';
3839
import 'package:auth_repository/auth_repository.dart';
39-
import 'package:ht_kv_storage_service/ht_kv_storage_service.dart';
40+
import 'package:kv_storage_service/kv_storage_service.dart';
4041
4142
// Assume ConcreteAuthClient is an implementation of AuthClient
4243
final authClient = ConcreteAuthClient(...);
4344
44-
// Assume ConcreteKVStorageService is an implementation of HtKVStorageService
45+
// Assume ConcreteKVStorageService is an implementation of KvStorageService
4546
final storageService = ConcreteKVStorageService(...);
4647
4748
final authRepository = AuthRepository(

coverage_badge.svg

Lines changed: 0 additions & 20 deletions
This file was deleted.

lib/src/auth_repository.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import 'dart:async';
55

66
import 'package:auth_client/auth_client.dart';
77
import 'package:core/core.dart';
8-
import 'package:ht_kv_storage_service/ht_kv_storage_service.dart';
8+
import 'package:kv_storage_service/kv_storage_service.dart';
99

1010
/// {@template auth_repository}
1111
/// A repository that manages authentication operations.
@@ -21,12 +21,12 @@ class AuthRepository {
2121
/// authentication operations.
2222
const AuthRepository({
2323
required AuthClient authClient,
24-
required HtKVStorageService storageService,
24+
required KVStorageService storageService,
2525
}) : _authClient = authClient,
2626
_storageService = storageService;
2727

2828
final AuthClient _authClient;
29-
final HtKVStorageService _storageService;
29+
final KVStorageService _storageService;
3030

3131
/// Stream emitting the current authenticated [User] or `null`.
3232
///

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ dependencies:
1313
core:
1414
git:
1515
url: https://github.com/flutter-news-app-full-source-code/core.git
16-
ht_kv_storage_service:
16+
kv_storage_service:
1717
git:
18-
url: https://github.com/flutter-news-app-full-source-code/ht-kv-storage-service.git
18+
url: https://github.com/flutter-news-app-full-source-code/kv-storage-service.git
1919

2020
dev_dependencies:
2121
mocktail: ^1.0.4

test/src/auth_repository_test.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@ import 'dart:async';
66
import 'package:auth_client/auth_client.dart';
77
import 'package:auth_repository/auth_repository.dart';
88
import 'package:core/core.dart';
9-
import 'package:ht_kv_storage_service/ht_kv_storage_service.dart';
9+
import 'package:kv_storage_service/kv_storage_service.dart';
1010
import 'package:mocktail/mocktail.dart';
1111
import 'package:test/test.dart';
1212

1313
// Mock AuthClient
1414
class MockAuthClient extends Mock implements AuthClient {}
1515

16-
// Mock HtKVStorageService
17-
class MockHtKVStorageService extends Mock implements HtKVStorageService {}
16+
// Mock KvStorageService
17+
class MockKvStorageService extends Mock implements KVStorageService {}
1818

1919
// Mock User
2020
class MockUser extends Mock implements User {}
2121

2222
void main() {
2323
group('AuthRepository', () {
2424
late AuthClient mockAuthClient;
25-
late HtKVStorageService mockStorageService;
25+
late KVStorageService mockStorageService;
2626
late AuthRepository authRepository;
2727

2828
setUp(() {
2929
mockAuthClient = MockAuthClient();
30-
mockStorageService = MockHtKVStorageService();
30+
mockStorageService = MockKvStorageService();
3131
authRepository = AuthRepository(
3232
authClient: mockAuthClient,
3333
storageService: mockStorageService,

0 commit comments

Comments
 (0)