Marquee class

A widget that repeats text and automatically scrolls it infinitely.

Sample code

This is a minimalistic example:

Marquee(
  text: 'There once was a boy who told this story about a boy: "',
)

And here's a piece of code that makes full use of the marquee's customizability:

Marquee(
  text: 'Some sample text that takes some space.',
  style: TextStyle(color: Colors.blue, fontWeight: FontWeight.bold),
  velocity: 100,
  blankSpace: 10,
  startPadding: 10,
  reverse: true,
  bounce: true,
  startAfter: const Duration(seconds: 2),
  pauseAfterRound: const Duration(seconds: 1),
  numberOfRounds: 5,
  showFadingOnlyWhenScrolling: false,
  fadingEdgeStartFraction: 0.05,
  fadingEdgeEndFraction: 0.05,
  curve: Curves.easeInOut,
)
Inheritance

Constructors

Marquee({Key key, @required String text, TextStyle style = const TextStyle(color: Colors.green), double velocity = 100, double blankSpace = 0, double startPadding = 0, bool reverse = false, bool bounce = false, Duration startAfter = Duration.zero, Duration pauseAfterRound = Duration.zero, int numberOfRounds, bool showFadingOnlyWhenScrolling = true, double fadingEdgeStartFraction = 0, double fadingEdgeEndFraction = 0, Curve curve = Curves.linear})

Properties

blankSpace double
The extend of blank space to display between instances of the text. [...]
final
bounce bool
Bounce the text back and fourth instead of scrolling it infinitely. [...]
final
fadingEdgeEndFraction double
The fraction of the Marquee that will be faded on the right or down. By default, there won't be any fading. [...]
final
fadingEdgeStartFraction double
The fraction of the Marquee that will be faded on the left or top. By default, there won't be any fading. [...]
final
hashCode int
The hash code for this object. [...]
@nonVirtual, read-only, inherited
key Key
Controls how one widget replaces another widget in the tree. [...]
final, inherited
numberOfRounds int
When the text scrolled around numberOfRounds times, it will stop scrolling null indicates there is no limit [...]
final
pauseAfterRound Duration
After each round, a pause of this duration occurs. [...]
final
reverse bool
Set as true to reverse the scroll direction. [...]
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
showFadingOnlyWhenScrolling bool
Whether the fading edge should only appear while the text is scrolling. [...]
final
startAfter Duration
Start scrolling after this duration after the widget is first displayed. [...]
final
startPadding double
A padding for the resting position. [...]
final
style TextStyle
The style of the text to be displayed. [...]
final
text String
The text to be displayed. [...]
final
velocity double
The scrolling velocity in logical pixels per second. The velocity must not be negative. reverse may be set to change the direction instead. [...]
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree. [...]
inherited
createState() → _MarqueeState
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. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
inherited
equals(Object other) bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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}) 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. [...]
@nonVirtual, inherited