diff --git a/packages/smooth_app/lib/l10n/app_en.arb b/packages/smooth_app/lib/l10n/app_en.arb index 0a7b91f46f5f..8491132b8ff8 100644 --- a/packages/smooth_app/lib/l10n/app_en.arb +++ b/packages/smooth_app/lib/l10n/app_en.arb @@ -1013,6 +1013,14 @@ "@edit_product_form_item_stores_hint": { "description": "Product edition - Stores - input textfield hint" }, + "edit_product_form_item_origins_title": "Origins", + "@edit_product_form_item_origins_title": { + "description": "Product edition - Origins - Title" + }, + "edit_product_form_item_origins_hint": "Spain, Beef from Argentina, The soy does not come from the European union", + "@edit_product_form_item_origins_hint": { + "description": "Product edition - Origins - input textfield hint" + }, "edit_product_form_item_countries_title": "Country", "@edit_product_form_item_countries_title": { "description": "Product edition - Countries - Title" diff --git a/packages/smooth_app/lib/l10n/app_fr.arb b/packages/smooth_app/lib/l10n/app_fr.arb index 05bba42bf03c..019290a2a500 100644 --- a/packages/smooth_app/lib/l10n/app_fr.arb +++ b/packages/smooth_app/lib/l10n/app_fr.arb @@ -1013,6 +1013,14 @@ "@edit_product_form_item_stores_hint": { "description": "Product edition - Stores - input textfield hint" }, + "edit_product_form_item_origins_title": "Origines", + "@edit_product_form_item_origins_title": { + "description": "Product edition - Origins - Title" + }, + "edit_product_form_item_origins_hint": "Espagne", + "@edit_product_form_item_origins_hint": { + "description": "Product edition - Origins - input textfield hint" + }, "edit_product_form_item_countries_title": "Pays", "@edit_product_form_item_countries_title": { "description": "Product edition - Countries - Title" diff --git a/packages/smooth_app/lib/pages/product/edit_product_page.dart b/packages/smooth_app/lib/pages/product/edit_product_page.dart index cb6723e2e5c9..46b6a9ae0d8f 100644 --- a/packages/smooth_app/lib/pages/product/edit_product_page.dart +++ b/packages/smooth_app/lib/pages/product/edit_product_page.dart @@ -163,6 +163,7 @@ class _EditProductPageState extends State { }, ), _getSimpleListTileItem(SimpleInputPageStoreHelper()), + _getSimpleListTileItem(SimpleInputPageOriginHelper()), _getSimpleListTileItem(SimpleInputPageEmbCodeHelper()), _getSimpleListTileItem(SimpleInputPageCountryHelper()), _getSimpleListTileItem(SimpleInputPageCategoryHelper()), diff --git a/packages/smooth_app/lib/pages/product/simple_input_page_helpers.dart b/packages/smooth_app/lib/pages/product/simple_input_page_helpers.dart index 677d56c64f2c..68dc4c5523a5 100644 --- a/packages/smooth_app/lib/pages/product/simple_input_page_helpers.dart +++ b/packages/smooth_app/lib/pages/product/simple_input_page_helpers.dart @@ -130,6 +130,30 @@ class SimpleInputPageStoreHelper extends AbstractSimpleInputPageHelper { Widget? getIcon() => const Icon(Icons.shopping_cart); } +/// Implementation for "Origins" of an [AbstractSimpleInputPageHelper]. +class SimpleInputPageOriginHelper extends AbstractSimpleInputPageHelper { + @override + List initTerms() => splitString(product.origins); + + @override + void changeProduct(final Product changedProduct) => + changedProduct.origins = terms.join(_separator); + + @override + String getTitle(final AppLocalizations appLocalizations) => + appLocalizations.edit_product_form_item_origins_title; + + @override + String getAddHint(final AppLocalizations appLocalizations) => + appLocalizations.edit_product_form_item_origins_hint; + + @override + TagType? getTagType() => null; + + @override + Widget? getIcon() => const Icon(Icons.travel_explore); +} + /// Implementation for "Emb Code" of an [AbstractSimpleInputPageHelper]. class SimpleInputPageEmbCodeHelper extends AbstractSimpleInputPageHelper { @override diff --git a/packages/smooth_app/lib/query/product_query.dart b/packages/smooth_app/lib/query/product_query.dart index 494a5af39971..a8fdbe3b2689 100644 --- a/packages/smooth_app/lib/query/product_query.dart +++ b/packages/smooth_app/lib/query/product_query.dart @@ -145,5 +145,6 @@ abstract class ProductQuery { ProductField.COUNTRIES_TAGS, ProductField.COUNTRIES_TAGS_IN_LANGUAGES, ProductField.EMB_CODES, + ProductField.ORIGINS, ]; } diff --git a/packages/smooth_app/pubspec.lock b/packages/smooth_app/pubspec.lock index 7235a520daec..3671dfc705bc 100644 --- a/packages/smooth_app/pubspec.lock +++ b/packages/smooth_app/pubspec.lock @@ -764,7 +764,7 @@ packages: name: openfoodfacts url: "https://pub.dartlang.org" source: hosted - version: "1.21.0" + version: "1.22.0" openfoodfacts_flutter_lints: dependency: "direct dev" description: diff --git a/packages/smooth_app/pubspec.yaml b/packages/smooth_app/pubspec.yaml index 0882630c751e..1e64afbf124f 100644 --- a/packages/smooth_app/pubspec.yaml +++ b/packages/smooth_app/pubspec.yaml @@ -34,7 +34,7 @@ dependencies: url: 'https://github.com/M123-dev/matomo-tracker.git' ref: 'fix-event-sending' modal_bottom_sheet: ^2.1.0 - openfoodfacts: ^1.21.0 + openfoodfacts: ^1.22.0 # openfoodfacts: # path: ../../../openfoodfacts-dart package_info_plus: ^1.4.2