register method

void register(
  1. String service,
  2. FutureOr<Object?> handler(
    1. String method,
    2. Map<String, dynamic> params
    )
)

Registers a service provider.

service is a name string (e.g. 'location', 'prefs'). handler receives the method name and parameters, and returns the result.

Implementation

void register(
  String service,
  FutureOr<Object?> Function(
    String method,
    Map<String, dynamic> params,
  ) handler,
) {
  _services[service] = handler;
}