Skip to main content

Nutrition Module

The Nutrition module provides all nutrition-related UI screens and functionality.

Accessing the module​

After AzeooSDK.connect, use AzeooSDKModules.nutrition:

import 'package:azeoo_sdk/azeoo_sdk.dart';

AzeooSDKModules.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:

AzeooSDKModules.nutrition.showMainScreen(bottomSafeArea: true);

showNutritionPlans​

Shows the nutrition plans screen where users can browse available nutrition plans.

void showNutritionPlans()

Example:

AzeooSDKModules.nutrition.showNutritionPlans();

showNutritionPlan​

Shows a specific nutrition plan.

void showNutritionPlan(String planId)

Parameters:

  • planId (String): The ID of the nutrition plan to display.

Example:

AzeooSDKModules.nutrition.showNutritionPlan('plan-123');

showUserNutritionPlan​

Shows the user's current nutrition plan.

void showUserNutritionPlan()

Example:

AzeooSDKModules.nutrition.showUserNutritionPlan();

showRecipes​

Shows the recipes screen where users can browse recipes.

void showRecipes()

Example:

AzeooSDKModules.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:

AzeooSDKModules.nutrition.showRecipe(12345, recipeName: 'Chicken Salad');

showBarcodeScanner​

Shows the barcode scanner screen for scanning food products.

void showBarcodeScanner()

Example:

AzeooSDKModules.nutrition.showBarcodeScanner();

showMobileScanner​

Shows the mobile scanner (alternative scanner implementation).

void showMobileScanner()

Example:

AzeooSDKModules.nutrition.showMobileScanner();

showCart​

Shows the shopping cart screen.

void showCart()

Example:

AzeooSDKModules.nutrition.showCart();

showNutritionSearch​

Shows the nutrition search screen for searching foods and nutrition information.

void showNutritionSearch()

Example:

AzeooSDKModules.nutrition.showNutritionSearch();

showAddSelection​

Shows the add selection screen for adding food items.

void showAddSelection()

Example:

AzeooSDKModules.nutrition.showAddSelection();

showAddFood​

Shows the add food screen.

void showAddFood()

Example:

AzeooSDKModules.nutrition.showAddFood();

showAddMeal​

Shows the add meal screen.

void showAddMeal()

Example:

AzeooSDKModules.nutrition.showAddMeal();

Complete Example​

import 'package:flutter/material.dart';
import 'package:azeoo_sdk/azeoo_sdk.dart';

class NutritionScreen extends StatelessWidget {
const NutritionScreen({super.key});

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Nutrition')),
body: ListView(
children: [
ListTile(
title: const Text('Main Screen'),
onTap: () => AzeooSDKModules.nutrition.showMainScreen(),
),
ListTile(
title: const Text('Nutrition Plans'),
onTap: () => AzeooSDKModules.nutrition.showNutritionPlans(),
),
ListTile(
title: const Text('Recipes'),
onTap: () => AzeooSDKModules.nutrition.showRecipes(),
),
ListTile(
title: const Text('Barcode Scanner'),
onTap: () => AzeooSDKModules.nutrition.showBarcodeScanner(),
),
ListTile(
title: const Text('Shopping Cart'),
onTap: () => AzeooSDKModules.nutrition.showCart(),
),
ListTile(
title: const Text('Search'),
onTap: () => AzeooSDKModules.nutrition.showNutritionSearch(),
),
],
),
);
}
}

Next Steps​