mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 07:20:39 +00:00
Compare commits
2 commits
f307676ca5
...
b4be0cced3
Author | SHA1 | Date | |
---|---|---|---|
|
b4be0cced3 | ||
|
d631f41589 |
2 changed files with 14 additions and 5 deletions
|
@ -1,3 +1,5 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:vibration/vibration.dart';
|
||||
|
||||
class HapticsService {
|
||||
|
@ -11,10 +13,17 @@ class HapticsService {
|
|||
|
||||
Future<void> _tryVibrate({required int duration, required int amplitude}) async {
|
||||
if (await _canVibrate()) {
|
||||
await Vibration.vibrate(
|
||||
duration: duration,
|
||||
amplitude: amplitude,
|
||||
);
|
||||
if (Platform.isAndroid) {
|
||||
await Vibration.vibrate(
|
||||
duration: duration,
|
||||
amplitude: amplitude,
|
||||
);
|
||||
} else {
|
||||
await Vibration.vibrate(
|
||||
pattern: [duration],
|
||||
intensities: [amplitude],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ dependencies:
|
|||
m3_lightmeter_iap:
|
||||
git:
|
||||
url: "https://github.com/vodemn/m3_lightmeter_iap"
|
||||
ref: v0.7.2
|
||||
ref: v0.8.0
|
||||
m3_lightmeter_resources:
|
||||
git:
|
||||
url: "https://github.com/vodemn/m3_lightmeter_resources"
|
||||
|
|
Loading…
Reference in a new issue