DrawableRoot class
The root element of a drawable.
- Implemented types
Constructors
-
DrawableRoot(String? id, DrawableViewport viewport, List<
Drawable> children, DrawableDefinitionServer definitions, DrawableStyle? style, {Float64List? transform, Color? color}) -
Creates a new DrawableRoot.
const
Properties
-
children
→ List<
Drawable> -
The child
Drawables
of this DrawableParent.final - color → Color?
-
The default color used to provide a potential indirect color value
for the
fill
,stroke
andstop-color
of descendant elements.final - definitions → DrawableDefinitionServer
-
Contains reusable definitions such as gradients and clipPaths.
final
- hasDrawableContent → bool
-
Whether this Drawable would be visible if drawn.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String?
-
A string that should uniquely identify this Drawable within its DrawableRoot.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- style → DrawableStyle?
-
The DrawableStyle for inheritence.
final
- transform → Float64List?
-
The 4x4 transform to apply to this Drawable, if any.
final
- viewport → DrawableViewport
-
The expected coordinates used by child paths for drawing.
final
Methods
-
clipCanvasToViewBox(
Canvas canvas) → void -
Clips the canvas to a rect corresponding to the
viewBox
. -
draw(
Canvas canvas, Rect bounds) → void -
Draws the contents or children of this Drawable to the
canvas
, using theparentPaint
to optionally override the child's paint.override -
mergeStyle(
DrawableStyle newStyle) → DrawableRoot -
Creates an instance with merged style information.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
scaleCanvasToViewBox(
Canvas canvas, Size desiredSize) → void -
Scales the
canvas
so that the drawing units in this Drawable will scale to thedesiredSize
. -
toPicture(
{Size? size, bool clipToViewBox = true, ColorFilter? colorFilter}) → Picture - Creates a Picture from this DrawableRoot.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited