sse_request
library
Classes
SseParsedSourceController <T >
Implementation of SseSourceControllerBase where the onErrorEvent
and eventParser action can be specified in parameter,
allowing configuration of reconnection logic and parsing of
each event into a specified object type.
SseRequest
An HTTP request where the entire request body is known in advance.
SseSourceController
Implementation of SseSourceControllerBase where the onErrorEvent
action can be specified in parameter, allowing configuration of
reconnection logic.
SseSourceControllerBase <T >
Base class for SSE source controllers. Manages connection lifecycle
and event handling. Sets up the event stream controller with
custom onListen and onCancel.
StreamSourceController <T >
Isolation wrapper for StreamController with dispose
Functions
sseRequestGetSendStreamed ({required Uri uri , Client? client , Encoding ? encoding })
→ Future <Stream <Map <String , dynamic > > >
Sends the GET request with the specified URI, headers, and encoding.
Transforms ByteStream to Map<String, dynamic> for every event.
sseRequestGetStream ({required Uri uri , required String subName , Encoding ? encoding })
→ Stream <Map <String , dynamic > >
Creates an SSE GET request with the specified URI, headers and encoding.
sseRequestPostSendStreamed ({required Uri uri , Client? client , Map <String , dynamic > ? body , Encoding ? encoding })
→ Future <Stream <Map <String , dynamic > > >
Sends the GET request with the specified URI, headers, body,
and encoding. Transforms ByteStream to
Map<String, dynamic> for every event.
sseRequestPostStream ({required Uri uri , required String subName , Map <String , dynamic > ? body , Encoding ? encoding })
→ Stream <Map <String , dynamic > >
Sends the POST request with the specified URI, headers, body,
and encoding.