JMarquee constructor
JMarquee({
- Key? key,
- required StatelessWidget child,
- required double maxHeight,
- double? maxWidth,
- ScrollDirection scrollDirection = ScrollDirection.forward,
- Axis scrollAxis = Axis.horizontal,
- double blankSpace = 0.0,
- double velocity = 50.0,
- Duration startAfter = Duration.zero,
- Duration pauseAfterRound = Duration.zero,
- int? numberOfRounds,
- double startPadding = 0.0,
- Duration accelerationDuration = Duration.zero,
- Curve accelerationCurve = Curves.linear,
- VoidCallback? onDone,
Implementation
JMarquee({
super.key,
required this.child,
required this.maxHeight,
double? maxWidth,
this.scrollDirection = ScrollDirection.forward,
this.scrollAxis = Axis.horizontal,
this.blankSpace = 0.0,
this.velocity = 50.0,
this.startAfter = Duration.zero,
this.pauseAfterRound = Duration.zero,
this.numberOfRounds,
this.startPadding = 0.0,
this.accelerationDuration = Duration.zero,
Curve accelerationCurve = Curves.linear,
this.onDone,
}) : maxWidth = maxWidth ?? PlatformQuery.width,
assert(!blankSpace.isNaN),
assert(blankSpace >= 0, "The blankSpace needs to be positive or zero."),
assert(blankSpace.isFinite),
assert(!velocity.isNaN),
assert(velocity > 49.0, "The velocity cannot be less then 50."),
assert(velocity.isFinite),
assert(
pauseAfterRound >= Duration.zero,
"The pauseAfterRound cannot be negative as time travel isn't "
"invented yet.",
),
assert((maxWidth ?? PlatformQuery.width) > 1,
"The maxWidth value should be greater then 0"),
assert(numberOfRounds == null || numberOfRounds > 0),
assert(
accelerationDuration >= Duration.zero,
"The accelerationDuration cannot be negative as time travel isn't "
"invented yet.",
),
accelerationCurve = _JMarqueeCurveImp(accelerationCurve);