NoiseEffectController class

Effect controller that oscillates around 0 following a noise curve.

The frequency parameter controls smoothness/jerkiness of the oscillations. It is roughly proportional to the total number of swings for the duration of the effect.

The taperingCurve describes how the effect fades out over time. The curve that you supply will be flipped along the X axis, so that the effect starts at full force, and gradually reduces to zero towards the end.

This effect controller can be used to implement various shake effects. For example, putting into a MoveEffect.by will create a shake motion, where the magnitude and the direction of shaking is controlled by the effect's offset.

Inheritance

Constructors

NoiseEffectController({required double duration, required double frequency, Curve taperingCurve = Curves.easeInOutCubic, Random? random})

Properties

completed bool
Has the effect already finished?
no setterinherited
duration double
Total duration of the effect. If the duration cannot be determined, this will return null. For an infinite effect the duration is infinity.
getter/setter pairinherited
frequency double
final
hashCode int
The hash code for this object.
no setterinherited
isInfinite bool
Will the effect continue to run forever (never completes)?
no setterinherited
isRandom bool
Is the effect's duration random or fixed?
no setterinherited
noise SimplexNoise
final
progress double
The current progress of the effect, a value between 0 and 1.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
started bool
Has the effect started running? Some effects use a "delay" parameter to postpone the start of an animation. This property then tells you whether this delay period has already passed.
no setterinherited
taperingCurve Curve
final
timer double
no setterinherited

Methods

advance(double dt) double
Advances this controller's internal clock by dt seconds.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onMount(Effect parent) → void
This is called by the Effect class when the controller is attached to that effect. Controllers with children should propagate this to their children.
inherited
recede(double dt) double
Similar to advance(), but makes the effect controller move back in time.
inherited
setToEnd() → void
Puts the controller into its final "completed" state.
inherited
setToStart() → void
Reverts the controller to its initial state, as it was before the start of the animation.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited