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

outdated

A WebSocket Library written in Pure Dart.

example/polo_client_example.dart

import 'package:polo_client/polo_client.dart';

void main() async {
  //Polo Client
  PoloClient client = await Polo.connect("ws://127.0.0.1:3000/");

  client.onConnect(() {
    print("Client Connected to Server");
    client.send('message', "Hi from Client");
    client.send('userJoined', {
      "name": "Ayush",
      "age": 22,
      "isMale": true,
    });
  });

  client.onDisconnect(() {
    print("Client Disconnected from Server");
  });

  client.onEvent('message', (message) {
    print("Message from Server: $message");
  });

  await client.listen();
}
3
likes
0
points
26
downloads

Publisher

unverified uploader

Weekly Downloads

A WebSocket Library written in Pure Dart.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on polo_client