operator unary- method Null safety

Duration operator unary-()

Creates a new Duration with the opposite direction of this Duration.

The returned Duration has the same length as this one, but will have the opposite sign (as reported by isNegative) as this one where possible.


// Using subtraction helps dart2js avoid negative zeros.
Duration operator -() => Duration._microseconds(0 - _duration);