Matrix4Transform class

Helper class for easily creating Matrix4 transformations, that you can use in Container's transform parameter, and elsewhere.

Example:

Container(
   transform:
     Matrix4Transform().rotateDegrees(45, origin: Offset(25, 25))
                       .translate(x: 25)
                       .toMatrix4(),
   child: ...
);
Annotations

Properties

hashCode int
The hash code for this object.
no setterinherited
m Matrix4
final
matrix4 Matrix4
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

direction(double directionRadians, double distance) Matrix4Transform
Translates by distance pixels to the direction. The direction is in radians clockwise from the positive x-axis.
directionDegrees(double directionDegrees, double distance) Matrix4Transform
Translates by distance pixels to the direction. The direction is in degrees (0 to 360 one turn) clockwise from the positive x-axis.
down(double distance) Matrix4Transform
Translates down by distance pixels.
downLeft(double distance) Matrix4Transform
Translates down and left by distance pixels.
downRight(double distance) Matrix4Transform
Translates down and right by distance pixels.
flipDiagonally({Offset? origin}) Matrix4Transform
flipHorizontally({Offset? origin}) Matrix4Transform
flipVertically({Offset? origin}) Matrix4Transform
left(double distance) Matrix4Transform
Translates up left distance pixels.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
Translates right by distance pixels.
rotate(double? angleRadians, {Offset? origin}) Matrix4Transform
Rotates by angleRadians radians, clockwise. If you define an origin it will have that point as the axis of rotation.
rotateByCenter(double angleRadians, Size size) Matrix4Transform
Rotates by angleRadians radians, clockwise. The axis of rotation will be the center of the object with the given size.
rotateByCenterDegrees(double angleDegrees, Size size) Matrix4Transform
Rotates by angleDegrees degrees (0 to 360 one turn), clockwise. The axis of rotation will be the center of the object with the given size.
rotateDegrees(double angleDegrees, {Offset? origin}) Matrix4Transform
Rotates by angleDegrees degrees (0 to 360 one turn), clockwise. If you define an origin it will have that point as the axis of rotation.
scale(double factor, {Offset? origin}) Matrix4Transform
Scales by factor, keeping the aspect ratio. Gets bigger for >1. Smaller for <1. Same size for 1 (and passing null is the same as passing 1). No size for 0. Passing null is the same as passing 1.
scaleBy({double? x = 1, double? y = 1, Offset? origin}) Matrix4Transform
Scales by a factor of x (horizontal) and y (vertical). Gets bigger for >1. Smaller for <1. Same size for 1 (and passing null is the same as passing 1). No size for 0.
scaleHorizontally(double factor, {Offset? origin}) Matrix4Transform
Scales by factor horizontally. Keeps the same vertical scale. Gets bigger for >1. Smaller for <1. Same size for 1 (and passing null is the same as passing 1). No size for 0.
scaleVertically(double factor, {Offset? origin}) Matrix4Transform
Scales by factor vertically. Keeps the same horizontal scale. Gets bigger for >1. Smaller for <1. Same size for 1 (and passing null is the same as passing 1). No size for 0.
toString() String
A string representation of this object.
inherited
translate({double? x = 0, double? y = 0}) Matrix4Transform
Translates by x pixels (horizontal) and y pixels (vertical). Positive goes down/right.
translateOffset(Offset? offset) Matrix4Transform
Translates by x pixels (horizontal) and y pixels (vertical). Positive goes down/right.
translateOriginalCoordinates({double? x = 0, double? y = 0}) Matrix4Transform
Translates by x pixels (horizontal) and y pixels (vertical), but in respect to the original coordinate system, before the translates/scales.
up(double distance) Matrix4Transform
Translates up by distance pixels.
upLeft(double distance) Matrix4Transform
Translates up and left distance pixels.
upRight(double distance) Matrix4Transform
Translates up and right by distance pixels of distance.

Operators

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