init method

  1. @override
void init()
override

Called once, after the element is mounted and before its first buildChild.

If it throws, the failure is terminal: the hook is not attempted again, the scope shows an error instead of its subtree, and every later build reports the same failure. Subscribing to another scope from here is not supported and is caught by an assertion; looking one up with listen: false is, since the element is already connected to its ancestors.

Everything the scope owns is acquired here and released in dispose.

Implementation

@override
void init() {
  model.addListener(notifyDependents);
  _didListen = true;
  super.init();
}