This package aims to provide a complete solution for communication between services inside your app. The idea behind this class is that every service (provided you use services - or you may call them repositories, controllers, robots or whatever) uses the same class as a form of communication. This solves a couple problems you did not knew you had!
- Whenever a service in a chain of service methods results in an error type of
FeedbackResponse
, then all the other services/methods have to do is recognise the errorFeedbackResponse
and pass that response down the line to the calling class. - Here comes the cool part, the response contains a proper and specific feedback title and message for the user along with the type of feedback the user should get (if that’s what you want of course, they may also be empty). Example: fetching a user’s profile goes wrong. A
ProfileServiceRobot
creates aFeedbackResponse
with atitle
andmessage
explaining what happened in context of the profile along with the type of feedback it should show (snackbar
,dialog
,bottomsheet
,none
). Now all you have to is handle that accordingly (whether it be an error or success, both may contain interesting feedback) and your users are instantly provided with super responsive feedback everywhere they go! - Here comes the last cool part if you create/override your own
FeedbackResponseHandlerInterface
then all you have to do is pass any response to the handler and it will automatically handle the responses for you (coool, more time for you to write sick code).