onStart method

  1. @mustCallSuper
  2. @nonVirtual
void onStart()
inherited

Called at the exact moment the widget is allocated in memory. It uses an internal "callable" type, to avoid any @overrides in subclasses. This method should be internal and is required to define the lifetime cycle of the subclass.

Implementation

// @protected
@mustCallSuper
@nonVirtual
void onStart() {
  // Prevent double initialization
  if (_initialized) {
    assert(false, 'onStart() called on an already initialized instance');
    return;
  }
  onInit();
  _initialized = true;
}