enhanced_ddp 1.0.13

Dart native js
Flutter Android iOS web

This is a DDP protocol implementation for Flutter/Dart to interact with Meteor Framework.

ENHANCED DDP #

Carefully extended DDP package to interact with the DDP. This is a DPP protocol implementation for Flutter/Dart.

Connection #

import 'package:ddp/ddp.dart';

DdpClient client = DdpClient("meteor", "ws://localhost:3000/websocket", "meteor");
client.connect();

client.addStatusListener((status) {
  if (status == ConnectStatus.connected) {
    print('I am connected!');
  }
});

Subscribe #

void myListener(String collectionName, String message, String docId, Map map) {
  // Do something great
}

client.addStatusListener((status) {
  if (status == ConnectStatus.connected) {
    client.subscribe("subscribe_name", (done) {
      Collection collection = done.owner.collectionByName("collection_name");
      collection.addUpdateListener(myListener);
    }, []);
  }
});

Call method #

List tasks = [];

client.addStatusListener((status) async {
  if (status == ConnectStatus.connected) {
    var data = await client.call('getTasks', []);
    data.reply.forEach((map) => tasks.add(map));
  }
});
1
likes
90
pub points
60%
popularity

This is a DDP protocol implementation for Flutter/Dart to interact with Meteor Framework.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

wendellrochaa@gmail.com

License

MIT (LICENSE)

Dependencies

tuple, web_socket_channel

More

Packages that depend on enhanced_ddp