motion_number 0.1.0
motion_number: ^0.1.0 copied to clipboard
Direction-aware animated numbers for Flutter. Digits roll independently in seven styles - rolling, odometer, flip, slot machine, wave, shuffle, elastic - plus percentage deltas.
Changelog #
0.1.0 #
Initial development release. The public API is not stable yet; treat every
0.x bump as potentially breaking.
Widgets #
MotionNumber— a number whose digits animate independently when its value changes. Slots are right-anchored, so999 → 1000animates one new digit in rather than churning four, and separators animate rather than snap.MotionDelta— a direction-aware percentage or absolute delta, reading the nearestMotionNumber's transition from an inherited scope or from an explicittransition:.MotionNumberScope— theInheritedNotifierthe two communicate through.
Motion #
- Seven styles:
rolling,odometer,slotMachine,flip,wave,shuffle,elastic. DigitMotionis the open strategy contract behind them — passmotion:to supply your own without touching the widget layer.
Formatting #
PlainFormatter,IntlFormatter(anyintlNumberFormat, includingen_INlakh/crore grouping) andCompactFormatter(1.2M/12.4L).NumberTextFormatteris the extension point for anything else.
Theming and accessibility #
MotionNumberThemeas aThemeExtension, plusDirectionColorswithgreenUp()andredUp()presets.- The formatted value is announced to screen readers; the
0–9strips are excluded from semantics. MediaQuery.disableAnimationsOfshort-circuits every slot to its final position on the first frame.
