MethodChannelAdvancedHaptics class
An implementation of AdvancedHapticsPlatform that uses method channels.
- Inheritance
-
- Object
- PlatformInterface
- AdvancedHapticsPlatform
- MethodChannelAdvancedHaptics
Constructors
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
.ahapfile located at assetpath.override -
playComposition(
{required List< Map< primitives, required List<String, Object?> >int> timings, required List<int> amplitudes}) → Future<void> -
Plays Android composition
primitives(serialisedAndroidPrimitiveEvents), with a pre-flattened waveform fallback.override -
playPattern(
{required List< Map< events, required List<String, Object?> >int> timings, required List<int> amplitudes, double atTime = 0.0}) → Future<void> -
Plays a
eventstimeline (serialisedHapticEvents 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) andamplitudes(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
offsetseconds.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.