A description of a box decoration (a decoration applied to a Rect).

This class presents the abstract interface for all decorations. See BoxDecoration for a concrete example.

To actually paint a Decoration, use the createBoxPainter method to obtain a BoxPainter. Decoration objects can be shared between boxes; BoxPainter objects can cache resources to make painting on a particular surface faster.

Static Methods

lerp(Decoration begin, Decoration end, double t) Decoration

Linearly interpolates from begin to end.

Constructors

Decoration()

Abstract const constructor. This constructor enables subclasses to provide const constructors so that they can be used in const expressions.

const

Properties

isComplex bool

Whether this decoration is complex enough to benefit from caching its painting.

read-only
padding EdgeInsets

Returns the insets to apply when using this decoration on a box that has contents, so that the contents do not overlap the edges of the decoration. For example, if the decoration draws a frame around its edge, the padding would return the distance by which to inset the children so as to not overlap the frame.

read-only
hashCode int

Get a hash code for this object.

read-only, inherited
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) bool

The equality operator.

inherited

Methods

createBoxPainter([VoidCallback onChanged ]) BoxPainter

Returns a BoxPainter that will paint this decoration.

debugAssertIsValid() bool

In checked mode, throws an exception if the object is not in a valid configuration. Otherwise, returns true.

hitTest(Size size, Point position) bool

Tests whether the given point, on a rectangle of a given size, would be considered to hit the decoration or not. For example, if the decoration only draws a circle, this function might return true if the point was inside the circle and false otherwise.

lerpFrom(Decoration a, double t) Decoration

Linearly interpolates from a to this.

lerpTo(Decoration b, double t) Decoration

Linearly interpolates from this to b.

toString([String prefix = '', String indentPrefix ]) String

Returns a string representation of this object.

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited