answerRobotoffQuestion method
Implementation
void answerRobotoffQuestion(
RobotoffQuestion question,
InsightAnnotation? annotation,
) {
robotoffQuestionsNotifier.value = robotoffQuestionsNotifier.value
.map<RobotoffQuestion, InsightAnnotation?>((
RobotoffQuestion key,
InsightAnnotation? value,
) {
if (key == question) {
return MapEntry<RobotoffQuestion, InsightAnnotation?>(
key,
annotation,
);
}
return MapEntry<RobotoffQuestion, InsightAnnotation?>(key, value);
});
_changed = _computeHasChanged();
notifyListeners();
}