getCount static method

dynamic getCount(
  1. dynamic unreadCount(
    1. dynamic
    )
)

Implementation

static getCount(Function(dynamic) unreadCount) {
  var params = {
    "secretKey": AppStorages.secKey,
    "userId": AppStorages.myUserId
  };
  socket.connect();
  socket.onDisconnect((_) {
    socket.io
      ..disconnect()
      ..connect();
  });
  socket.emit('user-unread-count', params);
  socket.on('user-unread-count-res-${AppStorages.myUserId}', (data) {
    unreadCount(data);
  });
}