Marquee constructor
Marquee({
- Key? key,
- required String text,
- TextStyle? style,
- double? textScaleFactor,
- TextDirection textDirection = TextDirection.ltr,
- Axis scrollAxis = Axis.horizontal,
- CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
- double blankSpace = 0.0,
- double velocity = 50.0,
- Duration startAfter = Duration.zero,
- Duration pauseAfterRound = Duration.zero,
- bool showFadingOnlyWhenScrolling = true,
- double fadingEdgeStartFraction = 0.0,
- double fadingEdgeEndFraction = 0.0,
- int? numberOfRounds,
- double startPadding = 0.0,
- Duration accelerationDuration = Duration.zero,
- Curve accelerationCurve = Curves.decelerate,
- Duration decelerationDuration = Duration.zero,
- Curve decelerationCurve = Curves.decelerate,
- 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.",
),
accelerationCurve = IntegralCurve(accelerationCurve),
decelerationCurve = IntegralCurve(decelerationCurve);