AudioFileWaveforms constructor

const AudioFileWaveforms({
  1. Key? key,
  2. required Size size,
  3. required PlayerController playerController,
  4. PlayerWaveStyle playerWaveStyle = const PlayerWaveStyle(),
  5. bool enableSeekGesture = true,
  6. EdgeInsets? padding,
  7. EdgeInsets? margin,
  8. BoxDecoration? decoration,
  9. Color? backgroundColor,
  10. Duration animationDuration = const Duration(milliseconds: 500),
  11. Curve animationCurve = Curves.ease,
  12. double density = 2,
  13. Clip clipBehavior = Clip.none,
})

Generate waveforms from audio file. You play those audio file using PlayerController. When you play the audio file, another waveform will drawn on top of it to show how much audio has been played and how much is left.

With seeking gesture enabled, playing audio can be seeked to any postion using gestures.

Waveforms are dependent on provided width. If dynamic width is provided,

eg. MediaQueary.of(context).size.width then it may vary from device to device.

Implementation

const AudioFileWaveforms({
  Key? key,
  required this.size,
  required this.playerController,
  this.playerWaveStyle = const PlayerWaveStyle(),
  this.enableSeekGesture = true,
  this.padding,
  this.margin,
  this.decoration,
  this.backgroundColor,
  this.animationDuration = const Duration(milliseconds: 500),
  this.animationCurve = Curves.ease,
  this.density = 2,
  this.clipBehavior = Clip.none,
}) : super(key: key);