MVP in flutter

I am a Computer Science undergrad from The National Institute of Engineering, Mysore. I freelance while working at Twilio as Software Developer Engineer (l1).
Search for a command to run...

I am a Computer Science undergrad from The National Institute of Engineering, Mysore. I freelance while working at Twilio as Software Developer Engineer (l1).
No comments yet. Be the first to comment.
I've started Venture Deals three times. I've never finished it. That's not really a discipline problem, it's a format problem. I care about maybe 15% of a book like that: the definitions, the mechanic

In the era of short-form content dominance, creating engaging YouTube Shorts consistently can be a time-consuming challenge. Today, I'm excited to share a comprehensive technical breakdown of an open-source YouTube Shorts generator that automates the...

Lately, I've been diving deep into the world of my SaaS product, Reach. I've been thoroughly immersed in figuring out how to calculate basic site analytics—focusing on the usual suspects like views, unique views, clicks, and a range of other interest...

In a world where communication is key, email templates play a crucial role in delivering messages effectively. Explore the transformative power of React in simplifying the intricate art of crafting email templates. From streamlined development workfl...

Tech stack breakdown: Reach | Building my SAAS

Models - View - Presenter architecture is an extended version on model - view - controller architecture which is mostly used to design User Interfaces.

In my personal experience MVP is the best design pattern or architecture that you can go for in small scale personal and production projects. I always seen the MVP architecture only been used in native iOS and Android development, but in a framework like flutter which supports and promotes breaking code of and making files as small as possible it's important to have an MVP approach
- Project
- Android # already there
- ios # already there
- build # already there
- release # To keep the latest build handy
- latest.apk
- assets # Your typical assets folder
- fonts
- images
- logo
- JSON/Animation # Lottie .jsons or rive .flrs
- lib
- Config # Config files linke theme.dart and stuff
- Models # Various Models
- DataModels. # Data models like User model
- ViewModels. # View models like provider for a complex animation
- Service # Presenter folder
- API # handler files for REST API calls
- firebase. # handler files for firebase
- Cache # handler files for caching data (I prefer hivedb)
- Global # Files with global functions and stuff
- Views # Various Views
- Widgets # Components
This is the so called configs folder containing the configs file. The config files in case of flutter would be files like
Models folder this is supposed be the Models to be things like user models, response model and things like that. I prefer to put all the providers necessary in here as well
This folder I usually divide into two sub folders:
This folder is what would include our presenter part of the MVP pattern. This usually contains things like
API
I use chopper for my API calls so all the service files and the generated .chopper.dart files go here separated in diff. folders
Firebase
This contains all firebase related stuff, like any functions talking to firestore / Firebase Storage functions and things like FCM and dynamic links setup
Cache
This contains files that have functions related to caching function, I use hiveDb so I'd generally have a folder called typeAdapters and have all my adapters there
Global
This is a wrapper folder for files containing global functions, like basic string manipulation and stuff
This is pretty self explanatory containing file related to various views / pages of the app
To all web developers this would correspond to the Components folder in your React or Vue app. To others this folder will contain files including reusable widgets