ToggleablePainter class abstract

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.

If drawing a radial ink reaction is desired (in Material Design for example), subclasses may call paintRadialReaction in their paint method.

Inheritance
Implemented types

Constructors

ToggleablePainter()

Properties

activeColor Color
The color that should be used in the active state (i.e., when ToggleableStateMixin.value is true).
getter/setter pair
downPosition Offset?
The Offset within the Toggleable at which a pointer touched the Toggleable.
getter/setter pair
focusColor Color
The color that should be used for the reaction when isFocused is true.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
hoverColor Color
The color that should be used for the reaction when isHovered is true.
getter/setter pair
inactiveColor Color
The color that should be used in the inactive state (i.e., when ToggleableStateMixin.value is false).
getter/setter pair
inactiveReactionColor Color
The color that should be used for the reaction when the toggleable is inactive.
getter/setter pair
isActive bool
Determines whether the toggleable shows as active.
getter/setter pair
isFocused bool
True if this toggleable has the input focus.
getter/setter pair
isHovered bool
True if this toggleable is being hovered over by a pointer.
getter/setter pair
position Animation<double>
The visual value of the control.
getter/setter pair
reaction Animation<double>
The visual value of the radial reaction animation.
getter/setter pair
reactionColor Color
The color that should be used for the reaction when the toggleable is active.
getter/setter pair
reactionFocusFade Animation<double>
Controls the radial reaction's opacity animation for focus changes.
getter/setter pair
reactionHoverFade Animation<double>
Controls the radial reaction's opacity animation for hover changes.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticsBuilder SemanticsBuilderCallback?
Returns a function that builds semantic information for the picture drawn by this painter.
no setteroverride
splashRadius double
The splash radius for the radial reaction.
getter/setter pair

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 nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
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