diff --git a/packages/flutter/lib/src/gestures/velocity_tracker.dart b/packages/flutter/lib/src/gestures/velocity_tracker.dart index 27fe9b4b32..fe2ca13888 100644 --- a/packages/flutter/lib/src/gestures/velocity_tracker.dart +++ b/packages/flutter/lib/src/gestures/velocity_tracker.dart @@ -218,6 +218,16 @@ class Velocity { /// The number of pixels per second of velocity in the x and y directions. final Offset pixelsPerSecond; + Velocity operator -() => new Velocity(pixelsPerSecond: -pixelsPerSecond); + Velocity operator -(Velocity other) { + return new Velocity( + pixelsPerSecond: pixelsPerSecond - other.pixelsPerSecond); + } + Velocity operator +(Velocity other) { + return new Velocity( + pixelsPerSecond: pixelsPerSecond + other.pixelsPerSecond); + } + bool operator ==(dynamic other) { if (other is! Velocity) return false;