@@ -21,8 +21,8 @@ Widget ingredientImage(String url, BuildContext context) {
21
21
22
22
class IngredientDetails extends StatelessWidget {
23
23
final AsyncSnapshot <Ingredient > snapshot;
24
- final void Function ()? select ;
25
- const IngredientDetails (this .snapshot, {super .key, this .select });
24
+ final void Function ()? onSelect ;
25
+ const IngredientDetails (this .snapshot, {super .key, this .onSelect });
26
26
27
27
@override
28
28
Widget build (BuildContext context) {
@@ -76,12 +76,12 @@ class IngredientDetails extends StatelessWidget {
76
76
),
77
77
),
78
78
actions: [
79
- if (snapshot.hasData && select != null )
79
+ if (snapshot.hasData && onSelect != null )
80
80
TextButton (
81
81
key: const Key ('ingredient-details-continue-button' ),
82
82
child: Text (MaterialLocalizations .of (context).continueButtonLabel),
83
83
onPressed: () {
84
- select !();
84
+ onSelect !();
85
85
Navigator .of (context).pop ();
86
86
},
87
87
),
@@ -100,9 +100,14 @@ class IngredientDetails extends StatelessWidget {
100
100
class IngredientScanResultDialog extends StatelessWidget {
101
101
final AsyncSnapshot <Ingredient ?> snapshot;
102
102
final String barcode;
103
- final Function (int id, String name, num ? amount) selectIngredient ;
103
+ final Function (int id, String name, num ? amount) onSelectIngredient ;
104
104
105
- const IngredientScanResultDialog (this .snapshot, this .barcode, this .selectIngredient, {super .key});
105
+ const IngredientScanResultDialog (
106
+ this .snapshot,
107
+ this .barcode,
108
+ this .onSelectIngredient, {
109
+ super .key,
110
+ });
106
111
107
112
@override
108
113
Widget build (BuildContext context) {
@@ -181,7 +186,7 @@ class IngredientScanResultDialog extends StatelessWidget {
181
186
key: const Key ('ingredient-scan-result-dialog-confirm-button' ),
182
187
child: Text (MaterialLocalizations .of (context).continueButtonLabel),
183
188
onPressed: () {
184
- selectIngredient (ingredient! .id, ingredient.name, null );
189
+ onSelectIngredient (ingredient! .id, ingredient.name, null );
185
190
Navigator .of (context).pop ();
186
191
},
187
192
),
0 commit comments