performAction method

void performAction(
  1. String action, {
  2. Map<String, dynamic>? params,
})

If you need to perfome an action in your channel just call this method passing the name of your action that you need to call on server

channel.performAction(
  action: 'send_message',
  actionParams: { 'message': 'Hello private peeps! 😜' }
);

Implementation

void performAction(
  String action, {
  Map<String, dynamic>? params,
}) {
  params ??= {};
  params['action'] = action;

  final command = {
    'identifier': identifier,
    'command': 'message',
    'data': jsonEncode(params)
  };

  _sendMessageCallback(command);
}