パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.0.2

livestream

LiveStream は、アプリケーション内の異なるモジュール間での通信を簡単にしてくれるシンプルなクラスです。

30日間ダウンロード
29
いいね数
29
Pub ポイント
40

パッケージをインストール

flutter pub add livestream

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Livestream は、Flutter アプリケーションの異なる部分間の通信を簡素化することを目的とした軽量なパッケージです。イベントのブロードキャストとリスニングを簡単に行う方法を提供し、大規模なフレームワークの複雑さなしに状態管理やモジュール間通信に最適です。このパッケージはシンプルな発行-購読パターンに基づいており、ウィジェット、サービス、またはスクリーン間で効率的なデータフローを実現します。最小限のセットアップと外部依存関係なしに、Livestream は Flutter アプリのモジュール性と応答性を向上させます。

用途

  • リアルタイムイベントブロードキャスト
  • クロスウィジェット通信
  • 状態の更新を簡素化する
  • アプリモジュールの分離
  • スクリーン間でのユーザー操作の処理
  • プラグイン相互作用の最適化

主な機能

  • シンプルな発行-購読モデル
  • 最小限のボイラープレート
  • 外部の依存関係なし
  • 軽量で高速
  • 既存コードとの簡単な統合
  • タイプ付きイベントをサポート

適している対象

  • 小規模から中規模のFlutterアプリ
  • 軽量な状態管理を求める開発者
  • 複雑な依存関係の注入を避けるチーム
  • 迅速なイベント駆動型通信を必要とするアプリ
  • 迅速なUI更新のプロトタイピング
  • スケーラビリティよりもシンプルさを重視するプロジェクト

注意事項

  • 大規模な状態管理には適していません
  • 基本的なイベント処理に限定
  • 組み込みの永続性または復旧機能なし
  • 一時的または一時的なデータに最適
  • 長期間実行されるアプリケーションでは、手動でのクリーンアップが必要になる場合があります
  • 複雑なデータ同期には適していない

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

LiveStream - Dart

Pub Github Followers GitHub stars GitHub forks GitHub watchers Twitter Follow

LiveStream is a data holder class which can observe change of data in real-time and emit values too. Here's emitter subscriber pattern. It's developed in pure Dart.

⚡️ Getting Started

Add Dependency

Add below dependency in pubspec.yaml.

dependencies:
  livestream: ^1.0.2
Initialize LiveStream Instance

You can create instance as below.

  LiveStream liveStream = new LiveStream();
Subscribe to Stream / Add Observer

LiveStream event will be dispatched when data is changed. See below code to add observer / subscriber.

    liveStream.on("chat-message", (message) {
      print("Message Received: $message");
    });

Whenever data is emitted to chat-message channel/stream above block will be executed.

Emitting Events or Broadcasting

The main idea behind LiveStream is that you can send and receive any events you want, with any data you want. Any objects that can be encoded as JSON will do, and binary data is supported too. See code below.

  void send() {
      String message = "Hi there!";
      liveStream.emit("chat-message", message);
  }

🚀 Sample Usage

Sample code is available in /example directory.

🤝 Contribute

If you want to contribute to this library, you're always welcome! See Contributing Guidelines.

✉️ Contact

If you need any help, you can connect with me.

Visit:- shreyaspatil.dev

📃 License

MIT License

Copyright (c) 2020 Shreyas Patil

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。