bitchannel 1.0.3 copy "bitchannel: ^1.0.3" to clipboard
bitchannel: ^1.0.3 copied to clipboard

A mix between an event-oriented package and a communication infrastructure package based on channels and bits of information.

bitchannel #

A mix between an event-oriented package and a communication infrastructure package based on channels and bits of information.

Installation #

Run the following command:

flutter pub add bitchannel

Usage #

Import the package in your Dart code:

import 'package:bitchannel/bitchannel.dart';

Creating a Bit #

A Bit is a piece of information sent over a channel. You can create your own Bit by extending the Bit class:

final class TestBit extends Bit {
  @override
  String get bitChannel => "test";

  @override
  Map<String, dynamic> get data => {
        "something": "in the way",
      };
}

Joining a Channel #

You can join a channel using the BitChannel class:

void main() {
  BitChannel.join("test_channel", from: MyBitReceiver());
}

Log Level #

You can change the log level:

void main() {
  Bit.logLevel = LogLevel.trace;
}

Global Data #

Set global data to be included with all bits:

void main() {
  Bit.globals = {
    "hello": "world",
  };
}

Additional Information #

For more details, check out the example/main.dart for an illustration of the feature set.

About this package #

This package is the result of many iterations and ideas inspired by a great article from Martin Nowosad.

0
likes
150
points
15
downloads

Publisher

verified publisherwattshout.com

Weekly Downloads

A mix between an event-oriented package and a communication infrastructure package based on channels and bits of information.

Homepage
Repository (GitHub)
View/report issues

Topics

#event #communication #infrastructure

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on bitchannel