A stateful class that can paint a particular Decoration.
BoxPainter objects can cache resources so that they can be used multiple times.
Some resources used by BoxPainter may load asynchronously. When this happens, the onChanged callback will be invoked. To stop this callback from being called after the painter has been discarded, call dispose.
Constructors
- BoxPainter([VoidCallback _onChanged ])
-
Abstract const constructor. This constructor enables subclasses to provide const constructors so that they can be used in const expressions.
Properties
- onChanged → VoidCallback
-
Callback that is invoked if an asynchronously-loading resource used by the decoration finishes loading. For example, an image. When this is invoked, the
paint
method should be called again.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
-
dispose(
) → void -
Discard any resources being held by the object. This also guarantees that the onChanged callback will not be called again.
-
paint(
Canvas canvas, Offset offset, ImageConfiguration configuration) → void -
Paints the Decoration for which this object was created on the given canvas using the given configuration.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited -
toString(
) → String -
Returns a string representation of this object.
inherited