After I've installed packages, it seems we have this packages
folder under every folder in the project. Is this really necessary? Can't Dart just look up the directory chain to find the top level packages
folder and be done with it?
Or at least, is there a way to hide the rest of the packages
folders because they clutter the view?
Using the M1 version of the editor, all the packages symlinks are hidden. You should only see the top level packages directory, but not all the symlinks. If you've updated your editor (perhaps with a clean reinstall) and you're still seeing packages symlinks in the Files view, please open a bug at http://dartbug.com/new and paste in your Editor version and a screenshot.
As to your question "why can't Dart just walk the tree?", that's difficult when you're serving a Dart app on a web server. A Dart file may be served from any path, but there's no good concept of "walking the tree"... how far do you go up?
The packages symlinks technique makes finding those dependencies relative to your Dart script, which makes it easy for a web deployment of Dart.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With