signalr_core 1.0.2 copy "signalr_core: ^1.0.2" to clipboard
signalr_core: ^1.0.2 copied to clipboard

outdated

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 'package:signalr_core/signalr_core.dart';

main() async {
  final connection = HubConnectionBuilder()
      .withUrl(
          'http://localhost:5000/chatHub',
          HttpConnectionOptions(
            transport: HttpTransportType.webSockets,
            logging: (level, message) => print(message),
          ))
      .withAutomaticReconnect()
      .build();

  await connection.start();

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

  connection.onreconnecting((e) {
    print('Reconnecting yo');
  });

  await connection.invoke('SendMessage', args: ['Bob', 'Says hi!']);
}
165
likes
0
points
10.4k
downloads

Publisher

verified publisherjamiewest.dev

Weekly Downloads

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

License

unknown (license)

Dependencies

http, logging, sse_client, tuple, web_socket_channel

More

Packages that depend on signalr_core