Skip to content

Commit

Permalink
Fixed some bugs for add recipe feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Ketan Choyal committed Mar 15, 2024
1 parent caa40b1 commit 61f5ef7
Show file tree
Hide file tree
Showing 6 changed files with 294 additions and 233 deletions.
27 changes: 27 additions & 0 deletions lib/ui/views/add_calories/view/add_calories.form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,33 @@ class _AddCaloriesForm extends StatelessWidget {
? const Text('Unmodify Nutrition Values')
: const Text('Modify Nutrition Values'),
),
// ListView.builder(
// shrinkWrap: true,
// itemCount: food.incredients?.length ?? 0,
// itemBuilder: (BuildContext context, int index) {
// return IngredientWidget(
// incredient: food.incredients![index],
// );
// },
// ),
if (food.incredients != null && food.incredients!.isNotEmpty) ...[
const SizedBox(height: 16),
const Text(
'Incredients',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 16),
...food.incredients!
.map((e) => IngredientWidget(
incredient: e,
allowEdit: false,
))
.toList()
],
if (food.notes != null && food.notes!.isNotEmpty) ...[
const SizedBox(height: 16),
Text(
Expand Down
1 change: 1 addition & 0 deletions lib/ui/views/add_recipe/bloc/add_recipe_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class AddRecipeBloc extends Bloc<AddRecipeEvent, AddRecipeState> {
.where((element) => element.id != event.food.id),
],
)));
_updateNutrient();
}
}

Expand Down
Loading

0 comments on commit 61f5ef7

Please sign in to comment.