Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
We have some support in androidx.compose.ui.autofill
Leaving this bug open in case Ralston wants to add more info
No update yet.
We have some support in androidx.compose.ui.autofill
Leaving this bug open in case Ralston wants to add more info
Description
@Model
class MyTheme(var primaryColor: Color)
...
val colors = MaterialColors(primary = myTheme.primaryColor)
MaterialTheme(colors) {
}
If 'MaterialTheme' internally uses an ambient, changing myTheme.primaryColor will synchronously cause the ambient value to change and update its consumers. However, if MaterialTheme actually has a @Model class that gets mutated, then this will result in another recomposition for anything consuming that @Model class.
One proposed solution could be knowing that the @Model class is mutated above the scope where it is being consumed, so in the same recomposition pass we can invalidate and recompose anything consuming it.