BottomSheet
BottomSheet copied to clipboard
Pass in item to ContentView
When binding to an optional item. What are your thoughts on passing the item to the content view?
Similar to the sheet modifier.
func sheet<Item, Content>(item: Binding<Item?>, onDismiss: (() -> Void)? = nil, content: @escaping (Item) -> Content) -> some View where Item : Identifiable, Content : View
It would be good to get this added but I had some issues only showing the sheet if the item could be unwrapped to return to the content view. You're welcome to have a go and open a PR :)
I second this feature request; without it the repo doesn't work for me.
I second this feature request; without it the repo doesn't work for me.
as a workaround until this is added:
.bottomSheet(item: $item) {
item.flatMap { /* whatever view needed the unwrapped item */ }
}
But I also would love to see this implemented directly