Motion class final
A transform painted over the node's layout (Flutter's Transform): it
moves nothing else. Its values are the node's rest pose; how it gets
there is the node's animations and transitions.
One matrix, outermost first: a translation (the path's offset, then
translateX/translateY in pixels, then shiftX/shiftY times the
node's size, FractionalTranslation), then about alignment: the scale
(scale times scaleX/scaleY), the rotation rotate (degrees, about
z, plus the path's turn), then rotateX and rotateY (3D, seen with
perspective). JSON (sparse): {"translateY": -4, "scale": 1.02, "alignment": [0, 1]}.
- Annotations
-
- @immutable
Constructors
- Motion({double translateX = 0, double translateY = 0, double translateZ = 0, double shiftX = 0, double shiftY = 0, double scale = 1, double scaleX = 1, double scaleY = 1, double rotate = 0, double rotateX = 0, double rotateY = 0, double perspective = 1, Alignment alignment = Alignment.center, bool backfaceHidden = false, PathFollow? path})
-
const
Properties
- alignment → Alignment
-
The point the scale and rotations are about (
Transform.alignment):[x, y], −1…1, the center[0, 0].final - backfaceHidden → bool
-
Not painted while its back faces the viewer (through every transform
above it too).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasPath → bool
-
no setter
- hasTransform → bool
-
Whether it draws the node anywhere but where it's laid out.
no setter
- path → PathFollow?
-
A path the node sits on, at its progress; turned with it as it says.
final
- perspective → double
-
Degrees. rotate turns about z (
Transform.rotate); rotateX and rotateY turn in 3D, seen with perspective (0 flat).final -
props
→ List<
Object?> -
no setter
- rotate → double
-
Degrees. rotate turns about z (
Transform.rotate); rotateX and rotateY turn in 3D, seen with perspective (0 flat).final - rotateX → double
-
Degrees. rotate turns about z (
Transform.rotate); rotateX and rotateY turn in 3D, seen with perspective (0 flat).final - rotateY → double
-
Degrees. rotate turns about z (
Transform.rotate); rotateX and rotateY turn in 3D, seen with perspective (0 flat).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scale → double
-
Transform.scale(scale:, scaleX:, scaleY:): the axis factors multiply scale.final - scaleX → double
-
Transform.scale(scale:, scaleX:, scaleY:): the axis factors multiply scale.final - scaleY → double
-
Transform.scale(scale:, scaleX:, scaleY:): the axis factors multiply scale.final - shiftX → double
-
Multiples of the node's own size (
FractionalTranslation).final - shiftY → double
-
Multiples of the node's own size (
FractionalTranslation).final - translateX → double
-
Pixels (
Transform.translate(offset:)).final - translateY → double
-
Pixels (
Transform.translate(offset:)).final - translateZ → double
-
Pixels toward the viewer (positive) or away (negative), in 3D: seen
smaller or larger only with a perspective (the node's own, or a page
view's camera); applied before the scale and rotations, as the other
translations are.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Json -
toString(
) → String -
A string representation of this object.
inherited
-
valueOf(
String property) → double -
The value of
property(one of properties); the value at rest for any other. -
withValue(
String property, double value) → Motion -
This motion with
property(one of properties) set tovalue.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromJson(
Object? json) → Motion? -
lerp(
Motion a, Motion b, double t) → Motion -
atobatt, number by number (settings areb's). -
restOf(
String property) → double -
propertyat rest: 1 for the scales (and the perspective), else 0. -
uprightAngle(
double radians) → double -
A path direction
radiansfolded into −90…90 degrees (PathFollow.uprightAngle).
Constants
- none → const Motion
-
properties
→ const List<
String> -
The number properties an animation track or a transition drives, as
paths under
motion.(motion.rotate,motion.path.progress).