I’ve found the answer and just made this package (to do all kinds of transformations, not only rotate by the center.
1 2 3 4 5 6 7 8 9 10 11 12 | var height = 30; var width = 30; AnimatedContainer( color: Colors.red, width: width, height: height, transform: Matrix4Transform() .rotateDegrees(180, origin: Offset(width/2, height/2)) .matrix4, ); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.