HapticPattern class

A small, caller-declarable haptic sequence — "1 buzz then a pause then 2 buzzes" instead of a consumer wiring up individual fireHaptic calls by hand for every combo/reward/error moment.

Bounded on purpose (IDEA-41 MVP slice 1: "pulse/delay có giới hạn an toàn") — an unbounded pattern (hundreds of pulses, or a multi-minute total run time) would turn a game-feel touch into an annoying, battery-draining buzz marathon, so both dimensions are capped and validated eagerly at construction rather than left to accumulate at playback time.

Constructors

HapticPattern(List<HapticPulse> pulses)

Properties

hashCode → int
The hash code for this object.
no setterinherited
pulses → List<HapticPulse>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

combo → HapticPattern
A quick double-tap feel for a chained combo continuing.
final
error → HapticPattern
A firm double-buzz "something went wrong" cue, with a distinct pause between the 2 pulses so it doesn't read as a single longer buzz.
final
reward → HapticPattern
A short, escalating "this was great" build-up — light, then medium, then heavy, each a beat apart.
final

Constants

maxDelayPerPulse → const Duration
Max delay any single pulse may schedule before the next one.
maxPulses → const int
Max pulses a single pattern may contain.
maxTotalDuration → const Duration
Max total run time (sum of every HapticPulse.delayAfter) a pattern may schedule.