Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Request for new functionality
View staffing
Description
SavedStateHandle.saveable requires passing a key.
In the case where the value returned by
Saveable
is the only place where this value is written to and read, the exact value ofkey
doesn't really matter, so long as it is unique.Therefore, there's the possibility of using property delegates to automatically pull the name of the property to use as a key. An implementation would look something like the following:
And then usage would look like:
If b/224565154 is created, then an additional property delegate for
MutableState
could also be created, using something like the following:Usage here would then match
rememberSaveable
almost identically for simplemutableStateOf
usages: