kevin
06/13/2024, 4:59 PMdata class RouteA(val name: String?)
but not this
data class RouteA(val name: Int?)
I’m getting integer does not allow nullable values
- I assume this is correct but I was wondering why I can’t have optional Int arguments (this is 2.8.0-beta03)Ian Lake
06/13/2024, 11:31 PMNavType
that supports nullable Ints, but, as the error message says, this is specifically and purposefully not supported - similarly for any primitive type. This aligns with the general Android API guidelines, which specifically don't encourage or want you to use nullable primitives (in part because they are hard to work with and in part because of the performance cost of the autoboxing it forces on each one)kevin
06/14/2024, 6:11 AM