createPainter method Null safety

DecorationImagePainter createPainter(
  1. VoidCallback onChanged
)

Creates a DecorationImagePainter for this DecorationImage.

The onChanged argument must not be null. It will be called whenever the image needs to be repainted, e.g. because it is loading incrementally or because it is animated.

Implementation

DecorationImagePainter createPainter(VoidCallback onChanged) {
  assert(onChanged != null);
  return DecorationImagePainter._(this, onChanged);
}