TickerText constructor
const
TickerText({
- Key? key,
- required Widget child,
- Axis scrollDirection = Axis.horizontal,
- Duration returnDuration = const Duration(milliseconds: 800),
- Duration startPauseDuration = const Duration(seconds: 10),
- Duration? endPauseDuration,
- int speed = 20,
- TickerTextController? controller,
- Curve primaryCurve = Curves.linear,
- Curve returnCurve = Curves.easeOut,
Creates a widget that scrolls to reveal child contents if it overflows, and scrolls back up when it reaches the end. Optionally accepts a TickerTextController to control scroll behavior.
Example:
TickerText(
scrollDirection: Axis.horizontal,
speed: 20,
startPauseDuration: const Duration(milliseconds: 500),
endPauseDuration: const Duration(seconds: 2),
child: Text("Very long paragraph of text...")
);
Implementation
const TickerText({
Key? key,
required this.child,
this.scrollDirection = Axis.horizontal,
this.returnDuration = const Duration(milliseconds: 800),
this.startPauseDuration = const Duration(seconds: 10),
this.endPauseDuration,
this.speed = 20,
this.controller,
this.primaryCurve = Curves.linear,
this.returnCurve = Curves.easeOut,
}) : assert(speed > 0, "Speed has to be greater than zero"),
super(key: key);