setInvocationHandler method

  1. @override
void setInvocationHandler(
  1. IntentInvocationHandler handler, {
  2. bool background = false,
})
override

Installs the callback the native side routes invocations to.

background selects the isolate this binds to. The headless engine has its own binary messenger, so it needs its own channel — a channel created in one isolate is invisible to the other.

Implementation

@override
void setInvocationHandler(
  IntentInvocationHandler handler, {
  bool background = false,
}) {
  if (background) {
    _backgroundInvocations = handler;
  } else {
    _invocations = handler;
  }
}