/Dart 2

operator unary- method

Duration operator unary- ()

Returns a new Duration representing this Duration negated.

The returned Duration has the same length as this one, but will have the opposite sign of this one.


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

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.