ServerAwarenessPlugin constructor
ServerAwarenessPlugin({
- MessageCodec<
Message> ? codec,
Server awareness plugin.
This plugin is used to manage the awareness of the clients connected to the same document.
codec is the codec to use to encode and decode the messages.
default to JsonMessageCodec
Implementation
ServerAwarenessPlugin({
MessageCodec<Message>? codec,
}) : _documentAwareness = {},
messageCodec = codec ??
JsonMessageCodec(
toJson: (message) => message.toJson(),
fromJson: AwarenessMessage.fromJson,
),
_awarenessController =
StreamController<ServerAwarenessEvent>.broadcast();