m3_lightmeter/lib/interactors/timer_interactor.dart
2024-05-04 19:58:19 +02:00

24 lines
780 B
Dart

import 'package:lightmeter/data/haptics_service.dart';
import 'package:lightmeter/data/shared_prefs_service.dart';
class TimerInteractor {
final UserPreferencesService _userPreferencesService;
final HapticsService _hapticsService;
TimerInteractor(
this._userPreferencesService,
this._hapticsService,
);
/// Executes vibration if haptics are enabled in settings
Future<void> quickVibration() async {
if (_userPreferencesService.haptics) await _hapticsService.quickVibration();
}
/// Executes vibration if haptics are enabled in settings
Future<void> responseVibration() async {
if (_userPreferencesService.haptics) await _hapticsService.responseVibration();
}
bool get isAutostartTimerEnabled => _userPreferencesService.autostartTimer;
}