niddler_dart 0.3.0-master copy "niddler_dart: ^0.3.0-master" to clipboard
niddler_dart: ^0.3.0-master copied to clipboard

outdated

Niddler network inspector for dart and flutter! Use the niddler IntelliJ and Android Studio plugin to debug your network requests during development.

example/main.dart

import 'dart:convert';

import 'package:http/http.dart' as http;
import 'package:niddler_dart/niddler_dart.dart';

Future<void> main() async {
  final niddlerBuilder = NiddlerBuilder()
    ..bundleId = 'com.test.test'
    ..serverInfo = NiddlerServerInfo('Some descriptive name', 'Some description')
    ..port = 0; //0 to have niddler pick it's own port. Automatic discovery will make this visible

  final niddler = niddlerBuilder.build()..addBlacklist(RegExp('.*/get'));
  await niddler.start();
  NiddlerInjector.install(niddler);

  final value = {'test': 'data'};

  final response = await http.post('http://httpbin.org/post', body: json.encode(value), headers: {'content-type': 'application/json'});
  final response2 = await http.get('http://httpbin.org/get', headers: {'content-type': 'application/json'});
  await http.get('http://placekitten.com/200/300');

  print('Post body: ${response.body}');
  print('Get body (blacklisted): ${response2.body}');

  await Future.delayed(Duration(seconds: 100));

  await niddler.stop();

  await Future.delayed(Duration(seconds: 2));
}
10
likes
0
points
209
downloads

Publisher

verified publisherchimerapps.com

Weekly Downloads

Niddler network inspector for dart and flutter! Use the niddler IntelliJ and Android Studio plugin to debug your network requests during development.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

pointycastle, synchronized, uuid

More

Packages that depend on niddler_dart