Description
Currently, the recipe app displays a random recipe when the user clicks on the "Choose a Recipe" button. This feature enhancement aims to modify the app's behavior so that a recipe is displayed automatically when the app starts, without requiring user interaction.
Acceptance Criteria
- When the app is launched, it should display a random recipe on the screen.
- The displayed recipe should include the recipe's name, image, and instructions.
- The displayed recipe should be chosen randomly from the available list of recipes.
- The displayed recipe should update each time the app is restarted.
- The "Choose a Recipe" button should no longer be necessary for displaying a recipe on app start.
- change the text on the button to 'Refresh a Recipe'
Implementation Steps
- Update the
_RecipeScreenState class to include a new method called _selectRandomRecipeOnStart. This method will be responsible for selecting a random recipe when the app starts.
- Call the
_selectRandomRecipeOnStart method in the initState lifecycle method of the _RecipeScreenState class to ensure it is executed when the app starts.
- Modify the
build method of the _RecipeScreenState class to display the randomly selected recipe on the screen.
- Remove the "Choose a Recipe" button and any associated code that is no longer necessary for displaying a recipe on app start.
- Test the app thoroughly to ensure the random recipe is displayed correctly when the app starts.
Additional Considerations
- Handle edge cases, such as when the recipe list is empty, by displaying an appropriate message or error handling mechanism.
- Update the app's UI and layout as needed to accommodate the recipe being displayed on app start.
Resources
Dependencies
- Flutter SDK: [insert Flutter SDK version]
- Dart SDK: [insert Dart SDK version]
Testing Instructions
- Launch the app and verify that a random recipe is displayed on the screen.
- Restart the app multiple times and ensure that a new random recipe is displayed on each app start.
Description
Currently, the recipe app displays a random recipe when the user clicks on the "Choose a Recipe" button. This feature enhancement aims to modify the app's behavior so that a recipe is displayed automatically when the app starts, without requiring user interaction.
Acceptance Criteria
Implementation Steps
_RecipeScreenStateclass to include a new method called_selectRandomRecipeOnStart. This method will be responsible for selecting a random recipe when the app starts._selectRandomRecipeOnStartmethod in theinitStatelifecycle method of the_RecipeScreenStateclass to ensure it is executed when the app starts.buildmethod of the_RecipeScreenStateclass to display the randomly selected recipe on the screen.Additional Considerations
Resources
Dependencies
Testing Instructions