AudioPlayerWidget constructor

const AudioPlayerWidget({
  1. Key? key,
  2. VoiceNotePlayerController? controller,
  3. bool autoLoad = true,
  4. bool autoPlay = false,
  5. TextDirection textDirection = TextDirection.ltr,
  6. required String? audioPath,
  7. AudioType audioType = AudioType.directFile,
  8. List<double>? audioSpeeds,
  9. double size = 56,
  10. double width = 400,
  11. Color backgroundColor = Colors.blueAccent,
  12. Color iconColor = Colors.white,
  13. TextStyle? timerTextStyle,
  14. PlayIconShapeType shapeType = PlayIconShapeType.circular,
  15. PlayerStyle playerStyle = PlayerStyle.style1,
  16. double progressBarHeight = 3.0,
  17. Color progressBarColor = Colors.blueAccent,
  18. Color progressBarBackgroundColor = Colors.grey,
  19. bool showProgressBar = true,
  20. bool showTimer = true,
  21. bool showSpeedControl = true,
  22. dynamic onError(
    1. String message
    )?,
  23. dynamic onPause()?,
  24. dynamic onPlay(
    1. bool isPlaying
    )?,
  25. dynamic onSeek(
    1. double value
    )?,
  26. dynamic onSpeedChange(
    1. double speed
    )?,
})

Creates a new instance of the AudioPlayerWidget widget.

Implementation

const AudioPlayerWidget({
  super.key,
  this.controller,
  this.autoLoad = true,
  this.autoPlay = false,
  this.textDirection = TextDirection.ltr,
  required this.audioPath,
  this.audioType = AudioType.directFile,
  this.audioSpeeds,
  this.size = 56,
  this.width = 400,
  this.backgroundColor = Colors.blueAccent,
  this.iconColor = Colors.white,
  this.timerTextStyle,
  this.shapeType = PlayIconShapeType.circular,
  this.playerStyle = PlayerStyle.style1,
  this.progressBarHeight = 3.0,
  this.progressBarColor = Colors.blueAccent,
  this.progressBarBackgroundColor = Colors.grey,
  this.showProgressBar = true,
  this.showTimer = true,
  this.showSpeedControl = true,
  this.onError,
  this.onPause,
  this.onPlay,
  this.onSeek,
  this.onSpeedChange,
});