How to add a transition for a conditionally rendered view inside a GroupedListStyle list? to achieve something like the conditional DatePicker from the "Do Not Disturb" section in Settings (see GIF below).
Adding transition and animation for the conditionally rendered view does not seem to work.
if condition {
Toggle(isOn: $foo) {
HStack {
Text("Foo")
}
}
.transition(.opacity)
.animation(.easeInOut)
.toggleStyle(SwitchToggleStyle(tint: Color.red)
}

Implementation based on pawello2222
The animation is that smooth especially when the view about to disappear. The transition position was animated from frame 1 to 11 but suddenly disappeared from frame 12 onwards.

