The dependency rule
One law, three letters
Dependency rule — arrows point inward
Presentation
widgets · cubits
- MaterialApp
- BlocBuilder
- FeaturedBooksCubit
Domain
entities · use cases · repo contracts
- BookEntity
- BooksRepo
- FetchFeaturedBooksUseCase
Data
models · sources · repo impl
- BookModel
- BooksRemoteDataSource
- BooksRepoImpl
Domain sits in the middle and knows nobody. Presentation calls into Domain. Data implements Domain's contracts. Presentation never touches Data directly.