7
Implementing the Inversion of Control Principle
In Chapter 6, we started working on our Model layer by introducing the repository pattern and exploring its various benefits. One of the main themes of patterns in this book is decoupling responsibilities, which leads to improved flexibility, scalability, and maintainability. The first crucial step in achieving this is extracting all the logic of the Model layer into repositories. The next logical step is to follow the inversion of control (IoC) principle in order to design a good app architecture.
In this chapter, we will learn how to provide our repositories to our blocs (view models, notifiers, providers, and so on) in a way that allows us to easily replace these dependencies, control their ...
Get Flutter Design Patterns and Best Practices now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.