When retrieving a route, you must define a concrete class or object (not an interface or abstract class). To check the selected destination use hasRoute
for example:
val dst = if (backStackEntry?.destination?.hasRoute(WelcomeDestination::class)) {
backStackEntry?.toRoute<WelcomeDestination>()
}else if ..
Each destination must be annotated with @Serializable. For a full explanation, watch: Navigation Compose meet Type Safety