Category: Flutter Project Structure
-
Don’t Put All Code in main.dart
Introduction When you start learning Flutter, the very first file you encounter is main.dart. This file is the entry point of every Flutter application. It contains the main() function and the root runApp() call that launches your app. For beginners, it is tempting to put all of your application logic, UI code, and widgets inside…
-
Organizing the lib/ Folder
One of the most important skills for any Flutter developer is not just writing code but organizing it properly. When you first create a Flutter project, the lib/ folder looks simple. It usually contains only one file: main.dart. At the beginning, this is fine. But as your app grows in size and complexity, your lib/…
-
What is .gitignore File?
When working with any software project, especially one that uses Git for version control, you will come across a file named .gitignore. This small but powerful file plays a huge role in maintaining a clean and efficient Git repository. In Flutter (and Dart projects), .gitignore is especially important because certain files and folders — such…
-
What is .idea/ or .vscode/ Folder?
Introduction When you create a project in modern development environments such as IntelliJ IDEA, Android Studio, or Visual Studio Code (VS Code), you will often notice the presence of hidden folders like .idea/ or .vscode/. These folders are automatically generated by the Integrated Development Environment (IDE) and contain configuration files that store project-specific settings. Although…
-
What is the build/ Folder?
When you open a Flutter project in your editor for the first time, you’ll notice several folders like lib/, android/, ios/, web/, and build/. While folders such as lib/ contain your actual app code, the build/ folder is different. It’s not a folder you directly write code in, but it plays an essential role in…
-
What is .dart_tool/ Folder?
When working with Flutter and Dart, you’ll notice several folders inside your project directory — lib/, android/, ios/, test/, and others. Among them, there is a special hidden folder named .dart_tool/. At first glance, many developers wonder: What is this folder? Why is it hidden? Can I delete it? Should I edit its files? The…
-
What is pubspec.yaml?
The file pubspec.yaml is a YAML (YAML Ain’t Markup Language) configuration file that Flutter uses to understand the setup of your app. It includes: But among all these, the Dependencies section is the most frequently updated because almost every app relies on third-party libraries. What Are Dependencies? In programming, a dependency is any external piece…
-
Assets in Flutter
One of the greatest strengths of Flutter is its flexibility in handling assets — the external files that your app needs, such as images, JSON data, animations, audio, or other resources. Assets give life to your app: they define how it looks, what content it shows, and how users interact with it. In Flutter, assets…
-
Dev Dependencies
Introduction When you create a Flutter project, one of the most important configuration files you will work with is pubspec.yaml. This file defines your project’s metadata, its assets, and most importantly, its dependencies. Dependencies are external libraries or tools that extend the functionality of your app. In Flutter and Dart, dependencies are divided into two…
-
What is pubspec.yaml?
When you open any Flutter project, one of the first files you’ll notice at the root level is pubspec.yaml. At first glance, it may look like just another configuration file filled with indentation and strange syntax. But in reality, pubspec.yaml is the heart of every Flutter project. If the lib/ folder is where your Dart…