Skip to content
pubscout

matrix4_transform

4.1.0, released yesterday by glasberg.dev

Helper math class for easily creating Matrix4 transformations.

WASM-readyRock solid
$ flutter pub add matrix4_transform
Source repository

What it does

Provides an immutable helper class to chain transformations like rotation, scaling, and translation for creating Matrix4 objects. It also includes a tween for animations and works with widgets that accept transformation parameters.

AI-written summary of version 4.0.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to apply complex or chained transformations to a Container or Transform widget
  • You want to animate transformations using Matrix4TransformTween

Skip it when

  • You are working with raw Matrix4 math performance-critical operations without chaining needs
  • You need non-UI math utilities unrelated to Flutter transformations

Strengths

  • Immutable API makes creating and chaining transformations straightforward
  • Includes a specific Tween for animations
  • Simplifies rotation and translation combinations compared to raw Matrix4 math

Weaknesses

  • Matrix4Tween may not animate linearly as expected in all intermediate steps
  • Limited to matrix transformation helpers

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
Container(
   transform:
     Matrix4Transform()
       .rotateDegrees(45, origin: Offset(25, 25))
       .translate(x: 25)
       .matrix4,
   child: ...
);

Alternatives

Packages that do the same job and could replace matrix4_transform.

Works with

Packages commonly used together with matrix4_transform: ones it builds on, ones built on it, and its own family.