WaveformPlayer constructor

const WaveformPlayer({
  1. Key? key,
  2. String? audioUrl,
  3. String? assetPath,
  4. WaveformPlayerController? controller,
  5. double waveformHeight = 24.0,
  6. double thumbSize = 16.0,
  7. ThumbShape thumbShape = ThumbShape.verticalBar,
  8. Color? activeColor,
  9. Color? inactiveColor,
  10. Color? thumbColor,
  11. Color? backgroundColor,
  12. bool showPlayButton = true,
  13. bool showDuration = true,
  14. bool autoPlay = false,
  15. double playButtonSize = 40.0,
  16. Color? playButtonColor,
  17. Color? playButtonIconColor,
  18. Widget? playIconWidget,
  19. Widget? pauseIconWidget,
  20. AnimatedIconData? animatedIcon,
  21. double? iconSize,
  22. TextStyle? durationTextStyle,
  23. Color? borderColor,
  24. Duration animationDuration = const Duration(milliseconds: 200),
  25. ValueChanged<bool>? onPlayPause,
  26. ValueChanged<Duration>? onPositionChanged,
  27. VoidCallback? onCompleted,
  28. ValueChanged<String>? onError,
  29. Color? glowColor,
  30. Duration glowDuration = const Duration(milliseconds: 1000),
  31. double glowRadiusFactor = 0.25,
  32. int glowCount = 2,
  33. bool showGlow = true,
  34. double barWidth = 4.0,
  35. double barSpacing = 1.0,
})

Creates a WaveformPlayer.

Implementation

const WaveformPlayer({
  super.key,
  this.audioUrl,
  this.assetPath,
  this.controller,
  this.waveformHeight = 24.0,
  this.thumbSize = 16.0,
  this.thumbShape = ThumbShape.verticalBar,
  this.activeColor,
  this.inactiveColor,
  this.thumbColor,
  this.backgroundColor,
  this.showPlayButton = true,
  this.showDuration = true,
  this.autoPlay = false,
  this.playButtonSize = 40.0,
  this.playButtonColor,
  this.playButtonIconColor,
  this.playIconWidget,
  this.pauseIconWidget,
  this.animatedIcon,
  this.iconSize,
  this.durationTextStyle,
  this.borderColor,
  this.animationDuration = const Duration(milliseconds: 200),
  this.onPlayPause,
  this.onPositionChanged,
  this.onCompleted,
  this.onError,
  this.glowColor,
  this.glowDuration = const Duration(milliseconds: 1000),
  this.glowRadiusFactor = 0.25,
  this.glowCount = 2,
  this.showGlow = true,
  this.barWidth = 4.0,
  this.barSpacing = 1.0,
}) : assert(
        (audioUrl != null) != (assetPath != null),
        'WaveformPlayer: You must provide either audioUrl OR assetPath, but not both. '
        'Use audioUrl for remote URLs or assetPath for local assets.',
      );