private fun navigateToNextScreen(screenType: RegistrationScreenType<String>) { when(screenType) { is RegistrationScreenType.CompanyInformationScreen -> { viewModelScope.launch(Dispatchers.Main) { navigationEvent.emit(RegistrationNavigationEvent.OpenCompanyInformationScreen) } _uiState.value = uiState.value.copy( dotPagerList = listOf( Dot(completed = true),Dot(),Dot(),Dot()),isLoading = true)getCountryData() getCountryStateData() } is RegistrationScreenType.AgreementsScreen -> {  } is RegistrationScreenType.AccountInformationScreen -> { _uiState.value = uiState.value.copy( signInProcessing = true ) //Starting DQM string checking API call, if error t val parameters = JsonObject() parameters.addProperty("name",uiState.value.companyName.value) dqmStringCheckerForCompanyName(parameters) getAddressFieldErrorsOrNull() } is RegistrationScreenType.RecommendationScreen -> { viewModelScope.launch(Dispatchers.Main) { navigationEvent.emit(RegistrationNavigationEvent.OpenRecommendationScreen) } } is RegistrationScreenType.AccountReviewScreen -> { _uiState.value = uiState.value.copy( signInProcessing = true, dotPagerList = listOf( Dot(completed = true), Dot(completed = true), Dot(completed = true), Dot() ) ) when(val validationResult = validateAccountInformationScreen()) { null -> { goToUniqueUserNameCheck() } else -> { displayAccountInformationErrors(validationResult) } } } is RegistrationScreenType.UserInformationScreen -> { viewModelScope.launch(Dispatchers.Main) { _uiState.value = uiState.value.copy( signInProcessing = true ) navigationEvent.emit(RegistrationNavigationEvent.OpenUserInformationScreen) getBusinessRoles() } } is RegistrationScreenType.SignUpEmailConfirmationScreen -> { when(val validationResult = validateUserInformationScreen()) { null -> { _uiState.value = uiState.value.copy( signInProcessing = true ) dqmStringCheckForFirstName() } else  > { displayUserInformationErrors(validationResult) } } } } }
This method navigates the registration flow to the next appropriate screen for the registration