Closed durduman closed 5 years ago
Hi @durduman 👋 Thanks for opening an issue!
Bloc does not have an opinion about how you model your events and states. In some cases, you can get away with using enums so you can simply switch on the event (see counter example).
In more complex cases, it's common to use classes to model your events and states. If you choose to go that route, you'll need a way to identify which type of event you are processing; type checking is one of the most easy/straightforward ways and there's nothing wrong with checking an object's type.
Hope that helps 👍
Thank you for your answer.
I am using bloc architecture based this repo.
It seems that it is based a lot on type checking such as:
Is type checking a good practice? Are flutter & dart oriented towards this way coding or is this just a shortcut for this bloc implementation.