LightDynamics constructor

LightDynamics({
  1. required String status,
  2. required List<String> statusValues,
  3. required double speed,
  4. required bool speedValid,
  5. int? durationMilliseconds,
})

Creates a LightDynamics object.

Implementation

LightDynamics({
  required this.status,
  required this.statusValues,
  required double speed,
  required this.speedValid,
  int? durationMilliseconds,
})  : assert(status.isEmpty || Validators.isValidValue(status, statusValues),
          '`statusValues` does not contain "$status"'),
      assert(Validators.isUnitInterval(speed),
          "`speed` must be between 0 and 1 (inclusive)"),
      assert(durationMilliseconds == null || durationMilliseconds >= 0,
          "`durationMilliseconds` must be greater than 0"),
      _originalSpeed = speed,
      _speed = speed,
      _originalDurationMilliseconds = durationMilliseconds;