Member-only story
Feature Driven Arch Theme State, The Easy Way
Flutter skeleton app template has feature screens but is not showing the rest of Feature Driven Arch. One of the ways to connect services to the UI is through notifiers connected to providers. Let me show you a way to do that using the Theme State as an example.
What Am I Using
These are the packages I am using:
Riverpod
The other thing I am using in Riverpod is the State Notifier part of Riverpod’s import of the state notifier package:
The whole reason why we should avoid using ChangeNotifier with providers is that ChangeNotifier is mutable, and State Notifier is instead immutable and gives these benefits to using it:
-compare previous and new state