init method

Future<void> init()

Implementation

Future<void> init() async {
  /// Catcher needs a method to run
  /// The method we provide catcher does the following
  /// 1. Register the modules
  /// 2. Call the original method to run, which in turn calls runApp

  /// The Completer is so we know when the runApp has started running.
  Completer initAppCompleter = Completer();

  withErrorManagement(() => registerModules()
      .then((_) => initApp())
      .then(initAppCompleter.complete));

  return initAppCompleter.future;
}