image property Null safety

Image? image

The image to display.

Implementation

ui.Image? get image => _image;
void image=(Image? value)

Implementation

set image(ui.Image? value) {
  if (value == _image) {
    return;
  }
  // If we get a clone of our image, it's the same underlying native data -
  // dispose of the new clone and return early.
  if (value != null && _image != null && value.isCloneOf(_image!)) {
    value.dispose();
    return;
  }
  _image?.dispose();
  _image = value;
  markNeedsPaint();
  if (_width == null || _height == null) {
    markNeedsLayout();
  }
}