vibration_ohos 0.0.1 vibration_ohos: ^0.0.1 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"},
]
Usage #
dependencies:
vibration: any
vibration_ohos: any
vibrateEffect
and vibrateAttribute
are only exist in VibrationOhos
.
(VibrationPlatform.instance as VibrationOhos).vibrate(
vibrateEffect: const VibratePreset(count: 100),
vibrateAttribute: const VibrateAttribute(
usage: 'alarm',
),
);