NotifyingVector2 class

Extension of the standard Vector2 class, implementing the ChangeNotifier functionality. This allows any interested party to be notified when the value of this vector changes.

This class can be used as a regular Vector2 class. However, if you do subscribe to notifications, don't forget to eventually unsubscribe in order to avoid resource leaks.

Direct modification of this vector's storage is not allowed.

Inheritance
Mixed-in types
Available extensions

Properties

g double
getter/setter pairinherited
gg Vector2
no setterinherited
ggg Vector3
no setterinherited
gggg Vector4
no setterinherited
gggr Vector4
no setterinherited
ggr Vector3
no setterinherited
ggrg Vector4
no setterinherited
ggrr Vector4
no setterinherited
gr Vector2
getter/setter pairinherited
grg Vector3
no setterinherited
grgg Vector4
no setterinherited
grgr Vector4
no setterinherited
grr Vector3
no setterinherited
grrg Vector4
no setterinherited
grrr Vector4
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isInfinite bool
True if any component is infinite.
no setterinherited
isNaN bool
True if any component is NaN.
no setterinherited
length double
Length.
getter/setter pairinherited-getteroverride-setter
length2 double
Length squared.
no setterinherited
r double
getter/setter pairinherited
rg Vector2
getter/setter pairinherited
rgg Vector3
no setterinherited
rggg Vector4
no setterinherited
rggr Vector4
no setterinherited
rgr Vector3
no setterinherited
rgrg Vector4
no setterinherited
rgrr Vector4
no setterinherited
rr Vector2
no setterinherited
rrg Vector3
no setterinherited
rrgg Vector4
no setterinherited
rrgr Vector4
no setterinherited
rrr Vector3
no setterinherited
rrrg Vector4
no setterinherited
rrrr Vector4
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
s double
getter/setter pairinherited
ss Vector2
no setterinherited
sss Vector3
no setterinherited
ssss Vector4
no setterinherited
ssst Vector4
no setterinherited
sst Vector3
no setterinherited
ssts Vector4
no setterinherited
sstt Vector4
no setterinherited
st Vector2
getter/setter pairinherited
storage Float64List
The components of the vector.
no setteroverride
sts Vector3
no setterinherited
stss Vector4
no setterinherited
stst Vector4
no setterinherited
stt Vector3
no setterinherited
stts Vector4
no setterinherited
sttt Vector4
no setterinherited
t double
getter/setter pairinherited
ts Vector2
getter/setter pairinherited
tss Vector3
no setterinherited
tsss Vector4
no setterinherited
tsst Vector4
no setterinherited
tst Vector3
no setterinherited
tsts Vector4
no setterinherited
tstt Vector4
no setterinherited
tt Vector2
no setterinherited
tts Vector3
no setterinherited
ttss Vector4
no setterinherited
ttst Vector4
no setterinherited
ttt Vector3
no setterinherited
ttts Vector4
no setterinherited
tttt Vector4
no setterinherited
x double
getter/setter pairinherited-getteroverride-setter
xx Vector2
no setterinherited
xxx Vector3
no setterinherited
xxxx Vector4
no setterinherited
xxxy Vector4
no setterinherited
xxy Vector3
no setterinherited
xxyx Vector4
no setterinherited
xxyy Vector4
no setterinherited
xy Vector2
getter/setter pairinherited-getteroverride-setter
xyx Vector3
no setterinherited
xyxx Vector4
no setterinherited
xyxy Vector4
no setterinherited
xyy Vector3
no setterinherited
xyyx Vector4
no setterinherited
xyyy Vector4
no setterinherited
y double
getter/setter pairinherited-getteroverride-setter
yx Vector2
getter/setter pairinherited-getteroverride-setter
yxx Vector3
no setterinherited
yxxx Vector4
no setterinherited
yxxy Vector4
no setterinherited
yxy Vector3
no setterinherited
yxyx Vector4
no setterinherited
yxyy Vector4
no setterinherited
yy Vector2
no setterinherited
yyx Vector3
no setterinherited
yyxx Vector4
no setterinherited
yyxy Vector4
no setterinherited
yyy Vector3
no setterinherited
yyyx Vector4
no setterinherited
yyyy Vector4
no setterinherited

Methods

absolute() → void
Absolute value.
override
absoluteError(Vector2 correct) double
Absolute error between this and correct
inherited
add(Vector2 arg) → void
Add arg to this.
override
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
addScaled(Vector2 arg, double factor) → void
Add arg scaled by factor to this.
override
angleTo(Vector2 other) double
Returns the angle between this vector and other in radians.
inherited
angleToSigned(Vector2 other) double
Returns the signed angle between this and other in radians.
inherited
ceil() → void
Ceil entries in this.
override
clamp(Vector2 min, Vector2 max) → void
Clamp each entry n in this in the range [minn]-[maxn].
override
clampScalar(double min, double max) → void
Clamp entries this in the range min-max.
override
clone() Vector2
Clone of this.
inherited
copyFromArray(List<double> array, [int offset = 0]) → void
Copies elements from array into this starting at offset.
override
copyInto(Vector2 arg) Vector2
Copy this into arg. Returns arg.
inherited
copyIntoArray(List<double> array, [int offset = 0]) → void
Copies this into array starting at offset.
inherited
cross(Vector2 other) double
Cross product.
inherited
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
distanceTo(Vector2 arg) double
Distance from this to arg
inherited
distanceToSquared(Vector2 arg) double
Squared distance from this to arg
inherited
divide(Vector2 arg) → void
Divide entries in this with entries in arg.
override
dot(Vector2 other) double
Inner product.
inherited
floor() → void
Floor entries in this.
override
multiply(Vector2 arg) → void
Multiply entries in this with entries in arg.
override
negate() → void
Negate.
override
normalize() double
Normalize this.
override
normalized() Vector2
Normalized copy of this.
inherited
normalizeInto(Vector2 out) Vector2
Normalize vector into out.
inherited
normalizeLength() double
Normalize this. Returns length of vector before normalization. DEPRECATED: Use normalize.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
postmultiply(Matrix2 arg) → void
Transforms this into the product of this as a row vector, postmultiplied by matrix, arg. If arg is a rotation matrix, this is a computational shortcut for applying, the inverse of the transformation.
override
reflect(Vector2 normal) → void
Reflect this.
inherited
reflected(Vector2 normal) Vector2
Reflected copy of this.
inherited
relativeError(Vector2 correct) double
Relative error between this and correct
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
round() → void
Round entries in this.
override
roundToZero() → void
Round entries in this towards zero.
override
scale(double arg) → void
Scale this by arg.
override
scaled(double arg) Vector2
Return a copy of this scaled by arg.
inherited
scaleOrthogonalInto(double scale, Vector2 out) Vector2
Rotate this by 90 degrees then scale it. Store result in out. Return out.
inherited
setFrom(Vector2 other) → void
Set the values by copying them from other.
override
setValues(double x_, double y_) → void
Set the values of the vector.
override
setZero() → void
Zero the vector.
override
splat(double arg) → void
Splat arg into all lanes of the vector.
override
sub(Vector2 arg) → void
Subtract arg from this.
override
toString() String
Returns a printable string
inherited

Operators

operator *(double scale) Vector2
Scale.
inherited
operator +(Vector2 other) Vector2
Add two vectors.
inherited
operator -(Vector2 other) Vector2
Subtract two vectors.
inherited
operator /(double scale) Vector2
Scale.
inherited
operator ==(Object other) bool
Check if two vectors are the same.
inherited
operator [](int i) double
Access the component of the vector at the index i.
inherited
operator []=(int i, double v) → void
Set the component of the vector at the index i.
override
operator unary-() Vector2
Negate.
inherited