Flutter State Management with Momentum

source: https://www.xamantra.dev/momentum/#/


Before we go in deep with the intro, I assume you are already familiar with flutter. I’m sure there are many state management plugins in flutter and this is no different, its certainly wasn’t made yesterday but it’s been around for a while now. I’m going to share my experience with it and i hope you will consider it and give it a try

What is Momentum

From the official docs, momentum is a MVC pattern for flutter and it sure does lives up to its promise. It comes equipped with great features out of the box and is made purely in Flutter with no other third party dependencies and is actively maintained.


  • State Management
  • Dependency Injection
  • Service Locator
  • Persistence State
  • Routing
  • Event System
  • Testing


Add the momentum plugin to your pubspec.yaml file

MVC (Model View Controller)

momentum MVC

What is MVC

State Management

Example Model

Example Controller

Example View (Widget)

To be able to have the UI for the components to complete our trio, i will show a simple view example. This is where MomentumBuilder comes into play. Imagine in your stateless widget build method.

Dependency Injection & service locator

Yes momentum has this out of the box and its straight forward. With momentum you can easily access almost everything, yes!. It has 3 approaches to DI.

Service locator

So how do we grab those services? Lets see the power of extending our services with MomentumService

Event System

Let me wrap up with Momentum Event system. I found this really handy, so what are they?



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Donald Chinhuru

Donald Chinhuru

An Undergraduate student studying towards BEng in Electronic Engineering with a keen interest on Software development. Currently pursuing everything Flutter 💙