getNovaClassification method
Implementation
Map<String, dynamic> getNovaClassification() {
final List<Map<String, dynamic>> novaClassification = [
{
'nova': '1',
'category': 'Unprocessed / Minimally Processed',
'description':
'Whole foods like fruits, vegetables, legumes, grains, meat, milk, and eggs. No or minimal changes, like freezing, drying, grinding, or pasteurization.',
'color': const Color(0xFF4CA92F),
},
{
'nova': '2',
'category': 'Processed Culinary Ingredients',
'description': 'Oils, sugar, salt, and vinegar. Extracted from unprocessed foods and used in cooking.',
'color': const Color(0xFFF7CD47),
},
{
'nova': '3',
'category': 'Processed Foods',
'description':
'Made by combining minimally processed and culinary ingredients. Examples: cheese, canned vegetables, bread, cured meats. Contain additives and preservatives, but retain recognizable food structure.',
'color': const Color(0xFFED6E2D),
},
{
'nova': '4',
'category': 'Ultra-Processed Foods (UPFs)',
'description':
'Industrially manufactured products with multiple ingredients beyond food, like additives, emulsifiers, and artificial flavors. Examples: packaged snacks, instant noodles, soda, frozen meals.',
'color': const Color(0xFFEA3323),
}
];
final classification = novaClassification.firstWhere(
(map) => int.tryParse(map['nova'] as String) == this,
orElse: () => {
'category': 'Unknown',
'description': 'No classification found for this value.',
'color': Colors.grey,
},
);
return classification;
}