Compare commits

..

2 commits

Author SHA1 Message Date
Vadim
b4be0cced3 migrated to http server iap 2024-02-12 16:09:47 +01:00
Vadim
d631f41589 [iOS] fixed vibration 2024-02-12 15:41:19 +01:00
2 changed files with 14 additions and 5 deletions

View file

@ -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()) {
await Vibration.vibrate( if (Platform.isAndroid) {
duration: duration, await Vibration.vibrate(
amplitude: amplitude, duration: duration,
); amplitude: amplitude,
);
} else {
await Vibration.vibrate(
pattern: [duration],
intensities: [amplitude],
);
}
} }
} }

View file

@ -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"