duration property

int get duration

Duration is mandatory when timed effect is set except for noEffect.

Resolution decreases for a larger duration. e.g Effects with duration smaller than a minute will be rounded to a resolution of 1s, while effects with duration larger than an hour will be rounded up to a resolution of 300s. Duration has a max of 21600000 ms.

Throws NegativeValueException if duration is less than 0.

Implementation

int get duration => _duration;
set duration (int duration)

Implementation

set duration(int duration) {
  if (duration >= 0) {
    _duration = duration;
  } else {
    throw NegativeValueException.withValue(duration);
  }
}