onReady method

  1. @mustCallSuper
void onReady()

Lifecycle method called after the widget tree is fully built.

Override this to perform tasks that require the widget tree to be ready, such as showing dialogs, accessing inherited widgets, or starting animations. This is called asynchronously after the first frame is rendered.

Always call super.onReady() when overriding.

Example:

@override
void onReady() {
  super.onReady();
  // Fetch initial data
  loadUserData();
  // Start periodic tasks
  Timer.periodic(Duration(seconds: 30), (_) => refreshData());
}

Implementation

@mustCallSuper
void onReady() {
  Logger.info('onReady of $runtimeType called', tag: 'ReactiveController');
}