debugMaxandElapsedDuration function

bool debugMaxandElapsedDuration(
  1. Duration? maxDuration,
  2. Duration? elapsedDuration
)

AudioWaveform is a custom StatefulWidget that other Waveform classes extend to.

This class handles the common functionality, properties and provides the most common waveform details to the subclasses. This details then can be used by the WaveformPainter to paint the waveform.

Anything that can be shared and used across all waveforms should be handled by this class.

Implementation

bool debugMaxandElapsedDuration(
  Duration? maxDuration,
  Duration? elapsedDuration,
) {
  return maxDuration != null || elapsedDuration != null
      ? elapsedDuration != null && maxDuration != null
      : true;
}