-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NavKey navTarget parcelable is not enforced #310
Comments
Maybe there are options not to use such a restriction? I would like to pass any models to the screen arguments |
Hi @aaudin90, I'm currently looking into something along these lines. At the moment if you don't make your model parcelable in some manner your app will crash. Likely the approach in the short term will be a runtime check earlier to avoid things slipping into production |
I understand the solution to the current error. I may be wrong, but having to inherit from parcelable makes appyx less usable. Is it possible to make a second implementation of BaseNavModel that is not tied to parcelable? |
Will your Node not be persisting it's routing/state when a configuration change occurs? |
You can also get around this by storing the backstack in different stores. |
I looked in Decompose, the arguments there must also be Parcelable, but it is possible to disable state saving. And transfer complex models under the annotation @IgnoredOnParcel |
Thanks @aaudin90. I'll discuss this with the team, and come back to you :) |
I will be waiting for you) |
Because of this, :sample:app keeps crashing whenever it goes background with home button or recents button(not back button). It logs like below.
|
@LachlanMcKee, Hi! Have any ideas?) |
Perhaps it makes sense to open access to the creation of your own serializers/deserializers, so as not to get tied up in Perselable |
At the moment the NavKey
navTarget
argument is not enforced to be parcelable. It uses@RawValue
to avoid the compiler complaining.Unfortunately this means it is possible to introduce code that will crash at runtime (there is currently an issue in the newly introduced
IndexedBackStack
causing a crash when the app is backgrounded.By adding more constraints to the generics we can ensure that we have compile time safety.
The text was updated successfully, but these errors were encountered: