mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-25 17:00:39 +00:00
Compare commits
No commits in common. "b4be0cced3046769b712ce5a1113527cf1b8e48b" and "f307676ca5671a430cd97b336ccf5a12cf91e9b6" have entirely different histories.
b4be0cced3
...
f307676ca5
2 changed files with 5 additions and 14 deletions
|
@ -1,5 +1,3 @@
|
||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:vibration/vibration.dart';
|
import 'package:vibration/vibration.dart';
|
||||||
|
|
||||||
class HapticsService {
|
class HapticsService {
|
||||||
|
@ -13,17 +11,10 @@ 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.8.0
|
ref: v0.7.2
|
||||||
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