I am using flutter_bloc
package for state management and extends with Equatable
. I have made Event class
and state class
for the data to display which I receive from api
. It is the simple app where I am receiving data from api
and just to display on the screen on UI
. Everything works good. But now I also want to check the internet connectivity and display the snackBar if internet is not working. For this I will use Connectivity_plus
package of flutter. But as I am using the Bloc pattern
I already have one state class
and one event
class.
My question is, if now I would like to have the feature if Internet is working or not and if I want to implement in Bloc pattern
then I have to create new NetworkState class
and NetworkEvent class
? OR I can reuse the state
and event
class which I already have in my app ??
In the general terms every time we have to make new states class
and event class
for the new feature or we can reuse these class for every feature which we implement in Bloc pattern
in flutter?