Skip to content

1.9.57

Compare
Choose a tag to compare
@raamcosta raamcosta released this 03 Jan 14:39
· 227 commits to main since this release
46099dc

What changed

  • Fixes #541
  • We now allow a parameter on the annotated Composable of the same type of the navArgsDelegate even if (and this is the new bit) that type is also a navigation argument type.
    So, this:
@Serializable
data class SomeSerializable(...)

@Destination(
    navArgsDelegate = SomeSerializable:class
)
@Composable
fun SomeScreen(
    navArgs: SomeSerializable
)

Will now work, and navArgs parameter will be provided by the library.
Before, since navArgs is Serializable, Compose Destinations would treat it as a new nav argument, but since you were specifying a delegate to define the nav args, it didn't allow you to do that.

NOTE that the navArgsDelegate class doesn't need to be Serializable itself, each field will corresponde to one nav argument, so only the fields need to be considered a nav argument type. (list is on https://composedestinations.rafaelcosta.xyz/destination-arguments/navigation-arguments#basics).

Full Changelog: 1.9.56...1.9.57