Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expected a value of type 'SkDeletable', but got one of type 'Null'

I have updated my flutter project from 1.26.3 to 2.1.0. Since then I am facing some issue. I am getting error as "Expected a value of type 'SkDeletable', but got one of type 'Null'".

Does anybody knows what is related with?

like image 351
Flutterian Avatar asked Mar 08 '21 13:03

Flutterian


4 Answers

I got the same error with the following code snippet:

BackdropFilter(
        filter: ImageFilter.blur(
        
          sigmaX: animation.value * 5.0),
          sigmaY: animation.value * 5.0),
        ),
        child: Container(
          color: Colors.transparent,
        ),
      ),

The error gets thrown because the animation goes from 0 to 1. More precisely, the ImageFilter does not work with values equal to zero. A quick work-around is something like:

max(0.001, animation.value * 5.0)

so no zero value is passed to the Filter.

like image 165
Florian V Avatar answered Nov 05 '22 10:11

Florian V


I resolved my running the following commands on the terminal

  • flutter clean
  • flutter pub get
  • flutter run I hope it resolves your issue
like image 42
Okwesi Avatar answered Nov 05 '22 10:11

Okwesi


It is most likely related to flushbar lib you might be using, try to use another_flushbar, as it has this problem solved and has the same api.

like image 39
Denis Beklarov Avatar answered Nov 05 '22 10:11

Denis Beklarov


If you run your project in release or profile the error probably won't exist:

flutter run -d chrome --profile
flutter run -d chrome --release

At the same time if you get your --debug app and open it in Safari (for example) the error won't exist (most probably). It seems like an issue with Chrome (again).

like image 34
Top4o Avatar answered Nov 05 '22 11:11

Top4o