ToggleablePainter class Null safety
A base class for a CustomPainter that may be passed to ToggleableStateMixin.buildToggleable to draw the visual representation of a Toggleable.
Subclasses must implement the paint method to draw the actual visuals of the Toggleable. In their paint method subclasses may call paintRadialReaction to draw a radial ink reaction for this control.
- Inheritance
-
- Object
- ChangeNotifier
- ToggleablePainter
- Implemented types
Constructors
Properties
- activeColor ↔ Color
-
The color that should be used in the active state (i.e., when
ToggleableStateMixin.value is true).
read / write
- downPosition ↔ Offset?
-
The Offset within the Toggleable at which a pointer touched the Toggleable.
read / write
- focusColor ↔ Color
-
The color that should be used for the reaction when isFocused is true.
read / write
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- hasListeners → bool
- Whether any listeners are currently registered.
- hoverColor ↔ Color
-
The color that should be used for the reaction when isHovered is true.
read / write
- inactiveColor ↔ Color
-
The color that should be used in the inactive state (i.e., when
ToggleableStateMixin.value is false).
read / write
- inactiveReactionColor ↔ Color
-
The color that should be used for the reaction when the toggleable is
inactive.
read / write
- isFocused ↔ bool
-
True if this toggleable has the input focus.
read / write
- isHovered ↔ bool
-
True if this toggleable is being hovered over by a pointer.
read / write
-
position
↔ Animation<
double> -
The visual value of the control.
read / write
-
reaction
↔ Animation<
double> -
The visual value of the radial reaction animation.
read / write
- reactionColor ↔ Color
-
The color that should be used for the reaction when the toggleable is
active.
read / write
-
reactionFocusFade
↔ Animation<
double> -
Controls the radial reaction's opacity animation for focus changes.
read / write
-
reactionHoverFade
↔ Animation<
double> -
Controls the radial reaction's opacity animation for hover changes.
read / write
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- semanticsBuilder → SemanticsBuilderCallback?
-
Returns a function that builds semantic information for the picture drawn
by this painter.
read-onlyoverride
- splashRadius ↔ double
-
The splash radius for the radial reaction.
read / write
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
override
-
hitTest(
Offset position) → bool? -
Called whenever a hit test is being performed on an object that is using
this custom paint delegate.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
notifyListeners(
) → void - Call all the registered listeners.
-
paint(
Canvas canvas, Size size) → void -
Called whenever the object needs to paint. The given Canvas has its
coordinate space configured such that the origin is at the top left of the
box. The area of the box is the size of the
size
argument.inherited -
paintRadialReaction(
{required Canvas canvas, Offset offset = Offset.zero, required Offset origin}) → void - Used by subclasses to paint the radial ink reaction for this control.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
shouldRebuildSemantics(
covariant CustomPainter oldDelegate) → bool -
Called whenever a new instance of the custom painter delegate class is
provided to the RenderCustomPaint object, or any time that a new
CustomPaint object is created with a new instance of the custom painter
delegate class (which amounts to the same thing, because the latter is
implemented in terms of the former).
override
-
shouldRepaint(
covariant CustomPainter oldDelegate) → bool -
Called whenever a new instance of the custom painter delegate class is
provided to the RenderCustomPaint object, or any time that a new
CustomPaint object is created with a new instance of the custom painter
delegate class (which amounts to the same thing, because the latter is
implemented in terms of the former).
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited