migratorydata_client_dart_v6 1.0.6 copy "migratorydata_client_dart_v6: ^1.0.6" to clipboard
migratorydata_client_dart_v6: ^1.0.6 copied to clipboard

This MigratoryData client library is written in Dart. One important use of this library is that it allows you to use the Flutter framework for building realtime applications natively compiled for mobi [...]

example/main.dart

import 'dart:async';
import 'dart:convert';
import 'dart:typed_data';
import 'dart:math';

import 'package:migratorydata_client_dart_v6/client.dart';

void main() {
  var client = MigratoryDataClient();
  client.setEntitlementToken("some-token");
  client.setListener(ListenerImpl());
  // client.setEncryption(true);
  client.setServers(["localhost:8800"]);
  client.subscribe(["/vehicles/1/speed"]);
  client.connect();

  Timer.periodic(Duration(seconds: 5), (Timer t) {
    client.publish(MigratoryDataMessage(
        "/vehicles/1/speed",
        Uint8List.fromList(utf8.encode(Random().nextInt(200).toString()))));
  });
}

class ListenerImpl implements MigratoryDataListener {
  @override
  onMessage(MigratoryDataMessage message) {
    print(message);
  }

  @override
  onStatus(String type, String info) {
    print("$type - $info");
  }
}
1
likes
120
pub points
40%
popularity

Publisher

verified publishermigratorydata.com

This MigratoryData client library is written in Dart. One important use of this library is that it allows you to use the Flutter framework for building realtime applications natively compiled for mobile (Android and iOS), web, and desktop from a single codebase.

Homepage

Documentation

API reference

License

unknown (license)

More

Packages that depend on migratorydata_client_dart_v6