void _paintBackgroundImage(Canvas canvas, Rect rect, ImageConfiguration configuration) { if (this._decoration.image == null) { return; } this._imagePainter = this._imagePainter ?? this._decoration.image.createPainter(this.onChanged); Path clipPath = null; switch (this._decoration.shape) { case BoxShape.circle: clipPath = new Path(); clipPath.addOval(rect); break; case BoxShape.rectangle: if (this._decoration.borderRadius != null) { clipPath = new Path(); clipPath.addRRect(this._decoration.borderRadius.toRRect(rect)); } break; } this._imagePainter.paint(canvas, rect, clipPath, configuration); }
void _paintImage(Canvas canvas, ImageConfiguration configuration) { if (this._decoration.image == null) { return; } this._imagePainter = this._imagePainter ?? this._decoration.image.createPainter(this.onChanged); this._imagePainter.paint(canvas, this._lastRect, this._innerPath, configuration); }
void _paintImage(Canvas canvas, ImageConfiguration configuration) { if (_decoration.image == null) { return; } _imagePainter = _imagePainter ?? _decoration.image.createPainter(onChanged); _imagePainter.paint(canvas, _lastRect, _innerPath, configuration); }