Post

Replies

Boosts

Views

Activity

Trailing closure passed to parameter of type 'FormStyleConfiguration' that does not accept a closure
im trying to display a list of categries from database in combo box , i write this form of code but it display an error : **my code ** : `@StateObject var viewModel: MyShopViewModel = MyShopViewModel() @ObservedObject var catVm: CategoryViewModel var body: some View { NavigationView { VStack { Form { Section(header: Text("Product Information")) { TextField("Product Name", text: .constant("")) TextField("Product Description", text: .constant("")) TextField("Product Price", text: .constant("")) } Section(header: Text("Product Category")) { Picker("Category", selection: $catVm.selectedCategory?.id) { ForEach(catVm.categories, id: \.id) { category in Text(category.name) } } } Section(header: Text("Product Image")) { Text("Image 1") } Section(header: Text("Product Publish")) { Button("Publish your new product!") { } } } } } } view model : @Published var categories: [Category] = [Category]() @Published var selectedCategory: Category? = nil init() { Task { await getCategories() } } func getCategories() async { let result = await CategoryRepo.getAll() switch result { case .success(let data): categories = data selectedCategory = data.first case .failure: print("Cannot fetch categories...") } }}```` it display this error Trailing closure passed to parameter of type 'FormStyleConfiguration' that does not accept a closure from this section Section(header: Text("Product Category")) { Picker("Category", selection: $catVm.selectedCategory?.id) { ForEach(catVm.categories, id: \.id) { category in Text(category.name) } } }
1
0
380
May ’23
How to implement background notifications with action buttons (Accept/Decline) in iOS Flutter app?
I am developing a Flutter app for food delivery (a multivendor e-commerce restaurant app). In the vendor app (Android), I successfully implemented a background notification that stays active until the vendor responds with either Accept or Decline. This works fine on Android, but I cannot get the same functionality working on iOS. My requirements: Vendor should receive a background notification. The notification should include action buttons (Accept / Decline). It should remain active until the vendor takes action. My questions: Is this possible to implement in iOS with Flutter? If yes, what is the recommended way (e.g., firebase_messaging, flutter_local_notifications, flutter_foreground_task, or native iOS integration)? Are there any iOS restrictions I should consider compared to Android background services? I built this for Android using firebase_messaging + flutter_foreground_task + flutter_local_notifications. On iOS, I tried setting up firebase_messaging and flutter_local_notifications, but I’m unable to keep the notification persistent with Accept/Decline action buttons. I expected similar behavior to Android, but it seems iOS has more restrictions around background services and notification handling. Dependencies I am using (relevant ones): firebase_core: ^3.8.0 firebase_messaging: ^15.1.5 flutter_local_notifications: ^17.2.2 flutter_foreground_task: ^8.17.0 get: ^4.7.2 shared_preferences: ^2.3.2
1
0
222
Sep ’25