countman 0.2.2
countman: ^0.2.2 copied to clipboard
High-performance counter, countdown & stopwatch animations for Flutter. One shared vsync ticker drives every instance — no per-widget timers, built for high concurrency.
Changelog #
0.2.2 #
Docs only — no code changes.
Fixed #
- README (EN/ZH) demo link/badge now points to the package-specific demo
path (
/countman/) instead of the shared monorepo landing page.
0.2.1 #
Docs only — no code changes.
Fixed #
- README screenshots and cross-links (EN/ZH) now use absolute URLs so they
render on pub.flutter-io.cn. Relative paths broke because the package lives in a
monorepo subdirectory (
countman/), which pub.flutter-io.cn resolves against the repo root.
0.2.0 #
Counter transition redesign + internal consolidation.
Changed (breaking) #
AnimatedCounter/AnimatedCounterBuilder:transitionType(CounterTransitionType) →transition(CounterTransition) — a composable look built from aCounterMotion(none/slide/rotate/flip) plusscale/fade/blurmodifiers, with presets.slide(default),.slideScale,.slideBlur,.rotate,.flip,.flipFade.- Removed the
AnimatedCounter.usd/.cny/.inrcurrency factory constructors — composeprefix+groupingPattern([3]/[4]/[3, 2]) directly instead. OdometerCounteris now a thinAnimatedCounterdelegate (aStatelessWidgetreusing the shared painter).bounceElasticityis retained for source compatibility but no longer has an effect — bounce is driven bybounceOvershoot.
Added #
- Leading-zero-at-rest fade-in: hidden leading zeros fade in/out by the live
cumulative place value instead of popping (e.g.
1000 → 7collapses to7). - Per-column bounce wave that follows a staggered roll.
Internal #
- Odometer trajectory + end-of-roll ghost-prevention math extracted into one
shared
resolveDigitPhaseused by both the painter and widget-tree paths; the paint/build hot paths stay allocation-free via a reusedDigitPhase. - The default (
slide/none) paint path skips a redundant canvas save/restore pair. - Default-plugin registration unified on first task (
LazyDefault+enqueueself-register), with a central reset onCountman.destroy(). CountmanTask.reanchor()replaces ad-hocstartedtoggling for retarget / resume / reset.
0.1.0 #
Initial release.
A high-performance counter / countdown / elapsed animation library for Flutter.
One shared scheduleFrameCallback ticker drives every instance — adding the
hundredth counter costs the same as the first.
Engines #
Counter(value interpolation),Countdown(wall-clock deadline, interval- gated),Elapsed(open-ended stopwatch). Top-levelcounter()/countdown()/elapsed(), shareddefaultCounter/defaultCountdown/defaultElapsedand precise (interval: 0)defaultCountdownMs/defaultElapsedMs.
Widgets #
- Counter:
TextCounter,RingCounter,BarCounter,OdometerCounter,AnimatedCounter(+.usd/.cny/.inr),AnimatedCounterBuilder,CounterBuilder. - Countdown:
TextCountdown,RingCountdown,BarCountdown,DialCountdown,CardCountdown,CountdownBuilder. - Elapsed:
TextElapsed,ElapsedBuilder.
Features #
- Per-widget
*Styleobjects (colors, gradients,decoration+padding, ringsweepAnglegauge /startAngle/showTrack/ leading thumb dot, barvertical/showTrack);painterBuilderescape hatch on ring/bar/dial. - Imperative controllers:
CounterValueController,AnimatedCounterController,CountdownController,ElapsedController(pause / resume / reset / status). - Providers:
CounterProvider,CountdownProvider,ElapsedProvider, aggregateCountmanProvider, andCardCountdownProvider(shared glyph cache). precise: truesub-second updates;onTick(TimeParts);threshold+onThreshold; full lifecycle callbacks;animateOnce(play once per key).- Formatters
CountdownFormat.{hms, ms, msTenths, msMillis, dhms, dhm, auto}. StartScheduler(batch grid startup across frames); injectablecountdownClockfor testing / server-time alignment.
Zero third-party runtime dependencies.