Skip to main content

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 to true.

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​