Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use a non null saftey package inside a null saftey enabled app dart

So , there is this package which doesn't have null safety in any of its versions. Is there any way i can use it inside my project where i am using null safety.

Here is the error that my IDE is showing me : enter image description here

like image 495
Farhan Syedain Avatar asked Sep 12 '25 18:09

Farhan Syedain


1 Answers

So, in case your app depends on some packages which don't have null safety. You can run your app with unsound null safety. For that run this command.

flutter run --no-sound-null-safety

For dart files :

dart --no-sound-null-safety run

So , what basically this does is runs some of your code with null safety and the part that is not eligible for null safety without null safety.

Reference from this article

like image 173
Farhan Syedain Avatar answered Sep 14 '25 11:09

Farhan Syedain