AudioWaveform constructor
AudioWaveform({})
Constructor for AudioWaveform
Implementation
AudioWaveform({
Key? key,
required this.samples,
required this.height,
required this.width,
this.maxDuration,
this.elapsedDuration,
required this.showActiveWaveform,
this.absolute = false,
this.invert = false,
}) : assert(
debugMaxandElapsedDuration(
maxDuration,
elapsedDuration,
),
'Both maxDuration and elapsedDuration must be provided.',
),
assert(
maxDuration == null ? true : maxDuration.inMilliseconds > 0,
'maxDuration must be greater than 0',
),
assert(
elapsedDuration == null ? true : elapsedDuration.inMilliseconds >= 0,
'maxDuration must be greater than 0',
),
assert(
elapsedDuration == null || maxDuration == null
? true
: elapsedDuration.inMilliseconds <= maxDuration.inMilliseconds,
'elapsedDuration must be less than or equal to maxDuration',
),
waveformAlignment = absolute
? invert
? WaveformAlignment.top
: WaveformAlignment.bottom
: WaveformAlignment.center,
super(key: key);