3

I'm trying to upgrade my Flutter project to Flutter2. I see all my packages are null-safe but bulid_runner.

$ flutter pub outdated --mode=null-safety

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   

direct dependencies: all support null safety.

dev_dependencies:
build_runner  ✗1.12.2  -           ✗1.12.2     ✗1.12.2  
No resolution was found. Try running `flutter pub upgrade --null-safety --dry-run` to explore why.

1 dependency is constrained to a version that is older than a resolvable version.

My question is how can I upgrade to Flutter2 without such an important package is not supported. How can I solve this issue? Has anyone seen this problem?

bianca
  • 7,004
  • 12
  • 43
  • 58
  • Beginning with 2.0, the [`build_runner`](https://pub.dev/packages/build_runner) package is now null safe. – iDecode May 20 '21 at 15:13

2 Answers2

0

Faced the same issue. Actually, as migration guide says, you should wait for all dependencies to migrate to null safety before migrating your project.

BUT. If you don't referenced to build_runner package anywhere from your code and use it as command line toolset only you can ignore the fact that it is not null safe yet. Just proceed migration using referenced guide.

I needed to use this package for new version of mickito to generate test mocks. And despite it is not null safe I use it successfully for this purpose with Dart >=2.12 and Flutter >=2.0.

Mol0ko
  • 2,938
  • 1
  • 18
  • 45
-1

enter image description hereThe build_runner package is null safety since 2.0.0 version.