WaveformPlayer constructor
const
WaveformPlayer({
- Key? key,
- String? audioUrl,
- String? assetPath,
- WaveformPlayerController? controller,
- double waveformHeight = 24.0,
- double thumbSize = 16.0,
- ThumbShape thumbShape = ThumbShape.verticalBar,
- Color? activeColor,
- Color? inactiveColor,
- Color? thumbColor,
- Color? backgroundColor,
- bool showPlayButton = true,
- bool showDuration = true,
- bool autoPlay = false,
- double playButtonSize = 40.0,
- Color? playButtonColor,
- Color? playButtonIconColor,
- Widget? playIconWidget,
- Widget? pauseIconWidget,
- AnimatedIconData? animatedIcon,
- double? iconSize,
- TextStyle? durationTextStyle,
- Color? borderColor,
- Duration animationDuration = const Duration(milliseconds: 200),
- ValueChanged<
bool> ? onPlayPause, - ValueChanged<
Duration> ? onPositionChanged, - VoidCallback? onCompleted,
- ValueChanged<
String> ? onError, - Color? glowColor,
- Duration glowDuration = const Duration(milliseconds: 1000),
- double glowRadiusFactor = 0.25,
- int glowCount = 2,
- bool showGlow = true,
- double barWidth = 4.0,
- 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.',
);