Marquee constructor

Marquee({
  1. Key? key,
  2. required String text,
  3. TextStyle? style,
  4. double? textScaleFactor,
  5. TextDirection textDirection = TextDirection.ltr,
  6. Axis scrollAxis = Axis.horizontal,
  7. CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
  8. double blankSpace = 0.0,
  9. double velocity = 50.0,
  10. Duration startAfter = Duration.zero,
  11. Duration pauseAfterRound = Duration.zero,
  12. bool showFadingOnlyWhenScrolling = true,
  13. double fadingEdgeStartFraction = 0.0,
  14. double fadingEdgeEndFraction = 0.0,
  15. int? numberOfRounds,
  16. double startPadding = 0.0,
  17. Duration accelerationDuration = Duration.zero,
  18. Curve accelerationCurve = Curves.decelerate,
  19. Duration decelerationDuration = Duration.zero,
  20. Curve decelerationCurve = Curves.decelerate,
  21. VoidCallback? onDone,
})

Implementation

Marquee({
  super.key,
  required this.text,
  this.style,
  this.textScaleFactor,
  this.textDirection = TextDirection.ltr,
  this.scrollAxis = Axis.horizontal,
  this.crossAxisAlignment = CrossAxisAlignment.center,
  this.blankSpace = 0.0,
  this.velocity = 50.0,
  this.startAfter = Duration.zero,
  this.pauseAfterRound = Duration.zero,
  this.showFadingOnlyWhenScrolling = true,
  this.fadingEdgeStartFraction = 0.0,
  this.fadingEdgeEndFraction = 0.0,
  this.numberOfRounds,
  this.startPadding = 0.0,
  this.accelerationDuration = Duration.zero,
  Curve accelerationCurve = Curves.decelerate,
  this.decelerationDuration = Duration.zero,
  Curve decelerationCurve = Curves.decelerate,
  this.onDone,
})  : assert(!blankSpace.isNaN),
      assert(blankSpace >= 0, "The blankSpace needs to be positive or zero."),
      assert(blankSpace.isFinite),
      assert(!velocity.isNaN),
      assert(velocity != 0.0, "The velocity cannot be zero."),
      assert(velocity.isFinite),
      assert(
        pauseAfterRound >= Duration.zero,
        "The pauseAfterRound cannot be negative as time travel isn't "
        "invented yet.",
      ),
      assert(
        fadingEdgeStartFraction >= 0 && fadingEdgeStartFraction <= 1,
        "The fadingEdgeGradientFractionOnStart value should be between 0 and "
        "1, inclusive",
      ),
      assert(
        fadingEdgeEndFraction >= 0 && fadingEdgeEndFraction <= 1,
        "The fadingEdgeGradientFractionOnEnd value should be between 0 and "
        "1, inclusive",
      ),
      assert(numberOfRounds == null || numberOfRounds > 0),
      assert(
        accelerationDuration >= Duration.zero,
        "The accelerationDuration cannot be negative as time travel isn't "
        "invented yet.",
      ),
      assert(
        decelerationDuration >= Duration.zero,
        "The decelerationDuration must be positive or zero as time travel "
        "isn't invented yet.",
      ),
      this.accelerationCurve = _IntegralCurve(accelerationCurve),
      this.decelerationCurve = _IntegralCurve(decelerationCurve);