niddler_dart 0.1.2 copy "niddler_dart: ^0.1.2" to clipboard
niddler_dart: ^0.1.2 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. More information about the plugin can be found at [...]

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'});
  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
pub points
65%
popularity

Publisher

verified publisherchimerapps.com

Niddler network inspector for dart and flutter! Use the niddler IntelliJ and Android Studio plugin to debug your network requests during development. More information about the plugin can be found at https://github.com/icapps/niddler-ui

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

pointycastle, synchronized, uuid

More

Packages that depend on niddler_dart