onInit method

  1. @override
void onInit()
override

Called immediately after the widget is allocated in memory. You might use this to initialize something for the controller.

Implementation

@override
void onInit() {
  AppConfig.logger.t("onInit Splash");
  super.onInit();

  try {
    if (Get.arguments != null) {
      List<dynamic> arguments = Get.arguments;
      fromRoute = arguments.elementAt(0);
      if(arguments.length > 1) toRoute = arguments.elementAt(1);
    }

    switch(fromRoute){
      case AppRouteConstants.home:
        break;
      case AppRouteConstants.logout:
        break;
      case AppRouteConstants.introRequiredPermissions:
        break;
      case AppRouteConstants.accountSettings:
        if(toRoute == AppRouteConstants.accountRemove) {
          subtitle.value = CommonTranslationConstants.removingAccount;
        } else if (toRoute == AppRouteConstants.profileRemove) {
          subtitle.value = CommonTranslationConstants.removingProfile;
        }
        break;
      case AppRouteConstants.forgotPassword:
        subtitle.value = CommonTranslationConstants.sendingPasswordRecovery;
        break;
      case AppRouteConstants.introReason:
        subtitle.value = CommonTranslationConstants.creatingAccount;
        break;
      case AppRouteConstants.signup:
        subtitle.value = CommonTranslationConstants.creatingAccount;
        break;
      case AppRouteConstants.paymentGateway:
        subtitle.value = CommonTranslationConstants.paymentProcessing;
        break;
      case AppRouteConstants.finishingSpotifySync:
        subtitle.value = CommonTranslationConstants.finishingSpotifySync;
        break;
      case AppRouteConstants.mediaUpload:
        subtitle.value = CommonTranslationConstants.updatingApp;
        break;
      case "":
        AppConfig.logger.t("There is no fromRoute");
        break;
    }

  } catch (e) {
    AppConfig.logger.e(e.toString());
  }

}