protoo_client 0.1.0

  • Installing
  • Versions
  • new43

protoo-client #

Dart version of the protoo-client js library.

Minimalist and extensible Dart signaling framework for multi-party Real-Time Communication applications

Usage #

import 'package:protoo_client/protoo_client.dart';

main() async {

  Peer peer = new Peer('ws://');

  peer.on('open', () {
    // After socket open to send a request.
    peer.send('login', {'username':'myname','password','mypass', 'other': {}})
    .then((data) {
      // Handle accept from server.
      print('response: ' + data.toString());
    }).catchError((error) {
      // Handle reject from server.
      print('response error: ' + error.toString());

  peer.on('close', () {

  peer.on('error', (error) {
    print('error ' + error);
  // Handle request from server.
  peer.on('request', (request, accept, reject) {
    print('request: ' + request.toString());
    reject(486, 'Busy Here!!!');

  await peer.connect();

Changelog #

[0.1.0] - 2019.03.22

Initial release.

Use this package as a library

1. Depend on it

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

  protoo_client: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:

import 'package:protoo_client/protoo_client.dart';
Version Uploaded Documentation Archive
0.1.0 Mar 22, 2019 Go to the documentation of protoo_client 0.1.0 Download protoo_client 0.1.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.2.0
  • pana: 0.12.14


Detected platforms: Flutter, other

Primary library: package:protoo_client/protoo_client.dart with components: io.

Health issues and suggestions

Document public APIs. (-1 points)

14 out of 14 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/Peer.dart. (-1 points)

Analysis of lib/src/Peer.dart reported 2 hints:

line 12 col 7: The value of the field '_socket' isn't used.

line 15 col 7: The value of the field '_url' isn't used.

Fix lib/src/Message.dart. (-0.50 points)

Analysis of lib/src/Message.dart reported 1 hint:

line 13 col 9: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

Fix lib/src/logger.dart. (-0.50 points)

Analysis of lib/src/logger.dart reported 1 hint:

line 3 col 26: Use ; instead of {} for empty constructor bodies.

Fix lib/src/transports/WebSocketTransport.dart. (-0.50 points)

Analysis of lib/src/transports/WebSocketTransport.dart reported 1 hint:

line 36 col 3: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

Format lib/protoo_client.dart.

Run dartfmt to format lib/protoo_client.dart.

Maintenance suggestions

The package description is too short. (-18 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and protoo_client.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >1.8.0 <3.0.0
events2 ^0.1.3 0.1.3