Android, Jetpack Compose, Navigation, Type Safety, Kotlin.
we’re going to create the custom NavType for our Book class: val BookType = object : NavType<Book>( isNullableAllowed = false ) { override fun get(bundle: Bundle, key: String): Book? { return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { bundle.getParcelable(key, Book::class.java) }