Search code examples
flutterclean-architecture

MVVM and clean architecture both are same in flutter?


i am beginner in flutter now and i want to learn software architecture patterns but many confusion in this. i want to know clean architecture and MVVM both are same? if no?what is difference between them and what is MVVM + clean architecture in flutter and please let me know best resource to learn as beginner


Solution

  • MVVM is a pattern that is used on the Presentation Layer of the Clean Architecture. BLoC is a more popular alternative to MVVM in the Flutter world.

    In this article, I gave an example of an architecture adhering to the Clean Architecture Principles. It depicts how to use physical layer separation instead of just using folder separation. Also, it uses BLoC as a state management on the presentation layer. You can check out this repo to play with the example and see how the dependencies are organized there.

    So, on the diagram below the BLoC will be encapsulated/hidden inside the presentation layer of the Clean Architectured solution.

    Hope that helps!

    enter image description here