duration property

Duration? duration

Implementation

Duration? get duration => _duration;
void duration=(Duration? value)

setting a duration without a start date defaults from 1970-1-1

Implementation

set duration(Duration? value) {
  if (value == null) {
    _duration = null;
    return;
  }
  if (value.isNegative || value.inDays == 0) {
    throw ArgumentError(
        'Negative or zero duration not allowed in DatePeriod creation');
  }
  _duration = Duration(days: value.inDays);
}