enhanced_ddp 1.2.4 copy "enhanced_ddp: ^1.2.4" to clipboard
enhanced_ddp: ^1.2.4 copied to clipboard

discontinued

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));
  }
});
5
likes
40
pub points
0%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

tuple, web_socket_channel

More

Packages that depend on enhanced_ddp