Skip to main content

πŸ₯— 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 */ }

See also​