Pergunta

Does anyone know why Dart Editor won't allow me to edit files located inside the packages folder? I originally had my library class files outside of that folder, but I thought the right way to do it was to put my library under that folder, so I did it and now I can't modify the files.

Foi útil?

Solução

Everything in packages/ is (usually) a symlink to a possibly shared copy of a package, so if you edited a file in packages/ you'd be editing it for all your projects, which might be very not what you want.

If you'd like to edit multiple packages together, the best way to do it is to specify a dependency override that uses a path source, like so:

name: my_package
dependency_overrides:
  my_other_package:
    path: /Users/me/dart/my_other_package

This way any other dependency on that package will also load it from the specified path and pub won't complain that you have different sources for the same package. Then you can open both projects separately in the editor and the my_package will see the changes in my_other_package as you edit.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top