registerMethod method

  1. @override
void registerMethod(
  1. String name,
  2. Function callback
)
override

Registers a method named name on this server.

callback can take either zero or one arguments. If it takes zero, any requests for that method that include parameters will be rejected. If it takes one, it will be passed a Parameters object.

callback can return either a JSON-serializable object or a Future that completes to a JSON-serializable object. Any errors in callback will be reported to the client as JSON-RPC 2.0 errors.

Implementation

@override
void registerMethod(String name, Function callback) =>
    _server.registerMethod(name, callback);