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';
|
import 'package:vibration/vibration.dart';
|
||||||
|
|
||||||
class HapticsService {
|
class HapticsService {
|
||||||
|
@ -11,10 +13,17 @@ class HapticsService {
|
||||||
|
|
||||||
Future<void> _tryVibrate({required int duration, required int amplitude}) async {
|
Future<void> _tryVibrate({required int duration, required int amplitude}) async {
|
||||||
if (await _canVibrate()) {
|
if (await _canVibrate()) {
|
||||||
|
if (Platform.isAndroid) {
|
||||||
await Vibration.vibrate(
|
await Vibration.vibrate(
|
||||||
duration: duration,
|
duration: duration,
|
||||||
amplitude: amplitude,
|
amplitude: amplitude,
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
await Vibration.vibrate(
|
||||||
|
pattern: [duration],
|
||||||
|
intensities: [amplitude],
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ dependencies:
|
||||||
m3_lightmeter_iap:
|
m3_lightmeter_iap:
|
||||||
git:
|
git:
|
||||||
url: "https://github.com/vodemn/m3_lightmeter_iap"
|
url: "https://github.com/vodemn/m3_lightmeter_iap"
|
||||||
ref: v0.7.2
|
ref: v0.8.0
|
||||||
m3_lightmeter_resources:
|
m3_lightmeter_resources:
|
||||||
git:
|
git:
|
||||||
url: "https://github.com/vodemn/m3_lightmeter_resources"
|
url: "https://github.com/vodemn/m3_lightmeter_resources"
|
||||||
|
|
Loading…
Reference in a new issue