cancelScheduledNotes method

  1. @override
Future<void> cancelScheduledNotes({
  1. String? synthId,
})
override

Implementation

@override
Future<void> cancelScheduledNotes({String? synthId}) async {
  if (synthId != null) {
    final timers = _scheduledTimers.remove(synthId) ?? const <Timer>[];
    for (final timer in timers) {
      timer.cancel();
    }
    return;
  }

  for (final timers in _scheduledTimers.values) {
    for (final timer in timers) {
      timer.cancel();
    }
  }
  _scheduledTimers.clear();
}