Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the functionality of .dart_tool folder in a Flutter application?

Tags:

flutter

dart

I am new to flutter and I encountered this folder .dart_tool. I am able to find the uses of each folder and files, except this one. I want to know what purpose does this folder serves.

enter image description here

like image 539
Sumit Singh Avatar asked Aug 20 '20 17:08

Sumit Singh


3 Answers

As @Shri noted in his answer, the Flutter documentation says:

The .dart_tool directory, which is new in Dart 2, is used by pub and other tools. It replaces the .pub directory as of the 2.0.0-dev.32.0 SDK release.

However, I would also add that it contains a package_config.json file that specifies packages' locations and versions (which could cause a problem that I addressed in this answer), as well as Flutter build caches (in a flutter_build directory).

like image 133
Michal Karbownik Avatar answered Oct 12 '22 04:10

Michal Karbownik


From the documentation,

The .dart_tool directory, which is new in Dart 2, is used by pub and other tools. It replaces the .pub directory as of the 2.0.0-dev.32.0 SDK release.

like image 43
Shri Hari Avatar answered Oct 12 '22 05:10

Shri Hari


Anyone who wonders what is pub, It is the package repository for flutter and Dart Applications.

A Package Repository is a place where all the packages (like libraries, jars) are stored in the internet (once downloaded they may get stored in the local machine and then we call it a local repository).

like image 40
Ashan Priyadarshana Avatar answered Oct 12 '22 06:10

Ashan Priyadarshana