Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter clean command causes null safety errors

Tags:

flutter

dart

Ever since null-safety was introduced to Flutter, when I do flutter clean, the whole project switches to null-safety.

I can not update my whole project to null-safety quite yet as many packages I use have not migrated.

How can I do a flutter clean without getting thousands of errors telling me that non-nullable item must be initialized first...

I am currently on Flutter 1.24.0-10.2-pre, channel beta.

pubspec.yaml includes the following

environment:
  sdk: ">=2.2.2 <3.0.0"
like image 668
tapizquent Avatar asked Oct 23 '25 04:10

tapizquent


1 Answers

I get exactly the same issue. I haven't found a fix yet but if you open the pub spec.yaml file and save it without making changes it solves the issue until you next run flutter clean.

like image 177
Simon Warrington Avatar answered Oct 25 '25 18:10

Simon Warrington



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!