No named parameter with the name 'nullOk' error in flutter

After lots of effort, I found a successful answer to remove this error.

If you have added SVG dependency in pubspec.yaml so you have replaced this to

flutter_svg: ^0.20.0-nullsafety.3


Several nullOk parameters have been removed as part of null safety post-migration. You can read more on the corresponding design doc and its upcoming migration guide.

TL;DR you can try to use .maybeOf(context) instead of .of(context, nullOk: true);

You may have to update your dependencies to make it work.

Tags:

Dart

Flutter