mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-12-25 15:40:40 +00:00
25 lines
772 B
Dart
25 lines
772 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> startVibration() async {
|
||
|
if (_userPreferencesService.haptics) await _hapticsService.quickVibration();
|
||
|
}
|
||
|
|
||
|
/// Executes vibration if haptics are enabled in settings
|
||
|
Future<void> endVibration() async {
|
||
|
if (_userPreferencesService.haptics) await _hapticsService.errorVibration();
|
||
|
}
|
||
|
|
||
|
bool get isAutostartTimerEnabled => _userPreferencesService.autostartTimer;
|
||
|
}
|