GetX Flutter Folder Structure

Getx File Structure

Basically, This is the structure that I used for almost my all production projects. With Some tweaks here and there and from this video of CodeX, I think it is efficient enough now. You can watch the video to grasp how this structure will work for your project.

Developers don’t have to repeat themselves, and they shouldn’t be. That’s why I created this repo. You can use it with bloc or provider or riverport as well.

Download the structure here. ⬇️

Why? 🤔

This structure follows the MVC pattern. This is what you see on Web frameworks mostly. Flutter uses dart for it’s UI and LOGIC. That’s why it is quite easy to mess up a project. And this is the reason you need a structure, which every developer will understand when he looks at it. 🚀 😁

About 📖

## – Consts

— All of the unchanged value will be here,
Which are not going to be changed very much and the same across the app’s own universe. Like

const String APPLOGO = “assets/logo.png”;

## – Controllers

— The heart of your app💙 should be cleaned with a folder with each controller. Because as your app grows you will be in need of more controllers, and a folder keeps things organized.

## – Models

— How your data will be presented in a structural way. You can keep your model class here.

## – Services

— Which aims to organize the services. This will communicate with your database. All of the API, Local connections will be made here.

## – Utils

— You can create a small function that doesn’t involve any object. And which only accepts normal Types like String, integer, etc. Like formatting a phone number with a simple function.

## – Views

— Dialogs
— All of your dialogs and pop up will be here. You can also separate it by folder per feature.

— Pages
— All of your UI pages will be here. You can rename them like “signup-page.dart”. And Organize them in their respective folder.

— Themes
— You can make the theme file separately for each theme like “light_theme.dart”.

— Widgets
— All of your custom Button, Text Fields, Dropdowns will be here.

This project is open for contribution. You can make changes that suit your needs and effective and which everybody will understand. The structure and pattern are made to make developer life easier. Peace. 😊


See my other projects here. Thank you.