MethodChannelAdvancedHaptics class

An implementation of AdvancedHapticsPlatform that uses method channels.

Inheritance

Properties

hashCode → int
The hash code for this object.
no setterinherited
methodChannel → MethodChannel
The method channel used to interact with the native platform.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

arePrimitivesSupported({required List<int> ids}) → Future<bool>
Whether the device can play every Android primitive in ids.
override
cancel() → Future<void>
Cancels any playing or scheduled haptic immediately.
override
hasCustomHapticsSupport() → Future<bool>
Whether the device supports custom (amplitude-controlled) haptics.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause({double atTime = 0.0}) → Future<void>
Pauses the active player.
override
playAhap({required String path, double atTime = 0.0}) → Future<void>
Plays an Apple Core Haptics .ahap file located at asset path.
override
playComposition({required List<Map<String, Object?>> primitives, required List<int> timings, required List<int> amplitudes}) → Future<void>
Plays Android composition primitives (serialised AndroidPrimitiveEvents), with a pre-flattened waveform fallback.
override
playPattern({required List<Map<String, Object?>> events, required List<int> timings, required List<int> amplitudes, double atTime = 0.0}) → Future<void>
Plays a events timeline (serialised HapticEvents sorted by time), with a pre-flattened waveform (timings/amplitudes) for platforms and devices that cannot render the events natively.
override
playPredefined({required int effectId}) → Future<void>
Plays an Android predefined vibration effect identified by effectId.
override
playWaveform({required List<int> timings, required List<int> amplitudes, int repeat = -1, double atTime = 0.0}) → Future<void>
Plays a waveform made of timings (milliseconds) and amplitudes (0-255). Both lists have already been validated by the public API.
override
resume({double atTime = 0.0}) → Future<void>
Resumes the active player.
override
seek({required double offset}) → Future<void>
Seeks the active player to offset seconds.
override
stop({double atTime = 0.0}) → Future<void>
Stops any playing haptic.
override
success() → Future<void>
Plays the built-in "success" pattern.
override
toString() → String
A string representation of this object.
inherited

Operators

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

Constants

channelName → const String
The name of the method channel shared with the native implementations.