Hello, everyone! :wave: I’m creating a ModalBotto...
# compose
e
Hello, everyone! 👋 I’m creating a ModalBottomSheet to insert some data. I’m having some difficulties to “clean” the fields after the user inserts one entry. In the official samples, the
TextState
is basically set again to
TextFieldValue()
. Is it the correct approach? Because in my case, I have a more complex State (more properties may be added in the future):
Copy code
@Stable
@Parcelize
internal class CategoryBottomSheetState(val initialName: String, val initialColor: Int) :
    Parcelable {

    @IgnoredOnParcel
    var name by mutableStateOf(initialName)

    @IgnoredOnParcel
    var color by mutableStateOf(initialColor)
}
What do you think? Thanks a lot in advance! 😊