Design Pattern in Flutter is very important in developing flutter application and for its better understanding I would request you all to go through my previous blogs Design Patterns in Flutter -Part 1(MVC) and Design Patterns in Flutter -Part 2(MVP), I hope it will clear your every doubt regarding design pattern and the difference between the Design pattern and Software Architecture.

In this blog, we will dive deeper into the significance of Model View ViewModel (MVVM) architecture of Flutter, used for implementing app designs. The MVVM pattern provides a uniform distribution of data with the benefits of flexibility and reusability of the code as well as data.

MVVM was introduced by **Microsoft **in 2005 and since then MVVM architecture and its components have been an essential tool in app development projects.

What is MVVM?

Looking at the definition of MVVM it is the abbreviation of three words namely Model, View, and View Model. The concept of MVVM is to build a view model that can represent the data through a view.

So by looking at the flow diagram of MVVM, we could see that the view model occupies the central position which sends and receives the data from the model and provide the data to the view, it also observes the data changes that occurred at the view and responds accordingly using the model to the view. To write an adaptable codebase, app developers need to build a View-Model layer that can be utilized by several ‘Views’. Now we will look at each individual component individually.

The Model in the MVVM design pattern represents the actual data(real-time) which will be used in application development. for example, we could understand with the help of a real-time scenario of the bank where this element will be the account number, having a person’s name and address.

for better understanding, you could say that the Model can only reflect the actual data, not the characteristics or any feature related to the application. It means you can’t manipulate the way how the data will be represented or formatted. Each item in the dataset will be representing its own model when the data is fetched.

Mainly the Model is kept in away from the logic part for neat code but sometimes it includes the validation logic as well.

#cross-platform #mobile-apps #flutter #mobile-app-development #design-patterns

Design Patterns in Flutter -Part 3 (MVVM)
21.10 GEEK