listen method

void listen(
  1. String channel,
  2. void fn(
    1. Map<String, String> data,
    2. void sender(
      1. String,
      2. String
      )
    )
)

It can be used to listen for the coming the data from server on the specific channels.

Implementation

void listen(
    String channel,
    void Function(
            Map<String, String> data, void Function(String, String) sender)
        fn) {
  Map<String, dynamic> _dictData = {"channel": channel, "function": fn};
  _listenerFuncs.add(_dictData);
}