In the foundation of geometrical transformations, there is mathematics. In Flutter, transformations are represented in a 4D matrix. Besides methods such as matrix addition or multiplication, the Matrix4 class contains methods that help with the construction and manipulation of geometric transformations. Some of them are as follows:
- rotation: rotateX(), rotateY(), and rotateZ() are some examples of methods that rotate the matrix through a specific axis.
- scale: scale(), with some variants, is used to apply a scale on the matrix using double values of the corresponding axes (x, y, and z) or through vector representations with the Vector3 and Vector4 classes.
- translation: Just like before, we can translate the matrix using the translate() method with specific x, y, or z values and Vector3 and Vector4 instances.
- skew: This is used to skew the matrix around the X axis with skewX() or Y axis with skewY().
Check the Matrix4 official documentation to all of the available possibilities this class offers: https://api.flutter.dev/flutter/vector_math/Matrix4-class.html. Remember, it is the basis of the transformations applied with the Transform widget.