NibTypewriter class
Reveals text character by character at speed, with an optional blinking cursor.
This is the one widget in the text-animation system that legitimately
uses setState: the number of revealed characters is a discrete,
content-level value (not a per-frame paint value driven by a
MotionValue), advanced by a Timer.periodic — exactly the case the
package's zero-setState rule carves out an exception for. There is no
continuous animation here to drive through MotionValue/RenderProxyBox.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- NibTypewriter
- Available extensions
Constructors
- NibTypewriter(String text, {Key? key, Duration speed = const Duration(milliseconds: 50), String? cursor = '|', Duration cursorBlinkInterval = const Duration(milliseconds: 530), TextStyle? style, VoidCallback? onComplete, bool repeat = false, Duration? deleteSpeed, Duration delay = Duration.zero})
-
Creates a typewriter effect that reveals
textover time.const
Properties
- cursor → String?
-
The cursor string appended while typing (and, if repeat, while
deleting).
nulldisables the cursor entirely.final - cursorBlinkInterval → Duration
-
How fast the cursor blinks once typing has paused (after completing, or
before delay has elapsed). Ignored if cursor is
null.final - delay → Duration
-
How long to wait before typing starts.
final
- deleteSpeed → Duration?
-
How fast characters are deleted during a repeat cycle. Defaults to
speed if
null.final - hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onComplete → VoidCallback?
-
Called once, when the full text has been revealed. Not called again
on subsequent repeat cycles.
final
- repeat → bool
-
If
true, after fully typing text the widget deletes it (at deleteSpeed) and types it again, forever.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- speed → Duration
-
How long each newly revealed character stays before the next one
appears.
final
- style → TextStyle?
-
The text style applied to the revealed text and cursor.
final
- text → String
-
The full text to reveal.
final
Methods
-
animate(
{Object? initial, Object? animate, NibAnim? exit, NibTransition? transition, NibAnim? whileTap, NibAnim? whileHover, Key? key}) → Widget -
Available on Widget, provided by the NibMotionWidgetExtension extension
Wraps this widget in a NibMotion. -
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< NibTypewriter> -
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
-
revealOnScroll(
{NibAnim? initial, bool once = true}) → Widget -
Available on Widget, provided by the NibMotionWidgetExtension extension
Wraps this widget in a NibScrollReveal. -
shimmer(
{bool enabled = true}) → Widget -
Available on Widget, provided by the NibMotionWidgetExtension extension
Wraps this widget in a NibShimmer. -
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