drawRect method Null safety

void drawRect(
  1. Rect rect,
  2. Paint paint
)

Draws a rectangle with the given Paint. Whether the rectangle is filled or stroked (or both) is controlled by Paint.style.

Implementation

void drawRect(Rect rect, Paint paint) {
  assert(_rectIsValid(rect));
  assert(paint != null);
  _drawRect(rect.left, rect.top, rect.right, rect.bottom,
            paint._objects, paint._data);
}