I found another workaround. In your WidgetConfiguration you can do:
var body: some WidgetConfiguration {
AppIntentConfiguration(kind: kind, provider: ...)) { entry in
...
}
.supportedFamilies(supportedFamilies)
}
private var supportedFamilies: [WidgetFamily] {
if whatever {
return [.systemLarge, .systemSmall, .systemMedium]
} else {
return []
}
}