You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
home_widget on iOS works by using an app group to share data between your app and the widget. I am not sure if an AppExtension is able to retrieve data from a database on iOS.
Without knowing your specific setup generally you should be able to do the following:
@available(iOS 16.0, *)
struct HabitEntity: AppEntity{
let id: Int
let title: String
}
@available(iOS 16.0, *)
struct HabitEntityQuery:EntityQuery{
func entities(for identifiers: [HabitEntity.ID]) async throws -> [HabitEntity] {
HabitEntity.allHabits.filter{
identifiers.contains($0.id)
}
}
// HabitEntity.allHabits
// HabitDao.shared.getHabitList() ?? HabitEntity.allHabits;
}
The code for my configurable widget is as above.
I want the initial value selected by the user to come from the Flutter SQLite database.
How can I retrieve this initial value and see it in the home_widget document?
I only saw how to send data from the Flutter side to the widget and receive data from the widget.
How can the widget actively request data from Flutter when the user clicks on the configuration?
The text was updated successfully, but these errors were encountered: