Learning Flutter DI using GetIt, Injectable, and also using Riverpod for state management.
The content contains examples of using only GetIt and using Injectable to generate dependencies. Both are implemented on Riverpod and MVVM architecture.
On top of that, this will contain the example of using only provider for dependency injection, not using GetIt. And it will be examples of unit testing.
Using GetIt and Injectable with Riverpod is possible, but it hard to do a test. Because Riverpod class like Notifier and we should not send dependencies via constructor. If using GetIt to inject dependencies directly into the class, it will be very hard to pass a mock.
So the Riverpod should use Provider as a dependency injection because Riverpod provide ability to mock the Provider when do unit testing.