current property

RuntimeContext get current

The current RuntimeContext available to the executing application.

Resolution order:

  1. Whatever was installed via install (typically the build_runner-generated bootstrap()).
  2. Whatever was registered via registerDefaultContextFactory.
  3. The mirror-based MirrorContext if dart:mirrors is available (JIT execution); otherwise a StateError (AOT execution).

Implementation

static RuntimeContext get current =>
    _installed ??= _resolveDefaultContext();