mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-10-19 06:40:59 +00:00
c7ed4d332e
added `HapticsService` added haptics handling added `HapticsInteractor`
18 lines
477 B
Dart
18 lines
477 B
Dart
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:lightmeter/interactors/haptics_interactor.dart';
|
|
|
|
class HapticsListTileBloc extends Cubit<bool> {
|
|
final HapticsInteractor _hapticsInteractor;
|
|
|
|
HapticsListTileBloc(
|
|
this._hapticsInteractor,
|
|
) : super(_hapticsInteractor.isEnabled);
|
|
|
|
void onHapticsChange(bool value) {
|
|
_hapticsInteractor.enableHaptics(value);
|
|
if (value) {
|
|
_hapticsInteractor.quickVibration();
|
|
}
|
|
emit(value);
|
|
}
|
|
}
|