Repository Design Pattern in Flutter

What is repository design pattern?

A Repository mediates between the domain and data mapping layers, acting like an in-memory domain object collection.


My Implementation

Android app architecture. source:
My Flutter app architecture

Note: I don’t have to implement something similar to ViewModel in my Flutter app because state management is already built in Flutter’s Stateful Widget.

Repository interface
Repository implementation class
Usage in a widget



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