Disher
Disher copied to clipboard
Create the ViewModel for the DishesScreen
Note: Please raise your PR against the main
branch when you are ready!
This issue relates to this issue: #2
This Issue:
For this issue you need to create the ViewModel class for the DishesScreen. This ViewModel will be similar to the CategoryViewModel
but will instead return a list of dishes instead of categories
For help or information you can check out the already existing CategoryViewModel
as a starting point app/src/main/java/com/example/disher/category/viewmodel/CategoryViewModel
Extra Points:
- Send some state to the UI (maybe fake data) that the UI listens to and reacts to
I can work on this, can you tell which API method I use to get list of all dishes.
@Hiteshpatel10 you certainly can! Ill assign it to you now...
So the API you will need to use is this:
www.themealdb.com/api/json/v1/1/filter.php?c=____
So in the service you need to add the filter endpoint (/filter.php?c=____
) and where you see the missing text (the blank line) that needs to be the strCategory
from the screen before that the user has selected, which should be being passed into the composable already...
Let me know if you need any help :)
I have also build the use case and repository for Dishes Screen in order to build the Dishes screen viewModel. So, should I make a PR for the use case and repository in this #4 or in the current issue #3
@Hiteshpatel10 thats perfect too! yeh just make a PR against #3 and make a note in the PR comment that you addressed #4 as well and when the PR gets merged ill close 4 :)
can you review my PR and suggest changes if any.