durationGreaterThanZeroWithDefault function
If value
is null, or <=0, then return the default value.
Implementation
Duration durationGreaterThanZeroWithDefault(
Duration? value, Duration defaultValue) {
if (value == null || value.inMilliseconds <= 0) {
return defaultValue;
}
return value;
}