Skip to content

global name 'context' may hit local widget BuildContext parameters #515

New issue

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

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

Already on GitHub? Sign in to your account

Closed
nanobug opened this issue Apr 25, 2019 · 3 comments
Closed

global name 'context' may hit local widget BuildContext parameters #515

nanobug opened this issue Apr 25, 2019 · 3 comments

Comments

@nanobug
Copy link

nanobug commented Apr 25, 2019

My code broke after adding path library because I was using 'context' as BuildContext variable in my highest widget.

@nanobug nanobug changed the title global name 'context' may hit local widget BuildContext paramters global name 'context' may hit local widget BuildContext parameters Apr 25, 2019
@munificent
Copy link
Member

The README for path says:

The path library was designed to be imported with a prefix, though you don't have to if you don't want to:

import 'package:path/path.dart' as p;

So it has some top-level identifiers that are pretty short names, with the understanding that you'll use a prefix to avoid collisions. If you prefer not to use a prefix, you can also do:

import 'package:path/path.dart' hide context;

@nanobug
Copy link
Author

nanobug commented Apr 26, 2019

Thanks, I already had the feeling that I am posting a dart-NOOB issue :)

@munificent
Copy link
Member

That's totally OK! Asking question is how you learn. :)

@mosuem mosuem transferred this issue from dart-archive/path Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants