MaterialControls constructor

MaterialControls({
  1. Key? key,
  2. FlVideoPlayerProgressColors progressColors = const FlVideoPlayerProgressColors(played: Color(0x80FFFFFF), handle: Color(0xFFFFFFFF), buffered: Color(0x55FFFFFF), background: Color(0x35FFFFFF)),
  3. IconData subtitleON = Icons.closed_caption,
  4. IconData subtitleOFF = Icons.closed_caption_off_outlined,
  5. IconData speed = Icons.speed,
  6. IconData fullscreenON = Icons.fullscreen,
  7. IconData fullscreenOFF = Icons.fullscreen_exit,
  8. IconData volumeON = Icons.volume_up,
  9. IconData volumeOFF = Icons.volume_off,
  10. IconData error = Icons.error,
  11. Color backgroundColor = const Color(0x90000000),
  12. Color color = const Color(0xFFFFFFFF),
  13. Duration hideDuration = const Duration(seconds: 4),
  14. bool enableSubtitle = true,
  15. bool enableSpeed = true,
  16. bool enableFullscreen = true,
  17. bool enableVolume = true,
  18. bool enablePlay = true,
  19. bool enablePosition = true,
  20. bool enableBottomBar = true,
  21. bool isLive = false,
  22. List<double> playbackSpeeds = const [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2],
  23. Widget loading = const CircularProgressIndicator(color: Colors.white),
  24. PositionAndAllBuilder? positionBuilder,
  25. FlVideoControlsErrorBuilder? errorBuilder,
  26. FlVideoControlsTap? onTap,
  27. FlVideoControlsProgressDrag? onDragProgress,
})

Implementation

MaterialControls({
  super.key,
  this.progressColors = const FlVideoPlayerProgressColors(
      played: Color(0x80FFFFFF),
      handle: Color(0xFFFFFFFF),
      buffered: Color(0x55FFFFFF),
      background: Color(0x35FFFFFF)),
  this.subtitleON = Icons.closed_caption,
  this.subtitleOFF = Icons.closed_caption_off_outlined,
  this.speed = Icons.speed,
  this.fullscreenON = Icons.fullscreen,
  this.fullscreenOFF = Icons.fullscreen_exit,
  this.volumeON = Icons.volume_up,
  this.volumeOFF = Icons.volume_off,
  this.error = Icons.error,
  this.backgroundColor = const Color(0x90000000),
  this.color = const Color(0xFFFFFFFF),
  this.hideDuration = const Duration(seconds: 4),
  this.enableSubtitle = true,
  this.enableSpeed = true,
  this.enableFullscreen = true,
  this.enableVolume = true,
  this.enablePlay = true,
  this.enablePosition = true,
  this.enableBottomBar = true,
  this.isLive = false,
  this.playbackSpeeds = const [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2],
  this.loading = const CircularProgressIndicator(color: Colors.white),
  this.positionBuilder,
  this.errorBuilder,
  this.onTap,
  this.onDragProgress,
}) : assert(playbackSpeeds.every((speed) => speed > 0),
          'The playbackSpeeds values must all be greater than 0');