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

パッケージ詳細v1.3.0

action_cable

Dart 用の ActionCable クライアントで、Web、dartVM、Flutter で利用可能。

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
1490
いいね数
22
Pub ポイント
135

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

flutter pub add action_cable

パッケージ概要

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

ActionCable は、Rails の ActionCable の Dart クライアント実装であり、Flutter および Dart アプリケーションで WebSocket を介してリアルタイムの双方向通信を可能にします。Web、DartVM、および Android、iOS、macOS、Windows、Linux などのモバイルプラットフォームをサポートしています。このパッケージは、ライブアップデート、チャットシステム、通知などの機能のために ActionCable サーバーとシームレスに統合できます。チャンネルへの購読、メッセージ受信、接続の管理を可能にするクリーンな API を提供し、組み込みの再接続ロジックも備えています。リアルタイムデータ同期が必要なアプリに最適です。

用途

  • リアルタイムチャットアプリケーション
  • ライブダッシュボードの更新
  • 通知システム
  • 共同編集ツール
  • ストリーミングデータフィード

主な機能

  • WebSocket をベースとしたリアルタイム通信
  • クロスプラットフォーム対応(ウェブ、モバイル、デスクトップ)
  • チャンネル購読管理
  • 自動再接続
  • シンプルなイベント駆動型 API

適している対象

  • リアルタイム機能を必要とするFlutterアプリ
  • Railsバックエンドを使用するDartプロジェクト
  • ライブインタラクティブUIを構築する開発者
  • 低遅延更新を必要とするアプリ
  • サーバーサイドでActionCableを使用するチーム

注意事項

  • 互換性のある ActionCable サーバーが必要です
  • ネットワークの信頼性はパフォーマンスに影響します
  • 成熟した代替品と比べてドキュメントが限られている
  • メッセージ解析の手動処理が必要です
  • 調整なしでは、高周波・低レイテンシーのシナリオには適していません

元の README

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

Pub

All Contributors

ActionCable in Dart

ActionCable is the default realtime websocket framework and protocol in Rails.

This is a dart port of the client and protocol implementation which is available in web, dartVM and flutter.

Usage

Connecting to a channel 🙌
cable = ActionCable.connect(
  "ws://10.0.2.2:3000/cable",
  headers: {
    "Authorization": "Some Token",
  },
  onConnected: (){
    print("connected");
  },
  onConnectionLost: () {
    print("connection lost");
  },
  onCannotConnect: () {
    print("cannot connect");
});
Subscribing to channel 🎉
cable.subscribe(
  "Chat", // either "Chat" and "ChatChannel" is fine
  channelParams: { "room": "private" },
  onSubscribed: (){}, // `confirm_subscription` received
  onDisconnected: (){}, // `disconnect` received
  onMessage: (Map message) {} // any other message received
);
Unsubscribing from a channel 🎃
cable.unsubscribe(
  "Chat", // either "Chat" and "ChatChannel" is fine
  {"room": "private"}
);
Perform an action on your ActionCable server 🎇

Requires that you have a method defined in your Rails Action Cable channel whose name matches the action property passed in.

cable.performAction(
  "Chat",
  action: "send_message",
  channelParams: { "room": "private" },
  actionParams: { "message": "Hello private peeps! 😜" }
);
Disconnect from the ActionCable server
cable.disconnect();

ActionCable protocol

Anycable has a great doc on that topic.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Clinton

💻 ⚠️

Hamad AlGhanim

💻

Fareesh Vijayarangam

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

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

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