π₯ Nutrition Module (Android)
The Nutrition module's screens are reached through AzeooDestination. See also Android navigation.
sdk.navigate(AzeooDestination.Nutrition.Plan(id = "abc-123"))
Embedding the module (fragment / Compose view) is documented further down; this page is the destination reference.
Destinationsβ
Every routable nutrition screen, as a subclass of AzeooDestination.Nutrition:
| Destination | Shows |
|---|---|
Home | Nutrition home (today's diary) |
Diary(date: Long?) | Diary for a specific date (epoch ms; null = today) |
Plans | List of nutrition plans |
Plan(id: String) | A specific nutrition plan |
Recipes | Recipe list |
Recipe(id: Long, name: String?) | A specific recipe |
Scanner(kind: ScannerKind = BARCODE) | Barcode / mobile / AI scanner |
Search(initialMealType: MealType?) | Food search |
AddFood(mealType: MealType) | Add food flow |
AddMeal(mealType: MealType) | Add meal flow |
Cart | Shopping cart |
ShoppingList | Shopping list |
Settings | Nutrition settings |
AddSelection | Add food/meal selection |
PermissionTest | Permission test (debug) |
Supporting typesβ
enum class ScannerKind { BARCODE, MOBILE, AI }
enum class MealType { BREAKFAST, LUNCH, DINNER, SNACK }
Examplesβ
Open a specific planβ
sdk.navigate(AzeooDestination.Nutrition.Plan(id = "summer-plan-2025"))
Open a recipe with a display nameβ
sdk.navigate(AzeooDestination.Nutrition.Recipe(id = 12345, name = "Grilled Chicken Salad"))
Open the diary for a specific dateβ
val yesterdayMs = System.currentTimeMillis() - 24 * 60 * 60 * 1000L
sdk.navigate(AzeooDestination.Nutrition.Diary(date = yesterdayMs))
Open the add-food flow for breakfastβ
sdk.navigate(AzeooDestination.Nutrition.AddFood(mealType = MealType.BREAKFAST))
Open the AI scannerβ
sdk.navigate(AzeooDestination.Nutrition.Scanner(kind = ScannerKind.AI))
Embedding the moduleβ
Fragment (XML / View system)β
val nutritionFragment = sdk.modules.nutrition.getFragment(bottomSafeArea = false)
supportFragmentManager
.beginTransaction()
.replace(R.id.flutter_container, nutritionFragment, "nutrition")
.commitNow()
Composeβ
sdk.modules.nutrition.ComposeView(bottomSafeArea = true)
Adaptive native navigationβ
If you use a BottomNavigationView / NavigationRailView / Jetpack Navigation, install a module container once at startup so cross-module sdk.navigate(...) flips your native UI automatically:
sdk.setModuleContainer(AzeooBottomNavCoordinator(
bottomNav = findViewById(R.id.bottom_nav),
mapping = mapOf(
AzeooDestination.Module.NUTRITION to R.id.nav_nutrition,
AzeooDestination.Module.TRAINING to R.id.nav_training,
),
))
Going backβ
sdk.back() // pop one screen
sdk.backToRoot() // back to nutrition home
sdk.canGoBack { result -> /* Boolean */ }
System back / predictive back β see Android navigation β Back.