differenceWith method
Safely calculates the difference with a nullable DateTime Returns null if other is null, otherwise returns the Duration difference
Implementation
Duration? differenceWith(DateTime? other) {
if (other != null) {
return difference(other);
}
return null;
}