No named parameter with the name 'nullOk'. context != null ? Localizations.localeOf(context, nullOk: true) : null, [duplicate]
Asked Answered
C

1

13

when I try to run flutter projects it throw these errors and other errors as well can anyone help me out

Debug Console Image

Carmarthenshire answered 9/2, 2021 at 19:25 Comment(2)
Which version of Flutter are you using? If you're using the beta version that has null-safety enabled, the nullOk parameter was removed from Localizations.localeOf. Otherwise you'll need to stick with the stable version (1.22.6 as of writing).Reta
Does this answer your question? How to fix this nullOk error when using the flutter_svg package?Reta
V
52

Try updating your flutter_svg package to this pre-release version.

flutter_svg: ^0.20.0-nullsafety.3

Virgy answered 11/2, 2021 at 1:40 Comment(3)
Thanks, this should be marked as right answerChyou
@Virgy Hi, I have not used flutter_svg in my project then also getting this error. Can you give me solution?Cracow
@ShriyaPandya I would check over your dependencies in pubspec.yaml and try and update to null safety for all your dependencies. You might also have to flutter clean if you change versions.Virgy

© 2022 - 2024 — McMap. All rights reserved.