π₯ Nutrition Module (iOS)
Full destination list
All nutrition + training screens, parameters, and Android/RN snippets: Destination catalogue.
Navigate with typed destinations:
sdk.navigate(to: .nutrition(.plan(id: "abc-123")))
Embedding (tabs / full screen) is in Multi-tab hosting. This page focuses on iOS examples for nutrition.
Examplesβ
Open a specific planβ
sdk.navigate(to: .nutrition(.plan(id: "summer-plan-2025")))
Open a recipe with a display nameβ
sdk.navigate(to: .nutrition(.recipe(id: 12345, name: "Grilled Chicken Salad")))
Open the diary for a specific dateβ
let date = Calendar.current.date(byAdding: .day, value: -1, to: Date())!
sdk.navigate(to: .nutrition(.diary(date: date)))
Open the add-food flow for breakfastβ
sdk.navigate(to: .nutrition(.addFood(mealType: .breakfast)))
Open the AI scannerβ
sdk.navigate(to: .nutrition(.scanner(.ai)))
Embedding the moduleβ
For a tab-based UIKit or SwiftUI app, use sdk.tabHost(for: .nutrition) plus the appropriate coordinator β see Multi-tab hosting for full examples.
For a one-off full-screen presentation:
sdk.modules.nutrition.display(in: hostVC, bottomSafeArea: true) { result in
// Flutter is now embedded in `hostVC`.
sdk.navigate(to: .nutrition(.recipes))
}
SwiftUIβ
sdk.modules.nutrition.getView(bottomSafeArea: true)
.frame(maxWidth: .infinity, maxHeight: .infinity)
Going backβ
sdk.back() // pop one screen
sdk.backToRoot() // back to nutrition home
sdk.canGoBack { result in /* Bool */ }