setMethodCallHandler method

void setMethodCallHandler(
  1. String method,
  2. Function? function
)

Sets a callback for receiving method calls on this interface.

The given callback will replace the currently registered callback for this interface, if any. To remove the handler, pass null as the handler argument.

Implementation

void setMethodCallHandler(String method, Function? function) {
  _runtime.setMethodCallHandler(name, method, function);
}