onContextLoaded method

void Function() onContextLoaded(
  1. void callback(
    1. ContextUpdateType
    )
)

Registers a callback for when the client has loaded the device context. This happens at the startup of the app, but it is handy for plugins that require context data during configure as it guarantees the context data is available.

If the context is already loaded it will call the callback immediately.

@param callback Function to call when context is ready.

Implementation

void Function() onContextLoaded(void Function(ContextUpdateType) callback) =>
    _onContextLoaded.addListener((context) => context != null ? callback(context) : null);