JMarquee constructor

JMarquee({
  1. Key? key,
  2. required StatelessWidget child,
  3. required double maxHeight,
  4. double? maxWidth,
  5. ScrollDirection scrollDirection = ScrollDirection.forward,
  6. Axis scrollAxis = Axis.horizontal,
  7. double blankSpace = 0.0,
  8. double velocity = 50.0,
  9. Duration startAfter = Duration.zero,
  10. Duration pauseAfterRound = Duration.zero,
  11. int? numberOfRounds,
  12. double startPadding = 0.0,
  13. Duration accelerationDuration = Duration.zero,
  14. Curve accelerationCurve = Curves.linear,
  15. 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);