id is used to uniquely identify multiple instances
of the same HydratedBloc type.
In most cases it is not necessary;
however, if you wish to intentionally have multiple instances
of the same HydratedBloc, then you must override id
and return a unique identifier for each HydratedBloc instance
in order to keep the caches independent of each other.
Storage prefix which can be overridden to provide a custom
storage namespace.
Defaults to runtimeType but should be overridden in cases
where stored data should be resilient to obfuscation or persist
between debug/release builds.
clear is used to wipe or invalidate the cache of a HydratedBloc.
Calling clear will delete the cached state of the bloc
but will not modify the current state of the bloc.
Called whenever a change occurs with the given change.
A change occurs when a new state is emitted.
onChange is called before the state of the cubit is updated.
onChange is a great spot to add logging/analytics for a specific cubit.
This method is called by from the top level
of the widget tree to initialize the service's
localizations so it can be applied throughout
the service regardless of whether if the
context is available. This method should return
either itself initialized with the context or
a new instance of the Service initialized with
the context. This is a convenience method that
allows the service to be initialized with the
context without having to create a new instance
and is called by the Feature class when creating
BLoC providers for the service.