onInitState method

  1. @protected
  2. @mustCallSuper
void onInitState(
  1. ControlState<ControlWidget> state
)

Called during State initialization. Widget will subscribe to all controls. Typically now need to override - check onInit and onUpdate functions.

Implementation

@protected
@mustCallSuper
void onInitState(ControlState state) {
  assert(isInitialized);

  if (controls.isEmpty) {
    printDebug('no controls found - onInitState');
    return;
  }

  controls.remove(null);
  controls.forEach((control) {
    control!.init(holder.args);
    control.register(this);

    if (control is ObservableComponent) {
      registerStateNotifier(control);
    }
  });
}