nector 1.1.0 copy "nector: ^1.1.0" to clipboard
nector: ^1.1.0 copied to clipboard

A HTTP inspector tool for 'dio' to analyse the network calls in a flutter app.

example/lib/main.dart

import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:nector/nector.dart';

void main() {
  runApp(const NectorExample());
}

class NectorExample extends StatefulWidget {
  const NectorExample({super.key});

  @override
  State<NectorExample> createState() => _NectorExampleState();
}

class _NectorExampleState extends State<NectorExample> {
  late Dio _dio;
  late Nector _nector;
  final GlobalKey<NavigatorState> _mainNavigatorKey = GlobalKey();

  @override
  void initState() {
    super.initState();
    _dio = Dio(BaseOptions());
    _nector = Nector(navigatorKey: _mainNavigatorKey);
    _dio.interceptors.add(_nector.getDioInterceptor());

    /// Or if you are using queued interceptors you can add the
    /// interceptors respectively at onRequest, onResponse, onError
    
    // _dio.interceptors.add(QueuedInterceptorsWrapper(
    //   onRequest: (options, handler) => _nector.onRequest(options, handler),
    //   onResponse: (options, handler) => _nector.onResponse(options, handler),
    //   onError: (options, handler) => _nector.onError(options, handler),
    // ));
  }

  @override
  Widget build(BuildContext context) {
    return const MaterialApp();
  }
}
7
likes
0
points
5
downloads

Publisher

unverified uploader

Weekly Downloads

A HTTP inspector tool for 'dio' to analyse the network calls in a flutter app.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dio, flutter, plugin_platform_interface, rxdart

More

Packages that depend on nector

Packages that implement nector