phoenix_wings 0.1.3

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

Codeship Status for mfeckie/phoenix_wings

Pub

phoenix_wings.dart

A Phoenix Channel implementation for Dart

Attempts to feature match the Javascript implementation found at phoenix.js

Usage

API Documentation

Much of the library is the same whether your code is running in the VM/Flutter or in a browser. Due to differences between the two platforms, the connection setup differs slightly.

Import & Connection (VM/Flutter)

import 'package:phoenix_wings/phoenix_wings.dart';


final socket = new PhoenixSocket("ws://localhost:4000/websocket/socket");

// equivalent to passing connectionProvider: PhoenixIoConnection.provider

Import & Connection (HTML)

import 'package:phoenix_wings/html.dart';


final socket = new PhoenixSocket("ws://localhost:4000/websocket/socket", connectionProvider: PhoenixHtmlConnection.provider);

Common Usage

await socket.connect();

final chatChannel = socket.channel("room:chat", {"id": "myId"});

chatChannel.on("user_entered", PhoenixMessageCallback (Map payload, String _ref, String, _joinRef) {
    print(payload);
});

chatChannel.join();

Testing

Most of the tests are run on the VM. However, the PhoenixHtmlConnection tests must run in a browser. You can use the following commands to run all tests for both platforms:

    # using firefox
    pub run test test/ -p vm,firefox

    # using chrome
    pub run test test/ -p vm,chrome

[0.0.1] - TODO: Add release date.

  • TODO: Describe initial release.

example/README.md

example

A super simple chat interface

Getting Started

Run alongside the Phoenix server provided here too.

Use this package as a library

1. Depend on it

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


dependencies:
  phoenix_wings: ^0.1.3

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:phoenix_wings/phoenix_wings.dart';
  
Version Uploaded Documentation Archive
0.1.3 Nov 20, 2018 Go to the documentation of phoenix_wings 0.1.3 Download phoenix_wings 0.1.3 archive
0.1.2 May 20, 2018 Go to the documentation of phoenix_wings 0.1.2 Download phoenix_wings 0.1.2 archive
0.0.3 Jan 1, 2018 Go to the documentation of phoenix_wings 0.0.3 Download phoenix_wings 0.0.3 archive
0.0.2 Dec 30, 2017 Go to the documentation of phoenix_wings 0.0.2 Download phoenix_wings 0.0.2 archive
0.0.1 Dec 29, 2017 Go to the documentation of phoenix_wings 0.0.1 Download phoenix_wings 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
65
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
60
Overall:
Weighted score of the above. [more]
74
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms:

References Flutter, but has conflicting libraries: package:phoenix_wings/html.dart (components: html, io).

Health suggestions

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

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

line 18 col 58: 'OPEN' is deprecated and shouldn't be used.

line 19 col 56: 'CLOSED' is deprecated and shouldn't be used.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

References Flutter, but has conflicting libraries: package:phoenix_wings/html.dart (components: html, io).

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.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.2.3 <3.0.0
Dev dependencies
dartdoc 0.24.1
flutter
intl ^0.15.6
mockito ^3.0.0
stream_channel ^1.6.4
test 1.3.4