0 purchases
sse stream
Dart SSE Stream #
Just simple package which parses SSE from text stream I wrote for myself
Usage #
Basically, package gives SseEventTransformer, which accepts Stream
final Response<ResponseBody> resp = await dio.post(
path,
data: data,
options: Options(responseType: ResponseType.stream),
);
resp.data?.stream
.cast<List<int>>()
.transform(Utf8Decoder())
.transform(const SseEventTransformer())
.listen((event) {
// do something here
print('new event: $event');
},
);
copied to clipboard
This example shows how to parse data from Dio response, example folder contains sample for http package
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.