This package provides support for bi-directional communication through Server Sent Events and corresponding POST requests.
- Add new
SseConnectionto allow closing connections immediately, ignoring any keep-alive periods.
SseConnectionand ensure the corresponding
- Add an
onCloseevent to the
SseConnection. This allows consumers to listen to this event in lue of
sseConnection.sink.doneas that is not guaranteed to fire.
- Fix an issue where
keepAlivemay cause state errors when attempting to send messages on a closed stream.
- Fix an issue where
keepAlivewould only allow a single reconnection.
SseConnection. This flag will be
truewhen a connection has been dropped and is in the keep-alive period waiting for a client to reconnect.
- Fix an issue where the
SseClientwould not send a
doneevent when there was an error with the SSE connection.
Note that this is a breaking change but in actuality no one should be depending on this API.
- Add optional
keepAliveparameter to the
keepAliveis supplied, the connection will remain active for this period after a disconnect and can be reconnected transparently. If there is no reconnect within that period, the connection will be closed normally.
- Add retry logic.
Possible Breaking Change Error messages may now be delayed up to 5 seconds in the client.
- Use proper headers delimiter.
- Support Firefox.
- Fix an issue where messages could come out of order.
- Support the latest
- Require Dart SDK
- Update to
- No longer expose
SseConnection. This is simply handled by the underlying
- Fix a bug where resources of the
SseConnectionwere not properly closed.
- Internal cleanup.
- Initial commit.
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: sse: ^3.5.0
2. Install it
You can install packages from the command line:
$ pub get
$ flutter pub get
Alternatively, your editor might support
pub get or
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
import 'package:sse/client/sse_client.dart'; import 'package:sse/server/sse_handler.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Jun 5, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.8.2
- pana: 0.13.8-dev
Maintain an example.
None of the files in the package's
example/ directory matches known example patterns.
Common filename patterns include
sse.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.
|Dart SDK||>=2.2.0 <3.0.0|