initialize method

  1. @mustCallSuper
FutureOr<void> initialize()
inherited

This function is called when the module is being initialized. We launch a module automaticaly when it's marked as root or when the application request the module for the first time.

Implementation

@mustCallSuper
FutureOr<void> initialize() {
  _isInitialized = true;

  var package = 'packages/$name/';
  var obsAppLocalization = KareeInternationalization.initAppLocalization();
  obsAppLocalization.listen((appLocalization) async => await appLocalization
      .readModuleTranslationFile(appLocalization.locale!, package));
  if (KareeMaterialApp.type == KareeApplicationType.application) {
    return obsAppLocalization.value
        .readModuleTranslationFile(obsAppLocalization.value.locale!, package);
  }
}