refactor(http)!: fix cascade dart good practices + docs

This commit is contained in:
2023-04-13 23:29:27 +02:00
parent 216a6c2aae
commit 07c2f4aeff
33 changed files with 303 additions and 974 deletions
@@ -24,15 +24,23 @@ import 'package:wyatt_http_client/src/models/unfreezed_request.dart';
import 'package:wyatt_http_client/src/pipeline.dart';
import 'package:wyatt_http_client/src/utils/http_methods.dart';
/// {@template middleware_client}
/// A custom [Client] implementation that allows you to intercept requests
/// and responses and modify them before they are sent to the server or
/// before they are returned to the client.
/// {@endtemplate}
class MiddlewareClient extends BaseClient {
/// {@macro middleware_client}
MiddlewareClient({
Pipeline? pipeline,
Client? inner,
}) : pipeline = pipeline ?? Pipeline(),
inner = inner ?? Client() {
print('Using Pipeline:\n$pipeline');
}
inner = inner ?? Client();
/// The [Client] that will be used to send requests.
final Client inner;
/// The [Pipeline] that will be used to intercept requests and responses.
final Pipeline pipeline;
@override