niddler_dart 0.2.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new31

Niddler network inspector for dart and flutter

latestVersion

Usage #

A simple usage example:

import 'package:niddler_dart/niddler_dart.dart';

main() {

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();
  await niddler.start();
  NiddlerInjector.install(niddler);
  
  //Make http requests ...
  
  await niddler.stop();
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.1.5 #

  • Revert dart compatibility change. Restrict running to dart < 2.3.2 for now

0.1.4 #

  • Support newer versions of dart by implementing noSuchMethod

0.1.3 #

  • Use isolates to greatly reduce main event locking

0.1.2 #

  • Added support for blacklisting urls

0.1.1 #

  • Removed dependency on http

0.1.0 #

  • Initial public version

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');
//  print('Post body: ${response.body}');
  print('Get body (blacklisted): ${response2.body}');

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

  await niddler.stop();

  await Future.delayed(Duration(seconds: 2));
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  niddler_dart: ^0.2.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:niddler_dart/niddler_dart.dart';
  
Version Uploaded Documentation Archive
0.2.1 Jun 11, 2019 Go to the documentation of niddler_dart 0.2.1 Download niddler_dart 0.2.1 archive
0.1.5 Jun 7, 2019 Go to the documentation of niddler_dart 0.1.5 Download niddler_dart 0.1.5 archive
0.1.4 Jun 7, 2019 Go to the documentation of niddler_dart 0.1.4 Download niddler_dart 0.1.4 archive
0.1.3 Jun 7, 2019 Go to the documentation of niddler_dart 0.1.3 Download niddler_dart 0.1.3 archive
0.1.2 Jun 3, 2019 Go to the documentation of niddler_dart 0.1.2 Download niddler_dart 0.1.2 archive
0.1.1 May 31, 2019 Go to the documentation of niddler_dart 0.1.1 Download niddler_dart 0.1.1 archive
0.3.0-master Jun 12, 2019 Go to the documentation of niddler_dart 0.3.0-master Download niddler_dart 0.3.0-master archive
Popularity:
Describes how popular the package is relative to other packages. [more]
43
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
50
Overall:
Weighted score of the above. [more]
31
Learn more about scoring.

We analyzed this package on Jun 18, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.2
  • pana: 0.12.18

Platforms

Detected platforms:

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.3.2.
 
 Because niddler_dart requires SDK version >=2.2.0 <2.3.2, version solving failed.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Support the latest stable Dart SDK in pubspec.yaml. (-20 points)

The SDK constraint in pubspec.yaml doesn't allow the latest stable Dart SDK release.

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <2.3.2