NutritionAI class

Singleton class to interact with NutritionAI SDK.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

configureSDK(PassioConfiguration configuration) Future<PassioStatus>
Initializes the SDK based on the given PassioConfiguration
enableFlashlight({required bool enabled, double level = 1}) Future<void>
Enables or disables the flashlight with a specified intensity level.
fetchFoodItemForDataInfo(PassioFoodDataInfo passioFoodDataInfo, {double? servingQuantity, String? servingUnit}) Future<PassioFoodItem?>
Fetches detailed information about a food item based on the PassioFoodDataInfo.
fetchFoodItemForPassioID(PassioID passioID) Future<PassioFoodItem?>
For a given PassioID returns the PassioFoodItem of that food item.
fetchFoodItemForProductCode(String productCode) Future<PassioFoodItem?>
Fetch PassioIDAttributes for product code.
fetchFoodItemForRefCode(String refCode) Future<PassioFoodItem?>
A function to fetch a PassioFoodItem using a reference code.
fetchFoodItemLegacy(PassioID passioID) Future<PassioFoodItem?>
Fetches a food item using the legacy method.
fetchHiddenIngredients(String foodName) Future<PassioResult<List<PassioAdvisorFoodInfo>>>
Fetches hidden ingredients for a given food item.
fetchIconFor(PassioID passioID, {IconSize iconSize = IconSize.px90}) Future<PlatformImage?>
Fetch icons from Passio's backend.
fetchInflammatoryEffectData(String refCode) Future<List<InflammatoryEffectData>?>
Fetches a list of InflammatoryEffectData objects for a given refCode.
fetchMealPlanForDay(String mealPlanLabel, int day) Future<List<PassioMealPlanItem>>
Retrieves the meal plan for a specific day.
fetchMealPlans() Future<List<PassioMealPlan>>
Retrieves the list of all available meal plans.
fetchPossibleIngredients(String foodName) Future<PassioResult<List<PassioAdvisorFoodInfo>>>
Fetches possible ingredients for a given food item.
fetchSuggestions(PassioMealTime mealTime) Future<List<PassioFoodDataInfo>>
A function to fetch meal suggestions for a given meal time.
fetchTagsFor(String refCode) Future<List<String>?>
List of tags for food item.
fetchVisualAlternatives(String foodName) Future<PassioResult<List<PassioAdvisorFoodInfo>>>
Fetches visual alternatives for a given food item.
getMinMaxCameraZoomLevel() Future<PassioCameraZoomLevel>
Retrieves the minimum and maximum camera zoom levels supported.
getSDKVersion() Future<String?>
Current version of the Passio SDK.
iconURLFor(PassioID passioID, {IconSize iconSize = IconSize.px90}) Future<String>
URL to download a food icon.
lookupIconsFor(PassioID passioID, {IconSize iconSize = IconSize.px90, PassioIDEntityType type = PassioIDEntityType.item}) Future<PassioFoodIcons>
For a given PassioID returns the default image and cached image.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
predictNextIngredients(List<String> currentIngredients) Future<List<PassioFoodDataInfo>>
Predicts ingredients for a given list of current ingredients.
recognizeImageRemote(Uint8List bytes, {PassioImageResolution resolution = PassioImageResolution.res_512, String? message}) Future<List<PassioAdvisorFoodInfo>>
Recognizes an image remotely using the provided byte data.
recognizeNutritionFactsRemote(Uint8List bytes, {PassioImageResolution resolution = PassioImageResolution.res_1080}) Future<PassioFoodItem?>
Recognizes nutrition facts from an image remotely.
recognizeSpeechRemote(String text) Future<List<PassioSpeechRecognitionModel>>
Recognizes speech remotely using the provided text.
reportFoodItem({String refCode = '', String productCode = '', List<String>? notes}) Future<PassioResult<bool>>
Reports a food item if it is incorrect using either its refCode or productCode.
searchForFood(String byText) Future<PassioSearchResponse>
Search functions that uses the given byText to cross reference the names of the food items in the nutritional database.
searchForFoodSemantic(String term) Future<PassioSearchResponse>
Performs a semantic search for food items based on a given term.
setAccountListener(PassioAccountListener? listener) → void
Sets the account listener for receiving token budget updates.
setCameraZoomLevel({required double zoomLevel}) Future<void>
Sets the camera zoom level.
setPassioStatusListener(PassioStatusListener? listener) → void
If not null, the PassioStatusListener will provide callbacks when the internal state of the SDK's configuration process changes. Passing null will unregister the listener.
startFoodDetection(FoodDetectionConfiguration detectionConfig, FoodRecognitionListener listener) Future<void>
Registers a listener for the food detection process using the stream of frames from the camera of the device.
startNutritionFactsDetection(NutritionFactsRecognitionListener listener) → void
Starts the nutrition facts detection process.
stopFoodDetection() Future<void>
Stops the food detection process.
stopNutritionFactsDetection() Future<void>
Stops the nutrition facts detection process.
submitUserCreatedFood(PassioFoodItem item) Future<PassioResult<bool>>
Submits a user-created food item.
toString() String
A string representation of this object.
inherited
transformCGRectForm(Rectangle<double> boundingBox, Rectangle<double> toRect) Future<Rectangle<double>>
Transforms the bounding box of the camera frame to the coordinates of the preview view where it should be displayed.
updateLanguage(String languageCode) Future<bool>
Updates the language setting for retrieving localized food data.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance NutritionAI
no setter