Skip to content

Feature: Show Recipe on App Start #8

Description

@LidiaTre

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

  1. 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.
  2. Call the _selectRandomRecipeOnStart method in the initState lifecycle method of the _RecipeScreenState class to ensure it is executed when the app starts.
  3. Modify the build method of the _RecipeScreenState class to display the randomly selected recipe on the screen.
  4. Remove the "Choose a Recipe" button and any associated code that is no longer necessary for displaying a recipe on app start.
  5. 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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions