init method

Future<void> init()

Initialize the dependencies the same way they are initialized in root widget.

Implementation

Future<void> init() async {
  try {
    if (_momentum._initializer != null) {
      await _momentum._initializer!();
    }
    _initServices();
    await _initControllerModel();
    _bootstrapControllers();
    await _bootstrapControllersAsync();
    _onReadyControllers();
  } catch (e, stackTrace) {
    print(e.toString());
    print(stackTrace.toString());
    throw MomentumError('[Momentum]: Failed to initialize your app. '
        'Check the above stacktrace for details.');
  }
}