freedome_client 1.0.0
freedome_client: ^1.0.0 copied to clipboard
Freedome client SDK: transports, discovery, auth, repositories and codecs (pure Dart).
example/example.dart
// Connects to a dome, starts a show, follows the player for five seconds. NativeMindNONC.
import 'dart:io';
import 'package:freedome_client/freedome_client.dart';
Future<void> main() async {
final client = FreedomeClient(
endpoint: FreedomeEndpoint.parse('http://dome.local:8080'),
credentials: const PasswordCredentials('operator', 'secret'),
);
await client.open();
final sub = client.playback.states.listen((s) => stdout.writeln(s));
await client.playback.play(const PlayTarget.show('night-sky'));
await Future<void>.delayed(const Duration(seconds: 5));
await client.playback.stop();
await sub.cancel();
await client.close();
}