getDuration method
Gets the value for a given key
as a Duration.
Returns defVal
if the key
does not exist.
Implementation
Duration getDuration(String key, {Duration defVal = const Duration(seconds: 0)}) {
var res = getInt(key, defVal: defVal.inSeconds);
if (res < 0) {
res = 0;
}
return Duration(seconds: res);
}