Flutter: Assertion failed error in ClipPath() widget

Viewed 1016

I'm getting this error.

Assertion failed: org-dartlang-sdk:///flutter_web_sdk/lib/_engine/engine/surface/path/path_ref.dart:831:12
isValid
is not true

The relevant error-causing widget was
    ClipPath

The dependency I'm using is: flutter_custom_clippers: ^1.1.1

Whenever I restart or do a hot refresh, UI builds properly but after few seconds I get this error in the debug console.

The following is my widget structure.

ClipPath(
      clipper: WaveClipperTwo(flip: true, reverse: true),
      child: Container(
        padding: EdgeInsets.all(10),
        width: double.infinity,
        height: 350,
        color: Colors.black87,
        child: ...
        )
);

How can I solve this error.

1 Answers

I don't know what actually happened, but I wrapped ClipPath() inside a container and gave it the height same as the Container inside it i.e. 350

Container{
height: 350,
child: ClipPath(
      clipper: WaveClipperTwo(flip: true, reverse: true),
      child: Container(
        padding: EdgeInsets.all(10),
        width: double.infinity,
        height: 350,
        color: Colors.black87,
        child: ...
        )
    ),
);

And then I didn't get any errors.

I still don't know what that error was about, if you know Feel free to tell me :)

Related