13

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?

Flutterian
  • 1,761
  • 1
  • 21
  • 47

6 Answers6

15

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.

Florian V
  • 151
  • 1
  • 3
2

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).

Top4o
  • 547
  • 6
  • 19
1

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.

1

I resolved my running the following commands on the terminal

  • flutter clean
  • flutter pub get
  • flutter run I hope it resolves your issue
Okwesi
  • 21
  • 3
0

This is a bug in flutter and has been reported in this issue.

https://github.com/flutter/flutter/issues/77258

Think Big
  • 1,021
  • 14
  • 24
0

It got resolved after I did "flutter pub upgrade". All dependency errors got resolved after upgrading pub.

Flutterian
  • 1,761
  • 1
  • 21
  • 47