-
-
Notifications
You must be signed in to change notification settings - Fork 268
Open
Labels
bugSomething isn't workingSomething isn't workingp:iOSiOS Home Screen WidgetsiOS Home Screen Widgets
Description
What happened?
I have an intent that looks like this
import AppIntents
@available(iOS 17.0, *)
struct EntryTypeEntity: AppEntity, Identifiable, Codable {
var id: String
var displayString: String
static var typeDisplayRepresentation = TypeDisplayRepresentation(name: "Entry Type")
static var defaultQuery = EntryTypeQuery()
var displayRepresentation: DisplayRepresentation {
DisplayRepresentation(title: "\(displayString)")
}
static let task = EntryTypeEntity(id: "task", displayString: "Task")
static let note = EntryTypeEntity(id: "note", displayString: "Note")
static let event = EntryTypeEntity(id: "event", displayString: "Event")
static let all = [task, note, event]
}
@available(iOS 17.0, *)
struct EntryTypeQuery: EntityQuery {
func entities(for identifiers: [String]) async throws -> [EntryTypeEntity] {
return EntryTypeEntity.all.filter { identifiers.contains($0.id) }
}
func suggestedEntities() async throws -> [EntryTypeEntity] {
return EntryTypeEntity.all
}
func defaultResult() async -> EntryTypeEntity? {
return .task
}
}
And a widget config intent like this
import AppIntents
import WidgetKit
@available(iOS 17.0, *)
struct AppWidgetConfigIntent: WidgetConfigurationIntent {
static var title: LocalizedStringResource = "Configure Widget"
static var description = IntentDescription("Choose what to display in your widget")
@Parameter(title: "List")
var list: ListEntity?
@Parameter(title: "Entry Types")
var entryTypes: [EntryTypeEntity]?
@Parameter(title: "Show Overdue Count", default: false)
var showOverdueCount: Bool
@Parameter(title: "Button Destination")
var buttonDestination: ButtonDestinationEntity?
init() {
self.entryTypes = []
self.showOverdueCount = false
}
}
What do you expect?
getInstalledWidgets to work
Relevant log output
Flutter:
Unsupported value: Runner.EntryTypeEntity(id: "task", displayString: "Task") of type __SwiftValue
Swift:
An abort signal terminated the process. Such crashes often happen because of an uncaught exception or unrecoverable error or calling the abort() function.
At line "result(widgetInfoList)"Execute in a terminal and put output into the code block below
Output of: flutter doctor -v
On which Platform do you experience this issue?
iOS
Other information
No response
Are you interested in working on a PR for this?
- I want to work on this
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingp:iOSiOS Home Screen WidgetsiOS Home Screen Widgets