littlefish_signalr_core 4.2.0 copy "littlefish_signalr_core: ^4.2.0" to clipboard
littlefish_signalr_core: ^4.2.0 copied to clipboard

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

Future<void> main(List<String> arguments) async {
  final connection = HubConnectionBuilder()
      .withUrl(
        'http://localhost:5115/chatHub',
        HttpConnectionOptions(
          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!']);
}
0
likes
150
points
68
downloads

Documentation

API reference

Publisher

verified publisherlittlefishapp.com

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.

Homepage
Repository (GitHub)

License

MIT (license)

Dependencies

equatable, http, logging, sse_channel, web_socket_channel

More

Packages that depend on littlefish_signalr_core