flutter_mercure_client 0.0.1 copy "flutter_mercure_client: ^0.0.1" to clipboard
flutter_mercure_client: ^0.0.1 copied to clipboard

A Flutter plugin to receive events from a Mercure hub

flutter_mercure_client #

A Flutter plugin to connect to a Mercure hub and receive real-time updates.

Features #

  • Start and stop a Mercure client connection.
  • Subscribe to one or more topics.
  • Receive messages as a Dart stream.

Usage #

import 'package:flutter_mercure_client/flutter_mercure_client.dart';

// Start the client with topics
await FlutterMercureClient.start(
  'https://demo.mercure.rocks/.well-known/mercure',
  topics: ['https://example.com/books/', 'https://example.com/users/1'],
  jwt: null, // Optional JWT if needed
);

// Listen to messages
FlutterMercureClient.messages.listen((message) {
  print('Received: $message');
});

// Stop the client
await FlutterMercureClient.stop();
0
likes
150
points
13
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin to receive events from a Mercure hub

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_mercure_client

Packages that implement flutter_mercure_client