ready method

Future<void> ready()

Runs the readiness phase for all registered plugins (spec 025).

Calls each plugin's ZuraffaPlugin.onReady in registration order, after bootstrap has completed. Calling ready before bootstrap or more than once throws StateError.

Implementation

Future<void> ready() async {
  if (!_bootstrapped) {
    throw StateError('ready() requires bootstrap() to complete first.');
  }
  if (_readyCompleted) {
    throw StateError('ready() has already been called.');
  }

  _readyCompleted = true;

  for (final plugin in _plugins.values) {
    await plugin.onReady(di);
  }
}