Skip to content

Is relative vs package imports still an issue? #49

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
jibbers42 opened this issue Feb 20, 2020 · 2 comments
Closed

Is relative vs package imports still an issue? #49

jibbers42 opened this issue Feb 20, 2020 · 2 comments

Comments

@jibbers42
Copy link

The docs warn

Extremely important if you use GetIt: ALWAYS use the same style to import your project files either as relative paths OR as package which I recommend. DON'T mix them because currently Dart treats types imported in different ways as two different types although both reference the same file.

However I'm wondering if this issue has been solved (and released in possibly Dart 2.1) via
dart-lang/sdk#33076

My tools tend to suggest relative imports at times and I'm curious if I actually need to be diligent about this.

Is it no longer an issue?

@escamoteur
Copy link
Collaborator

Interesting catch! From what I read this shouldn't now longer be a problem. Could you give it a try and test if it works if you register a type via package but get it in another file with relative import?

@escamoteur
Copy link
Collaborator

It seems it's no longer a problem

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants