TextScroll class Null safety
TextScroll widget automatically scrolls provided text according to custom settings, in order to achieve 'marquee' text effect.
Example:
TextScroll(
'This is the sample text for Flutter TextScroll widget. ',
mode: TextScrollMode.bouncing,
velocity: Velocity(pixelsPerSecond: Offset(150, 0)),
delayBefore: Duration(milliseconds: 500),
numberOfReps: 5,
pauseBetween: Duration(milliseconds: 50),
style: TextStyle(color: Colors.green),
textAlign: TextAlign.right,
selectable: true,
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- TextScroll
Constructors
- TextScroll(String text, {Key? key, TextStyle? style, TextAlign? textAlign, TextDirection textDirection = TextDirection.ltr, int? numberOfReps, Duration? delayBefore, Duration? pauseBetween, Duration? pauseOnBounce, TextScrollMode mode = TextScrollMode.endless, Velocity velocity = const Velocity(pixelsPerSecond: Offset(80, 0)), bool selectable = false, int? intervalSpaces, bool fadedBorder = false, double? fadedBorderWidth = 0.2, FadeBorderSide fadeBorderSide = FadeBorderSide.both, FadeBorderVisibility fadeBorderVisibility = FadeBorderVisibility.auto})
-
const
Properties
- delayBefore → Duration?
-
Delay before first animation round.
final
- fadeBorderSide → FadeBorderSide
-
Sets which side of the widget should be faded.
Default is FadeBorderSide.both.
final
- fadeBorderVisibility → FadeBorderVisibility
-
Sets when the fadeBorder should be shown.
Default is
FadeBorderSide.auto
.final - fadedBorder → bool
-
Fades the text out to the left and right edges of the widget.
Default is
false
.final - fadedBorderWidth → double?
-
Sets width of the faded border.
Default is
0.2
.final - hashCode → int
-
The hash code for this object.
read-onlyinherited
- intervalSpaces → int?
-
Adds blank spaces between two nearby text sentences
in case of TextScrollMode.endless
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- mode → TextScrollMode
-
Sets one of two different types of scrolling behavior.
final
- numberOfReps → int?
-
Limits number of scroll animation rounds.
final
- pauseBetween → Duration?
-
Determines pause interval between animation rounds.
final
- pauseOnBounce → Duration?
-
Determines pause interval before changing direction on a bounce.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- selectable → bool
-
Allows users to select provided text, copy it to clipboard etc.
final
- style → TextStyle?
-
Allows to apply custom TextStyle to text.
final
- text → String
-
The text string, that would be scrolled.
In case text does fit into allocated space, it wouldn't be scrolled
and would be shown as is.
final
- textAlign → TextAlign?
-
Provides TextAlign alignment if text string is not long enough to be scrolled.
final
- textDirection → TextDirection
-
Provides TextDirection - a direction in which text flows.
Default is TextDirection.ltr.
Default scrolling direction would be opposite to textDirection,
e.g. for TextDirection.rtl scrolling would be from left to right
final
- velocity → Velocity
-
Allows to customize animation speed.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< TextScroll> -
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 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.
inherited