ServerSentEvent constructor

const ServerSentEvent({
  1. @Default('message') String event,
  2. required String data,
  3. String? lastEventId,
})

Default constructor

Implementation

const factory ServerSentEvent({
  /// The event type of this SSE. Defaults to `message`, if not set.
  @Default('message') String event,

  /// The data that was sent by the server. Can be an empty string.
  required String data,

  /// An optional ID of the last event.
  ///
  /// Can be used to resume a stream if supported by the server. See
  /// [EventSourceClientX.stream].
  String? lastEventId,
}) = _ServerSentEvent;