forTimerState static method

Future<void> forTimerState({
  1. required bool isFinished,
  2. bool isPaused = false,
  3. bool isResumed = false,
})

Trigger haptic feedback based on timer state

Implementation

static Future<void> forTimerState({
  required bool isFinished,
  bool isPaused = false,
  bool isResumed = false,
}) async {
  if (isFinished) {
    await heavyImpact();
  } else if (isPaused) {
    await mediumImpact();
  } else if (isResumed) {
    await lightImpact();
  }
}