SwiftUI modal: detect if full screen or stacked

I have a View that consists of a NavigationView. I set its style to .stack using .navigationViewStyle to force the 'stacked' modal look when appropriate (I am displaying it modally from UIKit using a UIHostingController).

This works fine but I need the view to detect if it's actually shown using the stacked look or not at runtime (on an iPhone in landscape mode, it will be displayed as full screen and I need to add a Close/Dismiss button in that specific case).

Suggestions?