absinthe_socket 0.0.2

  • README.md
  • Installing
  • Versions
  • new39


A dart client for GraphQL subscriptions via Absinthe sockets

Getting Started

Use the package:

# pubspec.yaml
# ...
  absinthe_socket: ^0.0.2
# ...

Create a socket, connect it, add a subscription:

    _socket = AbsintheSocket("ws://");
    Observer _categoryObserver = Observer(
        onAbort: _onAbort,
        onCancel: _onCancel,
        onError: _onError,
        onResult: _onResult,
        onStart: _onStart);

    Notifier notifier = _socket.send(GqlRequest(
            "subscription CategoryAdded { categoryAdded { id, title } }"));
    // I also track notifiers to cancel them when my flutter widget is disposed of
    // Then when the widget is disposed, I cancel the notifiers:
    _notifiers.forEach((Notifier notifier) => _socket.cancel(notifier))

This is a shameless bad rip-off of part of the API of @absinthe/socket.

[0.0.1] - TODO: Add release date.

  • TODO: Describe initial release.

Use this package as a library

1. Depend on it

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

  absinthe_socket: ^0.0.2

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:absinthe_socket/absinthe_socket.dart';
Version Uploaded Documentation Archive
0.0.2 Dec 8, 2018 Go to the documentation of absinthe_socket 0.0.2 Download absinthe_socket 0.0.2 archive
0.0.1 Dec 8, 2018 Go to the documentation of absinthe_socket 0.0.1 Download absinthe_socket 0.0.1 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 Dec 8, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7


Detected platforms: Flutter, other

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

Health issues and suggestions

Document public APIs (-9.82 points)

55 out of 56 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use absinthe_socket.dart.

Package is pre-v0.1 release. (-10 points)

While there is nothing inherently wrong with versions of 0.0.*, it usually means that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
phoenix_wings ^0.1.3 0.1.3