PlAnimateRotate class

Content turning about a point.

const PlAnimateRotate(
  from: 0,
  to: 360,
  duration: Duration(milliseconds: 2400),
  curve: Curves.linear,
  repeat: null,
  fade: false,
  child: PlIcon(icon: RefreshGlyph()),
)

Two angles rather than one, which is what lets this be both effects a rotation is ever used for. from alone is an arrival — something swinging into place and stopping. from and to together with a null repeat and a linear curve is a spin that never lands, which is what a badge, a loading mark or a decorative glyph wants.

Rotation is the one movement the design language allows on a glyph without argument — a chevron is turned rather than redrawn all over the package. What it is not for is text: a rotated word is resampled along its whole length, which is precisely what the rule against transforming a control exists to prevent.

Both angles are degrees, not radians. The framework counts in radians and the design language counts in degrees — every gradient in the package is at 135° — so the conversion happens here, once, rather than at every call site.

Inheritance

Constructors

PlAnimateRotate({required Widget child, PlassAnimateMode mode = PlassAnimateMode.enter, double from = -180, double to = 0, Alignment origin = Alignment.center, bool fade = true, Duration duration = const Duration(milliseconds: 440), Duration delay = Duration.zero, Curve? curve, int? repeat = 1, bool alternate = false, bool paused = false, PlassAnimateTrigger trigger = PlassAnimateTrigger.mount, bool play = false, bool once = true, double threshold = defaultVisibleThreshold, Key? key})
Creates a rotation.
const

Properties

alternate bool
Runs every other pass backwards, so a repeat returns instead of jumping.
final
child Widget
What turns.
final
curve Curve?
The easing curve. The house curve when nothing says otherwise.
final
delay Duration
How long before it starts. Counted once, before the first run.
final
duration Duration
How long one run takes.
final
fade bool
Fades in as it turns.
final
from double
The angle it starts at, in degrees. Negative is anticlockwise.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
mode PlassAnimateMode
Whether the content turns into place or out of it.
final
once bool
With PlassAnimateTrigger.visible, whether it runs only the first time.
final
origin Alignment
Which point it turns about.
final
paused bool
Holds the animation where it is.
final
play bool
Runs it, when trigger is PlassAnimateTrigger.manual. Each falsetrue starts it over.
final
repeat int?
How many times it runs. null never stops.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
threshold double
With PlassAnimateTrigger.visible, how much of the widget has to be on screen before it counts as visible, from 0 to 1.
final
to double
The angle it ends at, in degrees.
final
trigger PlassAnimateTrigger
What starts it.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited