FloatingComboText class
Combo/score text ("+10", "Combo x3") that floats up and fades out in place, then removes itself — the FEAT-12 coin-fly widget flies to a target, this one just pops where it appears (cheap but effective "game-feel" juice).
Same self-cleaning usage convention as ToastBanner.show: call
FloatingComboText.show once, no ambient state to manage. The bare
widget itself owns the animation (unlike ToastBanner, where the static
helper owns it) so it can also be dropped straight into a tree and given
an onDone callback.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- FloatingComboText
Constructors
- FloatingComboText({Key? key, required String text, Color? color, double fontSize = 22, Duration duration = const Duration(milliseconds: 900), double riseDistance = 40, VoidCallback? onDone})
-
const
Properties
- color → Color?
-
Defaults to NeonTheme.gold — nullable because a
NeonThemecolor field is no longer a compile-time constant.final - duration → Duration
-
final
- fontSize → double
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onDone → VoidCallback?
-
Called once, when the rise+fade animation completes.
final
- riseDistance → double
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- text → String
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< FloatingComboText> -
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
Static Methods
-
show(
BuildContext context, {required String text, Color? color, double fontSize = 22, Duration duration = const Duration(milliseconds: 900), Alignment alignment = Alignment.center}) → void -
Inserts a self-removing FloatingComboText into
context's Overlay atalignment, and removes it again once the animation finishes — no leftover OverlayEntry orAnimationControllerto manage.