Skip to main content

netlens_dio 1.2.0 copy "netlens_dio: ^1.2.0" to clipboard
netlens_dio: ^1.2.0 copied to clipboard

NetLens adapter for Dio. Catches Dio calls for the NetLens in-app HTTP inspector and lets NetLens resend them.

NetLens for Dio #

pub package

Connects NetLens, the in-app HTTP inspector for Flutter, to Dio.

Install #

dependencies:
  netlens: ^1.2.0
  netlens_dio: ^1.2.0

Use #

import 'package:dio/dio.dart';
import 'package:netlens/netlens.dart';
import 'package:netlens_dio/netlens_dio.dart';

final netLens = NetLens();
final adapter = NetLensDioAdapter();
netLens.addAdapter(adapter);

final dio = Dio()..interceptors.add(adapter);

// Optional: resend calls with this Dio, so they keep its options and interceptors.
adapter.replayClient = dio;

Mocks #

NetLensDioMockAdapter answers requests with mocks recorded by NetLens, so the app can run offline:

NetLensDioMockAdapter.install(dio, netLens.mocks);
netLens.mocks.mode = NetLensMockMode.replay;

See Mocks.

Documentation #

You can find the documentation here.

Credits #

NetLens is a fork of Alice by Jakub Homlala and its contributors, licensed under the Apache License 2.0.

0
likes
160
points
178
downloads

Documentation

API reference

Publisher

verified publishershewa.tech

Weekly Downloads

NetLens adapter for Dio. Catches Dio calls for the NetLens in-app HTTP inspector and lets NetLens resend them.

Repository (GitHub)
View/report issues

Topics

#http #inspector #dio #interceptor #netlens

License

Apache-2.0 (license)

Dependencies

dio, flutter, netlens

More

Packages that depend on netlens_dio