signalr_core 1.0.8
signalr_core: ^1.0.8 copied to clipboard

Dart native js
Flutter Android iOS web

ASP.NET Core SignalR Client written for Dart that is platform-independent, and can be used on both the command-line and the browser.

example/main.dart

import 'dart:io';

import 'package:http/io_client.dart';
import 'package:signalr_core/signalr_core.dart';

Future<void> main(List<String> arguments) async {
 final connection = HubConnectionBuilder().withUrl('http://localhost:5000/chatHub', 
    HttpConnectionOptions(
      accessTokenFactory: () => Future.value('test'),
      client: IOClient(HttpClient()..badCertificateCallback = (x, y, z) => true),
        logging: (level, message) => print(message),
    )).build();
 
await connection.start();

connection.on('ReceiveMessage', (message) {
    print(message.toString());
});

await connection.invoke('SendMessage', args: ['Bob', 'Says hi!']);
}
48
likes
100
pub points
90%
popularity

Publisher

jamiewest.dev

ASP.NET Core SignalR Client written for Dart that is platform-independent, and can be used on both the command-line and the browser.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

equatable, http, logging, meta, sse_client, tuple, web_socket_channel

More

Packages that depend on signalr_core