shelf_eventsource 0.1.0+1

  • Installing
  • Versions
  • 44


A shelf extension for EventSource or Server-Sent Events (SSE) that works together with the eventsource package.

How to use it?

The usage is really easy:

import "package:shelf/shelf_io.dart" as io;
import "package:eventsource/publisher.dart";
import "package:shelf_eventsource/shelf_eventsource.dart";

EventSourcePublisher publisher = new EventSourcePublisher(cacheCapacity: 100);
var handler = eventSourceHandler(publisher);
io.serve(handler, "localhost", 8080);

For a more extensive example with routing, see the example/ directory.


This project is available under the MIT license, as can be found in the LICENSE file.



  • Initial version

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  shelf_eventsource: "^0.1.0+1"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

      import 'package:shelf_eventsource/shelf_eventsource.dart';
Version Uploaded Documentation Archive
0.1.0+1 Nov 28, 2016 Go to the documentation of shelf_eventsource 0.1.0+1 Download shelf_eventsource 0.1.0+1 archive
0.1.0 Nov 27, 2016 Go to the documentation of shelf_eventsource 0.1.0 Download shelf_eventsource 0.1.0 archive


We analyzed this package on Jun 12, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
12 / 100
Code health derived from static analysis. [more]
96 / 100
Reflects how tidy and up-to-date the package is. [more]
46 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:shelf_eventsource/shelf_eventsource.dart.


  • Fix .analysis_options.

    We were unable to parse .analysis_options.

  • Package is getting outdated.

    The package was released 80 weeks ago.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 2 hints.

    Strong-mode analysis of lib/shelf_eventsource.dart gave the following hint:

    line: 36 col: 49
    The generic type comment is being deprecated in favor of the real syntax.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

  • Enable strong mode analysis.

    Strong mode helps you to detect bugs and potential issues earlier.Start your analysis_options.yaml file with the following:

      strong-mode: true


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0
eventsource >=0.1.0 <0.2.0 0.1.0+2
shelf >=0.6.5 <0.7.0 0.6.8 0.7.3+1
stream_channel >=1.5.0 <2.0.0 1.6.7
Transitive dependencies
async 1.13.3 2.0.7
charcode 1.1.1
collection 1.14.10
http 0.11.3+16
http_parser 3.1.2
logging 0.11.3+1
path 1.6.0
source_span 1.4.0
stack_trace 1.9.2
string_scanner 1.0.2
sync 0.1.0+1
typed_data 1.1.5
Dev dependencies
shelf_route >=0.13.0 <0.15.0
test >=0.12.0 <0.13.0