dartpusherclient 0.0.2

  • Readme
  • Changelog
  • Installing
  • 43

dartpusherclient #

A simple dart package to handle pusher client side.

Getting Started #

import 'dartpusherclient.dart';

void main() {
  Pusher p = Pusher('APP_KEY', cluster: 'eu');

  p.connect().then((Pusher pu) {
    pu.subscribe('my-channel').listen('test', (PusherEvent e) {
      print("Received: ${e.event} in ${e.channel} with data ${e.data}");
    }).listen('away', (PusherEvent e) {
      print("Received: ${e.event} in ${e.channel} with data ${e.data}");
    });
  });
}

Contributions #

Contributions are most welcome.

Roadmap: #

FeatureSince
Channels0.0.1
Private Channels?
Presence Channels?

[0.0.1] - 21.02.2020. #

  • Implement support for channels and base scaffolding of client.

[0.0.2] - 31.03.2020. #

  • Update pubspec, remove deprecated author.

Use this package as a library

1. Depend on it

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


dependencies:
  dartpusherclient: ^0.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:dartpusherclient/dartpusherclient.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
96
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
71
Overall:
Weighted score of the above. [more]
43
Learn more about scoring.

We analyzed this package on Jul 11, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.15

Analysis suggestions

Package not compatible with runtime flutter-web on Web

Because:

  • package:dartpusherclient/dartpusherclient.dart that imports:
  • package:dartpusherclient/pusher_channel.dart that imports:
  • package:dartpusherclient/pusher.dart that imports:
  • package:dartpusherclient/connection.dart that imports:
  • dart:io

Package not compatible with runtime js

Because:

  • package:dartpusherclient/dartpusherclient.dart that imports:
  • package:dartpusherclient/pusher_channel.dart that imports:
  • package:dartpusherclient/pusher.dart that imports:
  • package:dartpusherclient/connection.dart that imports:
  • dart:io

Health suggestions

Fix lib/connection.dart. (-2.48 points)

Analysis of lib/connection.dart reported 5 hints:

line 29 col 7: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

line 34 col 13: Unnecessary new keyword.

line 41 col 11: Unnecessary new keyword.

line 47 col 13: Unnecessary new keyword.

line 53 col 22: This function has a return type of 'StreamSubscription

Fix lib/mixins.dart. (-0.50 points)

Analysis of lib/mixins.dart reported 1 hint:

line 17 col 8: The declaration '_broadcast' isn't referenced.

Fix lib/pusher.dart. (-0.50 points)

Analysis of lib/pusher.dart reported 1 hint:

line 119 col 34: This function has a return type of 'void Function()', but doesn't end with a return statement.

Fix additional 3 files with analysis or formatting issues. (-1 points)

Additional issues in the following files:

  • lib/pusher_channel.dart (1 hint)
  • lib/pusher_event.dart (1 hint)
  • lib/pusher_channel_private.dart (Run dartfmt to format lib/pusher_channel_private.dart.)

Maintenance suggestions

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 dartpusherclient.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

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

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

The package description is too short. (-9 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.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0