drawVertices method Null safety

void drawVertices(
  1. Vertices vertices,
  2. BlendMode blendMode,
  3. Paint paint
)

Draws the set of Vertices onto the canvas.

The blendMode parameter is used to control how the colors in the vertices are combined with the colors in the paint. If there are no colors specified in vertices then the blendMode has no effect. If there are colors in the vertices, then the color taken from the Shader or Color in the paint is blended with the colors specified in the vertices using the blendMode parameter. For purposes of this blending, the colors from the paint are considered the source and the colors from the vertices are considered the destination.

All parameters must not be null.

See also:

  • new Vertices, which creates a set of vertices to draw on the canvas.
  • Vertices.raw, which creates the vertices using typed data lists rather than unencoded lists.
  • paint, Image shaders can be used to draw images on a triangular mesh.

Implementation

void drawVertices(Vertices vertices, BlendMode blendMode, Paint paint) {

  assert(vertices != null); // vertices is checked on the engine side
  assert(paint != null);
  assert(blendMode != null);
  _drawVertices(vertices, blendMode.index, paint._objects, paint._data);
}