RenderingContext class abstract
Base type for canvas rendering contexts.
Returned by HTMLCanvasElement.getContext. Cast to the specific context type (e.g., CanvasRenderingContext2D) based on the CanvasContextType you requested.
final ctx = canvas.getContext(CanvasContextType.canvas2d)
as CanvasRenderingContext2D;
ctx.fillRect(0, 0, 100, 100);
Constructors
Properties
- canvas → HTMLCanvasElement
-
The canvas element this context draws on.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited