AhapDecoder class
Parses AHAP (Apple Haptic and Audio Pattern) JSON into a HapticPattern.
Parsing is tolerant: unknown keys, audio events (AudioCustom,
AudioContinuous), and malformed entries are skipped; out-of-range
values are clamped; missing event parameters fall back to the Core
Haptics defaults (intensity 1.0, sharpness 0.5, sustained). Curve
control point times are interpreted relative to the curve's Time, per
the Core Haptics semantics.
Throws a FormatException when the input is not valid JSON or has no
Pattern array.
Constructors
- AhapDecoder()
-
Creates a decoder.
const
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
-
decode(
String ahapJson) → HapticPattern - Parses an AHAP JSON document string.
-
decodeMap(
Map< String, Object?> root) → HapticPattern - Parses an already-decoded AHAP JSON object.
-
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