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
[](https://pub.dev/packages/very_good_analysis)
@@ -8,14 +8,14 @@ A robust and reusable Dart HTTP client built on top of the `dio` package. It sim
8
8
9
9
## Description
10
10
11
-
This package provides an `HtHttpClient` class designed to be used as a foundational data access component in Dart or Flutter applications. It abstracts away the complexities of setting up `dio`, handling authentication tokens, and interpreting various HTTP error conditions, offering a cleaner interface for making API calls.
11
+
This package provides an `HttpClient` class designed to be used as a foundational data access component in Dart or Flutter applications. It abstracts away the complexities of setting up `dio`, handling authentication tokens, and interpreting various HTTP error conditions, offering a cleaner interface for making API calls.
* Automatic injection of `Authorization: Bearer <token>` headers via an interceptor.
17
17
* Token retrieval via a flexible `TokenProvider` function.
18
-
* Mapping of `DioException` types and non-2xx HTTP status codes to specific `HtHttpException` subtypes (`NetworkException`, `BadRequestException`, `UnauthorizedException`, etc.) defined in the `ht_shared` package.
18
+
* Mapping of `DioException` types and non-2xx HTTP status codes to specific `HttpException` subtypes (`NetworkException`, `BadRequestException`, `UnauthorizedException`, etc.) defined in the `core` package.
19
19
* Support for request cancellation using `dio`'s `CancelToken`.
20
20
21
21
## Getting Started
@@ -24,27 +24,27 @@ Add the package to your `pubspec.yaml`:
} on HtHttpException catch (e) { // Catch other specific or general client errors
94
+
} on HttpException catch (e) { // Catch other specific or general client errors
95
95
print('HTTP Client Error: ${e.message}');
96
96
} catch (e) { // Catch any other unexpected errors
97
97
print('An unexpected error occurred: $e');
@@ -104,13 +104,15 @@ void main() async {
104
104
data: {'name': 'New Item', 'value': 123},
105
105
);
106
106
print('Created item: $newItem');
107
-
} on HtHttpException catch (e) {
107
+
} on HttpException catch (e) {
108
108
print('Error creating item: ${e.message}');
109
109
}
110
110
}
111
111
112
112
```
113
113
114
-
## License
114
+
## 🔑 Licensing
115
115
116
-
This package is licensed under the [PolyForm Free Trial](https://polyformproject.org/licenses/free-trial/1.0.0). Please review the terms before use.
116
+
This package is source-available and licensed under the [PolyForm Free Trial 1.0.0](LICENSE). Please review the terms before use.
117
+
118
+
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.
description: Robust and reusable Dart HTTP client built on top of the `dio` package. It simplifies API interactions by providing common HTTP methods, automatic authentication header injection, and mapping network/status code errors to specific custom exceptions.
0 commit comments