MusicPlayerScreen class
A full-featured, customizable music player UI screen for Flutter.
Supports audio playback, seek bar, volume control, repeat mode, shimmer loading, Lottie animations, song queue, and download with progress.
Part of the flutter_music_player_ui package.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MusicPlayerScreen
Constructors
-
MusicPlayerScreen({Key? key, required List<
MusicModel> songs, required int initialIndex, bool showQueue = false, bool repeat = false, bool showDownloadIcon = false, Color gradiant1 = const Color(0xFF8E2DE2), Color gradiant2 = const Color(0xFF4A00E0), Color indicatorDotColor = Colors.white30, Color indicatorActiveDotColor = Colors.white, Color iconColor = Colors.white, Color titleColor = Colors.white, Color descriptionColor = const Color(0xffCECECE), Color songGradiantColor1 = const Color(0xFF8E2DE2), Color songGradiantColor2 = const Color(0xFFC18FF3)}) -
Creates a MusicPlayerScreen with all UI and playback options.
const
Properties
- descriptionColor → Color
-
Color for the song description text.
final
- gradiant1 → Color
-
Gradient color 1 for background and progress bar.
final
- gradiant2 → Color
-
Gradient color 2 for background and progress bar.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- iconColor → Color
-
Color for all icons.
final
- indicatorActiveDotColor → Color
-
Color for the active dot in the page indicator.
final
- indicatorDotColor → Color
-
Color for inactive dots in the page indicator.
final
- initialIndex → int
-
The index of the initially selected track.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- repeat → bool
-
Whether repeat mode is enabled by default.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showDownloadIcon → bool
-
Whether to show the download icon.
final
- showQueue → bool
-
Whether to display the song queue at the bottom.
final
- songGradiantColor1 → Color
-
Gradient start color for the song card widget.
final
- songGradiantColor2 → Color
-
Gradient end color for the song card widget.
final
-
songs
→ List<
MusicModel> -
List of music tracks to be played.
final
- titleColor → Color
-
Color for the song title.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< MusicPlayerScreen> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited