NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #1469 most downloaded on pub.dev
Dart client to communicate with Centrifuge and Centrifugo from Flutter and VM over WebSockets
Last release 1 months ago
27 Aug 2026
Ships fairly regularly
a new release about every 3 months
Nearly every release is documented
notes for 32 of 32 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
32 releases · first in 2018
Fix WebSocket transport selection on dart2wasm builds by @VangThao1905 in #115
Full Changelog: v0.20.0...v0.20.1
Transport resolving to the dart:io (IOWebSocketChannel) implementation instead of the browser one (HtmlWebSocketChannel) when compiled with dart2wasm. The conditional import in transport.dart used to check dart.library.html, which is not declared under the wasm compile target — Flutter Web's wasm target has no dart:html and relies on dart:js_interop instead — so the WebSocket transport silently fell back to the VM implementation and never connected in the browser. Switched the check to dart.library.js_interop, which is declared for both dart2js and dart2wasm web builds while remaining unavailable on native (VM) targets, so native platforms keep using dart:io as before.One column per quarter.
Support getState callback by @FZambia in #110
SubscriptionConfig.getState callback support (requires Centrifugo >= 6.8.0), mirroring the same option in centrifuge-js. The callback lets the application load its state from its own source of truth and return the corresponding stream position — the SDK then subscribes with recovery from that position, so no publications are lost between the state read and the subscribe. The callback is invoked on initial subscribe (when there is no saved position) and again when the server reports an unrecoverable position (error 112 — the SDK requests this behavior via the reject_unrecovered subscribe flag). It is NOT called on reconnects where server-side recovery succeeds. Errors thrown from the callback emit a subscription error event with the new SubscriptionGetStateError type and are retried with backoff.channel_compaction flag, and when the server supports and allows it (Centrifugo PRO allow_channel_compaction namespace option) publication/join/leave pushes carry a short numeric channel ID instead of the string channel name — the SDK routes such pushes via an internal ID registry. Servers without compaction support simply ignore the flag, so behavior is unchanged there.Filter helpers and pass it via SubscriptionConfig.tagsFilter, or change it at runtime with Subscription.setTagsFilter(). A tags filter cannot be combined with delta compression. #112wasRecovering=true, recovered=false — letting the app reload via its existing recovery-failure path rather than looking like a brand-new first subscribe. A non-recoverable subscription simply resubscribes. #113Fix connection and subscription stability bugs by @FZambia in #109
Full Changelog: v0.19.0...v0.19.1
Client.send() to use SendRequest instead of the deprecated Message type so async messages reach the server again.subscribing (codes 2500/3007 and other temporary codes) now trigger an immediate resubscribe instead of waiting for a reconnect that may never come.unsubscribe() or disconnect() arrives while getToken is awaiting.Client.close() and Subscription.close() no longer emit error/unsubscribed events after the resource is closed; pending ready() futures on a closed subscription are completed with SubscriptionUnsubscribedError and any timers are cancelled.ClientDisconnectedError thrown by an in-flight ConnectRequest no longer cancels the reconnect timer that the transport's onDone already scheduled (previously left the client stuck in connecting).onError callback instead of crashing the socket listener.getData callback are caught: an error event is emitted and the transport is closed (instead of an unhandled async exception)._refreshToken no longer issues a RefreshRequest if the client is not connected anymore by the time the token callback resolves.getToken is no longer invoked when the user did not configure one (previous check could call a null callback in edge cases).backoffDelay returns minDelay when the computed range collapses to zero, avoiding RangeError from Random.nextInt(0).Add Client.close() — disconnects and releases all client resources (closes every event stream and removes every subscription). The client is unusable
Client.close() — disconnects and releases all client resources (closes every event stream and removes every subscription). The client is unusable after close(); subsequent public method calls throw ClientClosedError. Use Client.disconnect() for a temporary disconnect that keeps the client usable. #106await client.disconnect() now actually waits for transport teardown before resolving.3014 (connection state invalidated) and unsubscribe code 2502 (subscription state invalidated) now correctly clear the relevant token and recovery state, forcing a fresh getToken on reconnect.1009 (message size limit) is now terminal (no auto-reconnect), matching the behavior in centrifuge-js.SubscribeRequest is in flight now sends a cleanup Unsubscribe to the server, preventing a "ghost" server-side subscription that keeps pushing publications to the local sub.unsubscribe()/disconnect during a subscribe round-trip can no longer flip the subscription state back to Subscribed.ClientDisconnectedError thrown type.ClientConfig.tlsSkipVerify through to the WebSocket transport on VM/Flutter (dart:io) platforms — was a silent no-op before. Useful for wss:// development against a self-signed cert. Web platforms ignore the flag, since the browser owns TLS validation. #107getToken retries, and several race-condition tests, all running against the docker-compose Centrifugo.Full Changelog: v0.18.0...v0.19.0
Allow protobuf v6, drop Protobuf v3/v4, min SDK 3.7 by @FZambia in #104
Full Changelog: v0.17.0...v0.18.0
Allow Protobuf v5 dependency by @FZambia in #102
Allow usage of protobuf v4, drop protobuf v2 by @FZambia in #100
Full Changelog: v0.15.1...v0.16.0
Support Fossil delta compression by @FZambia in #97
Full Changelog: v0.15.0...v0.15.1
This release changes headers in ClientConfig from Map<String, dynamic> to Map<String, String> . This is a breaking change , but it must not cause huge…
web_socket_channel, min Dart SDK is now 3.3 #91setHeaders method to update headers #92.This release changes headers in ClientConfig from Map<String, dynamic> to Map<String, String>. This is a breaking change, but it must not cause huge troubles beyond a simple refactoring.
Usages of dart.html were removed in this release. Also some internal optimizations were done to allocate less when constructing Protobuf command data.
Full Changelog: v0.14.1...v0.15.0
web_socket_channel, min SDK is now 3.3 #91setHeaders method to update headers #92.This release changes headers in ClientConfig from Map<String, dynamic> to Map<String, String>. This is a breaking change, but it must not cause huge troubles beyond a simple refactoring.
Usages of dart.html were removed in this release. Also some internal optimizations were done to allocate less when constructing Protobuf command data.
Add renew connection data callback by @Holofox in #88
Full Changelog: v0.14.0...v0.14.1
connInfo and chanInfo for join/leave events by @hetao29 #84
Relax Protobuf dependency requirements to be >=2.0.0 <4.0.0 instead of ^3.0.0
>=2.0.0 <4.0.0 instead of ^3.0.0Fix websocket usage in web env (fixes The method 'sendByteBuffer' isn't defined for the type 'WebSocket' error), add simple web example #85
The method 'sendByteBuffer' isn't defined for the type 'WebSocket' error), add simple web example #85Update protobuf dependency from ^2.0.0 to ^3.0.0. Requires Dart 2.19
^2.0.0 to ^3.0.0. Requires Dart 2.19Breaking change! This release changes the semantics of working with connection tokens described in Centrifugo v5 release post.
Breaking change! This release changes the semantics of working with connection tokens described in Centrifugo v5 release post.
Previously, returning an empty token string from getToken callback resulted in client disconnection with unauthorized reason.
Now returning an empty string from getToken is a valid scenario which won't result into disconnect on the client side. It's still possible to disconnect client by throwing a special UnauthorizedException from getToken function.
And we are putting back setToken method to the SDK – so it's now possible to reset the token to be empty upon user logout.
Improving reconnect behaviour upon bad network conditions (like connect timeout), #79
Add support for web platform – #73
Fix null check for close reason, fixes #66
Fix setting initial connection token
UnsubscribedEventThis release adopts a new iteration of Centrifugal protocol and a new iteration of API. Client now behaves according to the client SDK API specificati
Breaking changes
This release adopts a new iteration of Centrifugal protocol and a new iteration of API. Client now behaves according to the client SDK API specification. The work has been done according to Centrifugo v4 roadmap.
Check out Centrifugo v4 release post that covers the reasoning behind changes.
All the current core features of Centrifugal client protocol are now supported here.
New release only works with Centrifugo >= v4.0.0 and Centrifuge >= 0.25.0. See Centrifugo v4 migration guide for details about the changes in the ecosystem.
Note, that Centrifugo v4 supports clients working over the previous protocol iteration, so you can update Centrifugo to v4 without any changes on the client side (but you need to turn on use_client_protocol_v1_by_default option in the configuration of Centrifugo, see Centrifugo v4 migration guide for details).
It pushes client closer to other clients in the ecosystem. It also contains several backwards incompatible changes.
Version 0.8.0 is the next iteration of centrifuge-dart development. It pushes client closer to other clients in the ecosystem. It also contains several backwards incompatible changes.
Client.connect, Client.disconnect, Subscription.subscribe, Subscription.unsubscribe methods - addresses #31.DisconnectEvent on connection error - this makes behavior of centrifuge-dart similar to all other our clients - addresses #56.ErrorEvent - each transport failure will emit error to this stream - addresses #56.subscribing and error statuses. This change is mostly internal should not affect working with Subscriptions.UnsubscribeEvent if subscription is not successfully subscribed (i.e. in subscribed state). This makes behavior of centrifuge-dart similar to all other our clients.Client.Disconnect method - make it more similar to all other connector libraries in ecosystem.TimeoutException. Also - properly pass timeout to the transport (was not before!). Again – this makes client behave similarly to all other connectors.presence and presenceStats methods for Subscription and on client top level (for server-side subscriptions).streamPosition in SubscribeSuccessEvent.streamPosition in ServerSubscribeEvent.data in ServerSubscribeEvent.send method to send async messages to a server.Add support for data in SubscribeSuccessEvent. This is a custom data which can be sent by a server towards client connection in subscribe result. Note
data in SubscribeSuccessEvent. This is a custom data which can be sent by a server towards client connection in subscribe result. Note that due to the bug in Centrifugo server this feature only works in Centrifugo >= v3.0.3.Breaking change in server behavior. Client History API behavior changed in Centrifuge >= v0.18.0 and Centrifugo >= v3.0.0. When using history call it…
Update to work with Centrifuge >= v0.18.0 and Centrifugo v3.
Breaking change in server behavior. Client History API behavior changed in Centrifuge >= v0.18.0 and Centrifugo >= v3.0.0. When using history call it won't return all publications in a stream by default. See Centrifuge v0.18.0 release notes or Centrifugo v3 migration guide for more information and workaround on server-side.
limit, since and reverse arguments and returns HistoryResultPublishResult?format=protobuf in connection URL. Client will negotiate Protobuf protocol with a server using WebSocket subprotocol mechanism (in request headers).library dependencies updated to null safe versions
Skip handling for events from server-side subscriptions resulted in null pointer dereference
Update protobuf dependency to ^1.0.1, thanks @Holofox
^1.0.1, thanks @HolofoxImplement removeSubscription method, thanks @tiamo
removeSubscription method, thanks @tiamoBreaking changes connected property removed
connected property removedBreaking changes Changed API to avoid returning futures where they do not make sense – in connect and subscribe methods.
connect and subscribe methods.onPrivateSub configuration callback functionClientDisconnectedError when there is an attempt to send protocol request over non-connected client.Breaking changes Replaced subscribe method with getSubscription in Client.
Added subscription to private channel with JWT
* Initial release
Your coding agent can read these notes before it upgrades. Set up the MCP server →