supportsRasterization method

  1. @override
bool supportsRasterization()
override

Whether or not this layer, or any child layers, can be rasterized with Scene.toImage or Scene.toImageSync.

If false, calling the above methods may yield an image which is incomplete.

This value may change throughout the lifetime of the object, as the child layers themselves are added or removed.

Implementation

@override
bool supportsRasterization() {
  for (Layer? child = lastChild; child != null; child = child.previousSibling) {
    if (!child.supportsRasterization()) {
      return false;
    }
  }
  return true;
}