DEV Community

Cover image for Flutter Project Structure
Jay Tillu
Jay Tillu

Posted on • Updated on

Flutter Project Structure

As always, I’ll be very straight forward and try to keep the article short, simple and very precise. So that in no time you can learn the things. 😉

To Fully understand flutter, we need to understand its project structure, So we can know which file and folder do what, and why they exist.

The Files and Folders that we mainly use


  • This section contains files and folders that we mainly used while developing apps.

Android and iOS directories

  • Android and iOS directories hold a complete Android and iOS app respectively, with all their respective files. Whenever you want to implement any platform specific feature you can implement it by going in these directories.

lib directory

  • The lib directory holds all your dart code used to run your app.

pubspec.yaml

  • pubspec.yaml is a special file. It contains your app name, description, SDK version, dependencies, and other important stuff.

test directory

  • The test directory is for writing tests in dart similar to instrumented tests in Android using Espresso.

The Files and Folder that we mainly don’t touch

  • In 99.99% of cases, we don’t touch these files. As manually edit them can destroy the entire project (expect .gitignore, and README.md 😉).

  • .idea directory holds all project specific settings. Settings are stored mainly in the form of XML files. We normally don’t touch these folders.

  • The .gitignore file is a text file that tells Git, which files or folders to ignore in a project.

  • .metadata, .packages, pubspec.lock are generated by flutter itself. These files are used by the framework itself for internal usages. We normally don’t touch them. As they perform internal tasks.

  • README.md is a markdown file mainly used in version control like Git for representing information of other files.

That’s it for project structure guys. Feel free to let me know if I miss something. I’ll love to learn it from you. Also, Check out the dart and flutter section to learn more about them on our publication.

Till Then keep loving your work and keep working lovely. And I’ll surely catch you up in next article. 😊

Follow me for more such content

Top comments (1)

Collapse
 
kalifasenou profile image
Kalifa SENOU

Amazing article.