Nutrition Module
The Nutrition module provides all nutrition-related UI screens and functionality.
Accessing the Moduleβ
import { AzeooUI } from '@azeoo/react-native-sdk';
const nutrition = AzeooUI.instance.nutrition;
Methodsβ
showMainScreenβ
Shows the main nutrition screen with an overview of all nutrition features.
showMainScreen(options?: { bottomSafeArea?: boolean })
Parameters:
options(object, optional): Configuration optionsbottomSafeArea(boolean, 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.
showNutritionPlans()
Example:
nutrition.showNutritionPlans();
showNutritionPlanβ
Shows a specific nutrition plan.
showNutritionPlan(planId: string)
Parameters:
planId(string): The ID of the nutrition plan to display.
Example:
nutrition.showNutritionPlan('plan-123');
showUserNutritionPlanβ
Shows the user's current nutrition plan.
showUserNutritionPlan()
Example:
nutrition.showUserNutritionPlan();
showRecipesβ
Shows the recipes screen where users can browse recipes.
showRecipes()
Example:
nutrition.showRecipes();
showRecipeβ
Shows a specific recipe.
showRecipe(recipeId: number, options?: { recipeName?: string })
Parameters:
recipeId(number): The ID of the recipe to display.options(object, optional): Configuration optionsrecipeName(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.
showBarcodeScanner()
Example:
nutrition.showBarcodeScanner();
showMobileScannerβ
Shows the mobile scanner (alternative scanner implementation).
showMobileScanner()
Example:
nutrition.showMobileScanner();
showCartβ
Shows the shopping cart screen.
showCart()
Example:
nutrition.showCart();
showNutritionSearchβ
Shows the nutrition search screen for searching foods and nutrition information.
showNutritionSearch()
Example:
nutrition.showNutritionSearch();
showAddSelectionβ
Shows the add selection screen for adding food items.
showAddSelection()
Example:
nutrition.showAddSelection();
showAddFoodβ
Shows the add food screen.
showAddFood()
Example:
nutrition.showAddFood();
showAddMealβ
Shows the add meal screen.
showAddMeal()
Example:
nutrition.showAddMeal();
Complete Exampleβ
import React from 'react';
import { View, TouchableOpacity, Text, StyleSheet } from 'react-native';
import { AzeooUI } from '@azeoo/react-native-sdk';
const NutritionScreen = () => {
const nutrition = AzeooUI.instance.nutrition;
const menuItems = [
{ label: 'Main Screen', action: () => nutrition.showMainScreen() },
{ label: 'Nutrition Plans', action: () => nutrition.showNutritionPlans() },
{ label: 'Recipes', action: () => nutrition.showRecipes() },
{ label: 'Barcode Scanner', action: () => nutrition.showBarcodeScanner() },
{ label: 'Shopping Cart', action: () => nutrition.showCart() },
{ label: 'Search', action: () => nutrition.showNutritionSearch() },
];
return (
<View style={styles.container}>
{menuItems.map((item, index) => (
<TouchableOpacity
key={index}
style={styles.button}
onPress={item.action}
>
<Text style={styles.buttonText}>{item.label}</Text>
</TouchableOpacity>
))}
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
padding: 20,
},
button: {
backgroundColor: '#0284C7',
padding: 15,
borderRadius: 8,
marginBottom: 10,
},
buttonText: {
color: 'white',
fontSize: 16,
textAlign: 'center',
},
});
export default NutritionScreen;
Next Stepsβ
- Training Module - Training-related screens
- Configuration - Customize the UI
- Client API - Low-level API reference