BeuiNumberTicker class
A slot-machine number — the Flutter port of beUI's number-ticker.
Each digit is its own column holding the glyphs 0–9 stacked vertically and
clipped to one digit's height; the column rolls vertically to the target
digit like an odometer. The clip/slot mechanic mirrors
lib/src/motion/text_cascade.dart.
The roll rides an beuiEaseOut curve over duration (source
default 0.9s), driven through motor — matching the source's
transition: { duration, ease: EASE_OUT } exactly, not a spring overshoot
(an odometer must never bounce past its number). Every column starts at 0
(the source's initial: y 0) and holds there until the ticker arms: on
mount, or — with startOnView (the source default) — once 60% of the
widget is visible in the nearest enclosing scrollable. On arming the digits
roll in staggered left-to-right by stagger; once that reveal has played,
live value changes roll every digit immediately (a per-digit delay on live
updates reads as lag — the source's entered gate).
With blur true, each roll carries a fixed-window blur — blur(10px) → blur(0) over min(duration × 0.75, 320ms), the source's transition — so
the sharpening is time-based, not tied to how far the column happens to
travel.
Reduced motion snaps every digit straight to its target with no roll or blur.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- BeuiNumberTicker
Constructors
- BeuiNumberTicker({required num value, int? pad, Duration duration = const Duration(milliseconds: 900), Duration stagger = const Duration(milliseconds: 40), String? prefix, String? suffix, bool blur = false, bool locale = false, bool startOnView = true, String format(int value)?, TextStyle? style, Key? key})
-
Creates a number ticker. Changing
valuerolls the affected digits.const
Properties
- blur → bool
-
Add a small blur during digit rolls (source
blur).final - duration → Duration
-
Per-digit roll duration (source
duration, default0.9s).final - format → String Function(int value)?
-
Custom formatter. Takes precedence over locale. Receives the rounded int.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- locale → bool
-
Insert locale group separators (thousands commas).
final
- pad → int?
-
Left-pad the formatted digits to this width with leading zeros.
final
- prefix → String?
-
Optional leading text (e.g. a currency symbol). Not animated.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stagger → Duration
-
Entrance stagger between digits (source
stagger, default0.04s).final - startOnView → bool
-
Hold the entrance until 60% of the ticker is visible in the nearest
enclosing scrollable (source
startOnView, default true;amount: 0.6, once only). Without an enclosing scrollable the ticker counts as visible and arms on the first layout.final - style → TextStyle?
-
Text style. Falls back to the ambient DefaultTextStyle.
final
- suffix → String?
-
Optional trailing text. Not animated.
final
- value → num
-
The current value. Rounded to the nearest integer before display.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< BeuiNumberTicker> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited