Skip to content
pubscout

flutter_http_sse

1.0.5, released 11 months ago by an unverified publisher

Flutter client library for receiving Server-Sent Events (SSE) over HTTP.

WASM-ready
$ flutter pub add flutter_http_sse
Source repository

What it does

Allows establishing Server-Sent Events connections using the HTTP package to receive real-time updates from servers. It supports custom request parameters, automatic reconnections with exponential backoff, and dynamic data deserialization.

AI-written summary of version 1.0.5, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to stream real-time updates from a backend server via Server-Sent Events.
  • You want automatic retry logic and connection failure handling for SSE streams.

Skip it when

  • You need bi-directional real-time communication via WebSockets instead of unidirectional SSE.

Strengths

  • Supports automatic reconnection with exponential backoff on connection failures
  • Allows custom headers and dynamic deserialization of received data
  • Handles both GET and POST requests for SSE streams

Weaknesses

  • Limited to unidirectional server-sent event streams
  • Relies solely on the HTTP package for underlying network requests

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
import 'package:flutter_http_sse/model/sse_request.dart';
import 'package:flutter_http_sse/service/sse_client.dart';

final request = SSERequest(
  requestType: RequestMethodType.GET,
  url: "https://your-sse-endpoint.com/stream",
  onData: (data) => print("Received: $data"),
  retry: true,
);

final sseClient = SSEClient();
final Stream<SSEResponse> stream = sseClient.connect("connectionId", request);

Alternatives

Packages that do the same job and could replace flutter_http_sse.

  • web_socket_channel

    Choose this if you require full bi-directional communication via WebSockets instead of unidirectional server-sent events.