File tree Expand file tree Collapse file tree 2 files changed +7
-23
lines changed Expand file tree Collapse file tree 2 files changed +7
-23
lines changed Original file line number Diff line number Diff line change @@ -139,12 +139,4 @@ extension ImageFieldSmoothieExtension on ImageField {
139139 ImageField .PACKAGING => product.imagePackagingUrl,
140140 ImageField .OTHER => null ,
141141 };
142-
143- String ? getFieldId () => switch (this ) {
144- ImageField .FRONT => null ,
145- ImageField .INGREDIENTS => 'ingredients' ,
146- ImageField .NUTRITION => 'nutrition_facts_table' ,
147- ImageField .PACKAGING => 'environmental_score_packaging' ,
148- ImageField .OTHER => null ,
149- };
150142}
Original file line number Diff line number Diff line change @@ -135,26 +135,18 @@ class _ProductImageSwipeableViewState extends State<ProductImageSwipeableView>
135135 }
136136
137137 Widget _editButton (ImageField imageField) {
138- final String ? fieldId = imageField.getFieldId ();
139-
140- if (fieldId == null ) {
141- return EMPTY_WIDGET ;
142- }
143-
144138 const Icon icon = Icon (Icons .edit_note);
145-
146- if (fieldId == 'ingredients' ) {
139+
140+ if (imageField == ImageField . INGREDIENTS ) {
147141 return IconButton (
148142 icon: icon,
149143 onPressed: () async {
150- await ProductFieldOcrIngredientEditor ().edit (
151- context: context,
152- product: upToDateProduct
153- );
144+ await ProductFieldOcrIngredientEditor ()
145+ .edit (context: context, product: upToDateProduct);
154146 },
155147 );
156148 }
157- if (fieldId == 'nutrition_facts_table' ) {
149+ if (imageField == ImageField . NUTRITION ) {
158150 return IconButton (
159151 icon: icon,
160152 onPressed: () async {
@@ -166,7 +158,7 @@ class _ProductImageSwipeableViewState extends State<ProductImageSwipeableView>
166158 },
167159 );
168160 }
169- if (fieldId == 'environmental_score_packaging' ) {
161+ if (imageField == ImageField . PACKAGING ) {
170162 return IconButton (
171163 icon: icon,
172164 onPressed: () async {
@@ -180,7 +172,7 @@ class _ProductImageSwipeableViewState extends State<ProductImageSwipeableView>
180172
181173 return EMPTY_WIDGET ;
182174 }
183-
175+
184176 Widget _lockedIcon (ImageField imageField) {
185177 if (widget.product.isImageLocked (imageField, _currentLanguage) != true ) {
186178 return EMPTY_WIDGET ;
You can’t perform that action at this time.
0 commit comments