registerServiceExtension method

  1. @protected
void registerServiceExtension ({@required String name, @required ServiceExtensionCallback callback })

Registers a service extension method with the given name (full name "").

The given callback is called when the extension method is called. The callback must return a value that can be converted to JSON using json.encode() (see JsonEncoder). The return value is stored as a property named result in the JSON. In case of failure, the failure is reported to the remote caller and is dumped to the logs.


void registerServiceExtension({
  @required String name,
  @required ServiceExtensionCallback callback,
}) {
    name: 'inspector.$name',
    callback: callback,