vibration_ohos 0.0.3 copy "vibration_ohos: ^0.0.3" to clipboard
vibration_ohos: ^0.0.3 copied to clipboard

The OpenHarmony implementation of vibration.

vibration_ohos #

The OpenHarmony implementation of vibration.

vibration 在 OpenHarmony 平台的实现。

Add the following permission settings to your project's module.json5 file.

在你的项目的 module.json5 文件中增加以下权限设置。

    "requestPermissions": [
         {"name" :  "ohos.permission.VIBRATE"},                
    ]
copied to clipboard

Usage #

dependencies:
  vibration: any
  vibration_ohos: any
copied to clipboard

vibrateEffect and vibrateAttribute are only exist in VibrationOhos.

 (VibrationPlatform.instance as VibrationOhos).vibrate(
   vibrateEffect: const VibratePreset(count: 100),
   vibrateAttribute: const VibrateAttribute(
     usage: 'alarm',
   ),
 );
copied to clipboard
0
likes
120
points
58
downloads

Publisher

verified publisherharmonycandies.com

Weekly Downloads

2024.09.08 - 2025.03.23

The OpenHarmony implementation of vibration.

Repository (GitHub)

Documentation

API reference

License

BSD-2-Clause (license)

Dependencies

device_info_plus_ohos, flutter, vibration_platform_interface

More

Packages that depend on vibration_ohos