Decided to seperate this to another issue because it seemed like it could take some time.
The Deed for AdminModalBottomSheet
[x] Show an add to favorite button if the produce id does not exist in the user-specific favorites list, and a remove from favorites button for vice versa.
[x] Create ProduceListCardCubit which will hold the favorites list and the user.
[x] Link addToFavorites and removeFromFavorites to their respective buttons and react accordingly.
[x] Test addition or removal error
[x] Refresh FavoritesScreen when addition or removal is succesfull.
Retrieving Favorites
It was a miscalculation on my part to discard a getProduceFavorites method. Mainly because we need to update the favorites list every time it is queried. That is, to remove any produce from the favorites list if the produce is "deleted".
[x] #89
Implement Favorite in ProduceScreen
[x] Implement addToFavorites and removeFromFavorites in a ProduceScreen cubit with their states
The Deed for UserModalBottomSheet
[x] Basically reuse what you did in AdminModalBottomSheet
Decided to seperate this to another issue because it seemed like it could take some time.
The Deed for AdminModalBottomSheet
ProduceListCardCubit
which will hold the favorites list and the user.addToFavorites
andremoveFromFavorites
to their respective buttons and react accordingly.FavoritesScreen
when addition or removal is succesfull.Retrieving Favorites
It was a miscalculation on my part to discard a
getProduceFavorites
method. Mainly because we need to update the favorites list every time it is queried. That is, to remove any produce from the favorites list if the produce is "deleted".Implement Favorite in ProduceScreen
addToFavorites
andremoveFromFavorites
in a ProduceScreen cubit with their statesThe Deed for UserModalBottomSheet