Skip to content
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

adding more named and explicit imports #1909

Merged
merged 4 commits into from
Jun 27, 2023

Conversation

miquelbeltran
Copy link
Member

Following the proposal in flutter/website#7798 I have added more explicit and named imports on those places I thought it would make sense.

Let me know what you think.

Pre-launch Checklist

  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I read the Contributors Guide.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-devrel channel on Discord.

@domesticmouse
Copy link
Contributor

I'm wondering if we should just adopt the default of import 'dart:ui' as ui; as opposed to having a mix of as ui and show Name

@domesticmouse
Copy link
Contributor

Also, please update this PR to turn the CI green. =)

@miquelbeltran
Copy link
Member Author

I'm wondering if we should just adopt the default of import 'dart:ui' as ui; as opposed to having a mix of as ui and show Name

makes sense, I will do the change to see how it looks like

Copy link
Contributor

@domesticmouse domesticmouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is import 'dart:math' as math; something we do elsewhere? It almost feels like overkill?

@miquelbeltran
Copy link
Member Author

miquelbeltran commented Jun 27, 2023

Is import 'dart:math' as math; something we do elsewhere? It almost feels like overkill?

As with the other changes we have done related to flutter/website#7798 none of them are strictly necessary.

I like the idea of having the math dependency as a named import because it allows for easier discoverability, and because the math import has a lot of top level functions and constants, so it doesn't mess with autocomplete. Although, effective Dart doesn't have a recommendation regarding this, and I don't have a strong opinion on this either, so I'm fine to revert the change.

@domesticmouse domesticmouse merged commit 715c433 into flutter:main Jun 27, 2023
15 checks passed
@miquelbeltran miquelbeltran deleted the mb-named-explicit-imports branch June 28, 2023 07:28
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants