startFuture static method Null safety

Future<void> startFuture(
  1. {Duration? timeLimit}
)

Returns a future that completes when the SDK has completed starting.

While it is safe to use the SDK as soon as the completion returned by the call to [LDClient.start(config, context) completes, it does not indicate the SDK has received the most recent flag values for the configured context. The Future returned by this method completes when the SDK has received flag values for the initial context, or if the SDK determines that it cannot currently retrieve flag values at all (such as when the device is offline).

The optional timeLimit parameter can be used to set a limit to the time the returned Future may be incomplete regardless of whether the SDK has not yet retrieved flags for the configured context.

Implementation

static Future<void> startFuture({Duration? timeLimit}) =>
  (timeLimit != null) ? _startCompleter.future.timeout(timeLimit, onTimeout: () => null) : _startCompleter.future;