Skip to content
On this page

AudioPlayer

Playback controls for an audio source.

AudioPlayer in FluttyUIAudioPlayer in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

AudioPlayer

const AudioPlayer({
  super.key,
  this.controller,
  this.source,
  this.title = 'Audio',
  this.subtitle,
  this.artwork,
  this.compact = false,
  this.autoplay = false,
  this.showVolume = true,
  this.showSpeed = true,
  this.pauseOnDispose = true,
  this.onError,
  this.motion,
});
ParameterTypeRequiredDefault
keyKey?Nonull
controllerAudioPlayerController?Nonull
sourceAudioPlayerSource?Nonull
titleStringNo'Audio'
subtitleString?Nonull
artworkImageProvider<Object>?Nonull
compactboolNofalse
autoplayboolNofalse
showVolumeboolNotrue
showSpeedboolNotrue
pauseOnDisposeboolNotrue
onErrorValueChanged<Object>?Nonull
motionComponentMotion?Nonull

AudioPlayer.network

factory AudioPlayer.network(
  Uri uri, {
  Key? key,
  String title = 'Audio',
  String? subtitle,
  ImageProvider<Object>? artwork,
  bool compact = false,
  bool autoplay = false,
  ValueChanged<Object>? onError,
});

AudioPlayer.asset

factory AudioPlayer.asset(
  String path, {
  Key? key,
  String? package,
  String title = 'Audio',
  String? subtitle,
  ImageProvider<Object>? artwork,
  bool compact = false,
  bool autoplay = false,
  ValueChanged<Object>? onError,
});

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/media/audio_player/audio_player.dart

This reference is generated from the AudioPlayer declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI