audio class final

The <audio> HTML element is used to embed sound content in documents. It may contain one or more audio sources, represented using the src attribute or the <source> element: the browser will choose the most suitable one. It can also be the destination for streamed media, using a MediaStream.

Inheritance

Constructors

audio(List<Component> children, {bool autoplay = false, bool controls = false, CrossOrigin? crossOrigin, bool loop = false, bool muted = false, Preload? preload, String? src, String? id, String? classes, Styles? styles, Map<String, String>? attributes, Map<String, EventCallback>? events, Key? key})
The <audio> HTML element is used to embed sound content in documents. It may contain one or more audio sources, represented using the src attribute or the <source> element: the browser will choose the most suitable one. It can also be the destination for streamed media, using a MediaStream.
const

Properties

attributes Map<String, String>?
Additional attributes to apply to the HTML element.
final
autoplay bool
A Boolean attribute: if specified, the audio will automatically begin playback as soon as it can do so, without waiting for the entire audio file to finish downloading.
final
children List<Component>
The children of this component.
final
classes String?
The CSS classes to apply to the HTML element, separated by whitespace.
final
controls bool
If this attribute is present, the browser will offer controls to allow the user to control audio playback, including volume, seeking, and pause/resume playback.
final
crossOrigin CrossOrigin?
Indicates whether to use CORS to fetch the related audio file.
final
events Map<String, EventCallback>?
Event listeners to attach to the HTML element.
final
hashCode int
The hash code for this object.
no setterinherited
id String?
The id of the HTML element. Must be unique within the document.
final
key Key?
Controls how one component replaces another component in the tree.
finalinherited
loop bool
If specified, the audio player will automatically seek back to the start upon reaching the end of the audio.
final
muted bool
Indicates whether the audio will be initially silenced. Its default value is false.
final
preload Preload?
Provides a hint to the browser about what the author thinks will lead to the best user experience.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
src String?
The URL of the audio to embed. This is subject to HTTP access controls. This is optional; you may instead use the <source> element within the audio block to specify the audio to embed.
final
styles Styles?
The inline styles to apply to the HTML element.
final

Methods

build(BuildContext context) Component
Describes the part of the user interface represented by this component.
override
createElement() Element
Creates a StatelessElement to manage this component's location in the tree.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldRebuild(covariant Component newComponent) bool
Implement this method to determine whether a rebuild can be skipped.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited