waitForInit method

Future<void> waitForInit({
  1. dynamic maxWait = const Duration(seconds: 5),
})

Implementation

Future<void> waitForInit({final maxWait = const Duration(seconds: 5)}) async {
  final start = DateTime.now();
  while (true) {
    if (isInitialized) break;
    if (DateTime.now().difference(start) >= maxWait) {
      Fimber.e('Failed to wait RemoteConfig', stacktrace: StackTrace.current);
      break;
    }
    await Future.delayed(const Duration(milliseconds: 10));
  }
}