Velocity class Null safety

A velocity in two dimensions.

Annotations

Constructors

Velocity({required Offset pixelsPerSecond})
Creates a velocity. [...]
const

Properties

hashCode int
The hash code for this object. [...]
read-only, override
pixelsPerSecond Offset
The number of pixels per second of velocity in the x and y directions.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

clampMagnitude(double minValue, double maxValue) Velocity
Return a velocity whose magnitude has been clamped to minValue and maxValue. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
override

Operators

operator +(Velocity other) Velocity
Return the sum of two velocities.
operator -(Velocity other) Velocity
Return the difference of two velocities.
operator ==(Object other) bool
The equality operator. [...]
override
operator unary-() Velocity
Return the negation of a velocity.

Constants

zero → const Velocity
A velocity that isn't moving at all.
Velocity(pixelsPerSecond: Offset.zero)