registerRPCMethod method

  1. @override
void registerRPCMethod({
  1. required String name,
  2. required String usage,
  3. required String description,
  4. required Future<Map<String, Object>> callback(
    1. Plugin,
    2. Map<String, Object>
    ),
})

This method is used to register a RPC method with the plugin that could be run by the user.

Implementation

@override
void registerRPCMethod(
    {required String name,
    required String usage,
    required String description,
    required Future<Map<String, Object>> Function(Plugin, Map<String, Object>)
        callback}) {
  rpcMethods[name] = RPCMethod(
      name: name, usage: usage, description: description, callback: callback);
}