riverpod + ChangeNotifier has been my main choice for state management for a long time because of its simplicity. But since v1.0.0, riverpod removing the syntax sugar context.read and required to extend the ConsumerWidget/ConsumerStatefulWidget instead, make the code heavily depends on riverpod. So I decided to let it go and find another state management, and the best state management so far is flutter_bloc.
By applying flutter_bloc, we can define the event as a use case, make the code easy to write unit tests and reduce the boilerplate.
riverpod
+ChangeNotifier
has been my main choice for state management for a long time because of its simplicity. But since v1.0.0,riverpod
removing the syntax sugarcontext.read
and required to extend theConsumerWidget/ConsumerStatefulWidget
instead, make the code heavily depends onriverpod
. So I decided to let it go and find another state management, and the best state management so far isflutter_bloc
.By applying
flutter_bloc
, we can define the event as a use case, make the code easy to write unit tests and reduce the boilerplate.