Nutrition Module
The Nutrition module provides all nutrition-related UI screens and functionality.
Accessing the moduleβ
After AzeooSDK.connect, use AzeooSDK.nutrition:
AzeooSDK.nutrition.showMainScreen(bottomSafeArea: true);
Methodsβ
showMainScreenβ
Shows the main nutrition screen with an overview of all nutrition features.
void showMainScreen({bool? bottomSafeArea})
Parameters:
bottomSafeArea(bool?, optional): Whether to apply bottom safe area. Defaults totrue.
Example:
nutrition.showMainScreen(bottomSafeArea: true);
showNutritionPlansβ
Shows the nutrition plans screen where users can browse available nutrition plans.
void showNutritionPlans()
Example:
nutrition.showNutritionPlans();
showNutritionPlanβ
Shows a specific nutrition plan.
void showNutritionPlan(String planId)
Parameters:
planId(String): The ID of the nutrition plan to display.
Example:
nutrition.showNutritionPlan('plan-123');
showUserNutritionPlanβ
Shows the user's current nutrition plan.
void showUserNutritionPlan()
Example:
nutrition.showUserNutritionPlan();
showRecipesβ
Shows the recipes screen where users can browse recipes.
void showRecipes()
Example:
nutrition.showRecipes();
showRecipeβ
Shows a specific recipe.
void showRecipe(int recipeId, {String? recipeName})
Parameters:
recipeId(int): The ID of the recipe to display.recipeName(String?, optional): Optional recipe name for better navigation.
Example:
nutrition.showRecipe(12345, recipeName: 'Chicken Salad');
showBarcodeScannerβ
Shows the barcode scanner screen for scanning food products.
void showBarcodeScanner()
Example:
nutrition.showBarcodeScanner();
showMobileScannerβ
Shows the mobile scanner (alternative scanner implementation).
void showMobileScanner()
Example:
nutrition.showMobileScanner();
showCartβ
Shows the shopping cart screen.
void showCart()
Example:
nutrition.showCart();
showNutritionSearchβ
Shows the nutrition search screen for searching foods and nutrition information.
void showNutritionSearch()
Example:
nutrition.showNutritionSearch();
showAddSelectionβ
Shows the add selection screen for adding food items.
void showAddSelection()
Example:
nutrition.showAddSelection();
showAddFoodβ
Shows the add food screen.
void showAddFood()
Example:
nutrition.showAddFood();
showAddMealβ
Shows the add meal screen.
void showAddMeal()
Example:
nutrition.showAddMeal();
Complete Exampleβ
class NutritionScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
final nutrition = AzeooUI.instance.nutrition;
return Scaffold(
appBar: AppBar(title: Text('Nutrition')),
body: ListView(
children: [
ListTile(
title: Text('Main Screen'),
onTap: () => nutrition.showMainScreen(),
),
ListTile(
title: Text('Nutrition Plans'),
onTap: () => nutrition.showNutritionPlans(),
),
ListTile(
title: Text('Recipes'),
onTap: () => nutrition.showRecipes(),
),
ListTile(
title: Text('Barcode Scanner'),
onTap: () => nutrition.showBarcodeScanner(),
),
ListTile(
title: Text('Shopping Cart'),
onTap: () => nutrition.showCart(),
),
ListTile(
title: Text('Search'),
onTap: () => nutrition.showNutritionSearch(),
),
],
),
);
}
}
Next Stepsβ
- Training Module - Training-related screens
- Configuration - Customize the UI
- Client API - Low-level API reference