Not obvious how to import a Dart package #3858
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
closed-duplicate
Closed in favor of an existing report
type-enhancement
A request for a change that isn't a bug
This issue was originally filed by [email protected]
Libraries declare their 'name' in their #library directive. This is the name that a user browsing the code sees, and the name that tools like dartdoc and the editor see and expose, but it has no relationship to the name that the user actually needs - the name that should be imported.
This currently causes much confusion around libraries that ship with the SDK but aren't built-in (see mailing list and e.g. bug 3702) and will equally cause confusion when people start using user libraries through pub.
These names should be the same, at least by convention.
E.g. built in libraries should be #library('dart:html'), user libraries should be #library('package:mypkg');
SDK libraries should be #library('$SDK_ROOT/lib/i18n') or similar, however is the recommended way of importing them.
The text was updated successfully, but these errors were encountered: