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 totrue.
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β
- Configuration - Customize the UI
- Client API - Low-level API reference