Files
food-ai/client/lib/shared/models/product.g.dart
dbastrikin 8d33a4eb30 feat: product search screen with catalog add and success feedback
- Add product search screen (/products/search) as primary add flow;
  "Add" button on products list opens search, manual entry remains as fallback
- Add to shelf bottom sheet with AnimatedSwitcher success view (green checkmark)
  and SnackBar confirmation on the search screen via onAdded callback
- Manual add (AddProductScreen) shows SnackBar on success before popping back
- Extend AddProductScreen with optional nutrition fields (calories, protein,
  fat, carbs, fiber); auto-fills from catalog selection and auto-expands section
- Auto-upsert catalog product on backend when nutrition data is provided
  without a primary_product_id, linking the user product to the catalog
- Add fiber_per_100g field to CatalogProduct model and CreateRequest
- Add 16 new L10n keys across all 12 locales (addProduct, addManually,
  searchProducts, quantity, storageDays, addToShelf, nutritionOptional,
  calories, protein, fat, carbs, fiber, productAddedToShelf, etc.)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 14:04:58 +02:00

40 lines
1.6 KiB
Dart

// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'product.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
CatalogProduct _$CatalogProductFromJson(Map<String, dynamic> json) =>
CatalogProduct(
id: json['id'] as String,
canonicalName: json['canonical_name'] as String,
categoryName: json['category_name'] as String?,
category: json['category'] as String?,
defaultUnit: json['default_unit'] as String?,
storageDays: (json['storage_days'] as num?)?.toInt(),
barcode: json['barcode'] as String?,
caloriesPer100g: (json['calories_per_100g'] as num?)?.toDouble(),
proteinPer100g: (json['protein_per_100g'] as num?)?.toDouble(),
fatPer100g: (json['fat_per_100g'] as num?)?.toDouble(),
carbsPer100g: (json['carbs_per_100g'] as num?)?.toDouble(),
fiberPer100g: (json['fiber_per_100g'] as num?)?.toDouble(),
);
Map<String, dynamic> _$CatalogProductToJson(CatalogProduct instance) =>
<String, dynamic>{
'id': instance.id,
'canonical_name': instance.canonicalName,
'category_name': instance.categoryName,
'category': instance.category,
'default_unit': instance.defaultUnit,
'storage_days': instance.storageDays,
'barcode': instance.barcode,
'calories_per_100g': instance.caloriesPer100g,
'protein_per_100g': instance.proteinPer100g,
'fat_per_100g': instance.fatPer100g,
'carbs_per_100g': instance.carbsPer100g,
'fiber_per_100g': instance.fiberPer100g,
};