liveroom 0.0.6 copy "liveroom: ^0.0.6" to clipboard
liveroom: ^0.0.6 copied to clipboard

Super simple WebSocket Room kit

Header

https://pub.dev/packages/liveroom

LiveRoom, Super-Simple WebSocket Room kit #

1. Server #

  1. setup Deno (Official Manual)
### Mac
$ curl -fsSL https://deno.land/x/install/install.sh | sh
### Windows powershell
$ irm https://deno.land/install.ps1 | iex
  1. create TypeScript file main.ts
import { Liveroom } from "https://deno.land/x/liveroom/mod.ts";
const liveroom = new Liveroom();
liveroom.run();
  1. run
$ deno run --allow-net main.ts

2. Flutter App #

import 'package:flutter/material.dart';
import 'package:liveroom/liveroom.dart';

final liveroom = Liveroom();

void main() {
  final app = LiveroomTestApp(liveroom);
  runApp(app);
}

more functions

  • liveroom.create(roomId: '0001');
  • liveroom.join(roomId: '0001');
  • liveroom.send(message: 'Hello');
  • liveroom.receive((seatId, message) => print(message));
  • liveroom.exit();

🎉 any issues, requests, contributions are welcomed!