W3cubDocs

/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.

Implementation

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

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/2.0.0/dart-core/Duration/operator_unary_minus.html