TickerText constructor

const TickerText({
  1. Key? key,
  2. required Widget child,
  3. Axis scrollDirection = Axis.horizontal,
  4. Duration returnDuration = const Duration(milliseconds: 800),
  5. Duration startPauseDuration = const Duration(seconds: 10),
  6. Duration? endPauseDuration,
  7. int speed = 20,
  8. TickerTextController? controller,
  9. Curve primaryCurve = Curves.linear,
  10. 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);