centrifuge
Flutter 및 VM에서 WebSocket을 통해 Centrifuge와 Centrifugo와 통신하기 위한 Dart 클라이언트
WebSocket을 통해 Centrifugo 및 Centrifuge 기반 서버와 양방향 통신을 위한 Dart (Flutter) 클라이언트 SDK
^1.0.0^1.3.0>=5.0.0 <7.0.0>=3.0.0 <4.0.0^2.0.3^1.1.0^5.0.7^1.17.4아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Websocket client for Centrifugo server and Centrifuge library.
Since there is no v1 release yet, patch version updates only contain backwards compatible changes, minor version updates can have backwards incompatible API changes.
Check out client SDK API specification to learn how this SDK behaves. It's recommended to read that before starting to work with this SDK as the spec covers common SDK behavior - describes client and subscription state transitions, main options and methods. Also check out examples folder.
The features implemented by this SDK can be found in SDK feature matrix.
Note that custom WebSocket connection Upgrade headers are sent natively on platforms that support dart:io and in web context headers are sent using Centrifugo v6 Headers Emulation feature.
The latest
centrifuge-dartis compatible with Centrifugo server v6, v5 and v4 and Centrifuge >= 0.25.0. For Centrifugo v2, Centrifugo v3 and Centrifuge < 0.25.0 you should usecentrifuge-dartv0.8.0.
example\flutter_app simple chat applicationexample\chat_app one more chat exampleexample\console simple console applicationWhen a mobile application goes to the background there are OS-specific limitations for established persistent connections - which can be silently closed shortly. Thus in most cases you need to disconnect from a server when app moves to the background and connect again when app goes to the foreground.
See also PlugFox/spinify for an alternative Dart (Flutter) real-time client SDK implementation.
Start test Centrifugo server:
docker compose up
Then run tests:
dart run test --reporter expanded
protoc compilerprotoc_plugin https://pub.dev/packages/protoc_plugin (dart pub global activate protoc_plugin)lib/src/proto and run protoc --dart_out=. -I . client.protodartfmt -w lib/ test/ (install dartfmt with dart pub global activate dart_style)pubspec.yaml, push, create new tagdart pub publishGerman Saprykin, saprykin.h@gmail.com