PulsarPatternComposer class

Plays pre-defined haptic patterns.

final pattern = PatternData(
  continuousPattern: ContinuousPattern(
    amplitude: [ValuePoint(time: 0, value: 0.5), ValuePoint(time: 500, value: 1.0)],
    frequency: [ValuePoint(time: 0, value: 0.3)],
  ),
  discretePattern: [DiscretePoint(time: 100, amplitude: 1.0, frequency: 0.8)],
);
final composer = pulsar.getPatternComposer();
await composer.parsePattern(pattern);
await composer.play();

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() Future<void>
Release the native composer handle held by this instance.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parsePattern(PatternData data) Future<void>
Parse and store a pattern for playback. Call play afterwards.
play() Future<void>
Play the last parsed pattern.
playAudioOnly() Future<void>
Play only the audio simulation for the last parsed pattern.
playPattern(PatternData data) Future<void>
Parse and play a pattern in one step.
stop() Future<void>
Stop pattern playback.
toString() String
A string representation of this object.
inherited

Operators

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