Skip to content

Sample project for Multi-modular hexagonal architecture with MVI in Flutter

Notifications You must be signed in to change notification settings

embraceitmobile/multi_module_hexagonal_mvi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi Module Hexagonal MVI

This project is a technology demonstrator for using a packages as independent modules. The project aims to provide an effective mechanism for data communication between different modules, where each module exposes APIs for data data communication.

Independent modules allow for greater testability, and scalability with a plug-n-play model where the modules can be added and removed easily.

Architecture

The architecture chosen to achieve this goal is the Hexagon Architecture, also known as the Ports and Adapter architecture. For a simple flutter project based on this architecture you can see this excellent medium article.

Design Pattern

The design pattern chosen here is MVI a.k.a Model-View-Intent.

MVP vs MVI explained

Reference: https://www.novatec-gmbh.de/en/blog/mvi-in-android/

In this design pattern, an intent is thrown by the user to the model, which emits a new state based on the received inent. The view listens to the states emitted by the model, and updates the UI accordinly.

The primary principle of this pattern is that the state never mutates: always a new state is emitted by the model. This ensures that even there are mulitple listeners for a state, they will always get the same state.

State Management

Most of the heavy duty state management is being handled in the model using stream and streambuilder. On the presentation layer however, we will be using Bloc due to its immense popularity and greater community support. However, any state management tool can be used instead, it is upto the developer to use the tool that they are comfortable with.

Please note: that this project is still in development, and will be updated frequently.

About

Sample project for Multi-modular hexagonal architecture with MVI in Flutter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published