Imagine If someone unfamiliar with the code structure decides to make some changes, then he would accidentally overrides some of the lifecycle method in (_MyCustomeWidgetUi ) instead of (_MyCustomeWidgetState ) and this can lead to unintended consequences.
I would call this [ Provider-Cubit ] !
I have a deep appreciation for Flutter_bloc and its elegant state emission. In this example, I've made a few adjustments to the Provider State Management to resemble the simplicity of a Cubit.
Let me illustrate with an example:
@tech_kingsley You can use stream with provider and Stream Subscription.
This approach is just for handling more state cases in clean way using the normal provider.
@EdawareRichard Yes you're right,
This approach for someone who don't know how to use Bloc, it will help them to handle more state cases properly using only Provider.
If you tried to handle more state cases using the normal provider way it wouldn't look this clean.
@protected 3 - LoginState Abstract Class:
Defines an abstract class LoginState that extends Equatable.
Equatable is used for easy value equality comparisons.
Yes itโs more code, but more concise and clean.