Skip to content

Zhalkhas/sse_stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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');
    },
);

This example shows how to parse data from Dio response, example folder contains sample for http package

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages