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

Null-safety #3037

Closed
ammaratef45 opened this issue Mar 11, 2021 · 10 comments
Closed

Null-safety #3037

ammaratef45 opened this issue Mar 11, 2021 · 10 comments

Comments

@ammaratef45
Copy link

What is the plan for upgrading to support null-safety?

@jakemac53
Copy link
Contributor

See #2920 - this is nearly ready to be published we are just validating things internally right now.

@jakemac53
Copy link
Contributor

(the issue is closed because we have actually landed all the code necessary to write and test a null safe builder in sound mode, we just need to publish)

@BartusZak
Copy link

Hej @jakemac53

I am just checking availability to update my project to flutter 2.0 and dart with null safety support.

Run:

dart pub outdated --mode=null-safety

Result:

Resolving...
Showing dependencies that are currently not opted in to null-safety.
[✗] indicates versions without null safety support.
[✓] indicates versions opting in to null safety.  

Package Name                          Current        Upgradable      Resolvable  Latest
...
dev_dependencies:
build_runner                          ✗1.11.1        ✗1.11.5         -           ✗1.12.2
flutter_launcher_icons                ✗0.8.1         ✗0.8.1          -           ✓0.9.0
...

@jakemac53
Copy link
Contributor

You can freely update to null safety - note that build_runner itself is not migrated but that only means the build itself will not run with sound null safety. Your project should not be directly importing build_runner and so it can run with sound null safety without issue.

@petoknm
Copy link

petoknm commented Mar 25, 2021

@jakemac53 can you please elaborate on how to upgrade a project that uses build_runner to null safety? I've been trying to follow the official migration guide with no luck for a few hours now...

@jakemac53
Copy link
Contributor

@petoknm where are you running into issues?

@petoknm
Copy link

petoknm commented Mar 25, 2021

$ dart pub outdated --mode=null-safety
...
No resolution was found. Try running `dart pub upgrade --null-safety --dry-run` to explore why.
$ dart pub upgrade --null-safety --dry-run
null-safety compatible versions do not exist for:
 - build_runner
 - hive_generator
...

And from then on I cannot follow the guide, because technically not all my deps are null safe. So I'm unsure what to do.

@jakemac53
Copy link
Contributor

You can ignore these, and continue to follow the guide. As long as they are not imported directly it won't impact the migration.

@felixwortmann
Copy link

You can ignore these, and continue to follow the guide. As long as they are not imported directly it won't impact the migration.

@jakemac53 Where can I find that guide?

@petoknm
Copy link

petoknm commented Mar 28, 2021

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

No branches or pull requests

5 participants