Why does vs code show so many untracked files whenever I try to see the code for a built-in flutter widget?

Viewed 853

While working in Flutter, sometimes I wish to see how a certain built-in or third-party widget works internally. And when I do ctrl+click on my vs code on that widget and hope to see its code, vs code then suddenly shows me like 140-150 untracked files. It only happens when I try to view the code for built-in or third-party widgets. Help me!!!! Thanks...enter image description here

3 Answers

You can right click on the flutter repo (the one above the git commit message text field) and close repository.

Disclaimer: I encountered the same problem and found this question. Then I saw it's unanswered, so I raised a bounty. Now, 5 hours before the bounty ends, and without any extraordinary answers here, I tried again to solve it by myself, and thanks god I found it:

VS code has an option to hide a specific repository non-related to a .gitignore file existence nor its contents.

The steps are:

  1. Files ➜ Preferences ➜ Settings
  2. ➜ User / Workspace, depends on the scope needed to be applied to.
  3. Search for Git: Ignored Repositories.
  4. Append your local flutter repository location, in my case: c:\flutter
  5. Close it manually for the last time, either by restarting VS code or by right clicking it and pressing close repository.

enter image description here

Your SDK is actually something cloned from Github or something that has been connected with Github. Any change in that file may reflect in our files too. Source Control feature of VS Code actually follows that repo. Simply close that source control by minimizing it. Usually, Flutter with Source Control enabled to have these problems.

Related