registerServiceCallback method Null safety

void registerServiceCallback(
  1. String service,
  2. ServiceCallback cb
)

Register a service for invocation.

Implementation

void registerServiceCallback(String service, ServiceCallback cb) {
  if (_services.containsKey(service)) {
    throw Exception('Service \'${service}\' already registered');
  }
  _services[service] = cb;
}