diff --git a/lib/pages/create_recipe_pages/metadata_page.dart b/lib/pages/create_recipe_pages/metadata_page.dart index 82bfe0c..4555bbe 100644 --- a/lib/pages/create_recipe_pages/metadata_page.dart +++ b/lib/pages/create_recipe_pages/metadata_page.dart @@ -103,6 +103,7 @@ class _MetadataPageState extends State { ), Padding(padding: EdgeInsets.only(left: 10)), CookingDurationButton( + heroTag: 1, selectedDuration: _recipeProvider.recipe.prepTime, onDurationChanged: _recipeProvider.updatePrepTime, ), @@ -117,6 +118,7 @@ class _MetadataPageState extends State { ), Padding(padding: EdgeInsets.only(left: 10)), CookingDurationButton( + heroTag: 2, selectedDuration: _recipeProvider.recipe.cookTime, onDurationChanged: _recipeProvider.updateCookTime, ), diff --git a/lib/widgets/cooking_duration_button.dart b/lib/widgets/cooking_duration_button.dart index 57057ef..dfb1cb0 100644 --- a/lib/widgets/cooking_duration_button.dart +++ b/lib/widgets/cooking_duration_button.dart @@ -9,12 +9,15 @@ class CookingDurationButton extends StatelessWidget { required this.selectedDuration, required this.onDurationChanged, this.label = '', + required this.heroTag, }); final String label; final void Function(Duration duration) onDurationChanged; final Duration selectedDuration; + final Object heroTag; + @override Widget build(BuildContext context) { String text = label; @@ -22,6 +25,7 @@ class CookingDurationButton extends StatelessWidget { text = durationToFormattedString(selectedDuration); } return FloatingActionButton.extended( + heroTag: heroTag, onPressed: () => showDialog( context: context, builder: (context) => _getDurationDialog(