stroke_morph 0.1.0 copy "stroke_morph: ^0.1.0" to clipboard
stroke_morph: ^0.1.0 copied to clipboard

Universal morphing for stroke-based icons with spring physics — any icon morphs into any other, with rotations that emerge from the math.

Changelog #

0.1.0 #

First release. An unofficial Dart/Flutter port of morphicons by Guillermo.

  • Any stroke icon morphs into any other. Rotations, scalings and folds are not authored — they fall out of a closed-form Procrustes alignment between the two point clouds.
  • MorphIcon with three modes: uncontrolled (icon), controlled (from/to/progress), and imperative (via GlobalKey<MorphIconState>).
  • MorphController for driving a morph yourself, with morphTo / set / seek / progress. Interruptible: re-targeting mid-flight re-plans from the shape on screen and carries the spring's velocity across.
  • Spring physics with three presets (smooth, snappy, bouncy), plus stiffness / damping overrides.
  • duration — say how long a morph should take instead of how stiff it should be. The duration sets the speed while the damping ratio keeps the character, so a bouncy 900 ms morph still overshoots. Not part of the reference implementation; additive, and the parity suite is unaffected. Duration.zero disables the animation.
  • Reduced motion honoured automatically via MediaQuery.disableAnimationsOf.
  • Off-grid icon packs supported through fitIcon; raw SVG through SvgIcon.
  • Zero dependencies beyond Flutter itself.

Pinned by 193 tests, including a cross-language parity suite that asserts this implementation agrees with the TypeScript reference byte for byte — plan fields, interpolated frames at t = 0 / 0.25 / 0.5 / 0.75 / 1 / 1.15, and serialized output, over 28 icons and 26 pairs.

Pre-1.0 because the port has not yet been reviewed on a physical device.

0
likes
150
points
25
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Universal morphing for stroke-based icons with spring physics — any icon morphs into any other, with rotations that emerge from the math.

Repository (GitHub)
View/report issues

Topics

#icons #animation #morphing #svg

License

unknown (license)

Dependencies

flutter

More

Packages that depend on stroke_morph