PlayerState class

Immutable state class representing the complete player state Can be used with any state management solution or none at all

Constructors

PlayerState({required MediaInfo currentMedia, Map<String, MediaInfo> allPlayersMedia = const {}, required bool isPlayerctlInstalled, required bool hasActivePlayer, required List<String> availablePlayers, required String selectedPlayer, required bool isLoading, required String errorMessage, required int volume, required String shuffleStatus, required String loopStatus})
const
PlayerState.fromJson(Map<String, dynamic> json)
Create PlayerState from JSON
factory
PlayerState.initial()
Initial state
factory

Properties

allPlayersMedia Map<String, MediaInfo>
final
availablePlayers List<String>
final
currentMedia MediaInfo
final
errorMessage String
final
hasActivePlayer bool
final
hashCode int
The hash code for this object.
no setterinherited
isLoading bool
final
isPlayerctlInstalled bool
final
loopStatus String
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedPlayer String
final
shuffleStatus String
final
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
volume int
final

Methods

copyWith({MediaInfo? currentMedia, Map<String, MediaInfo>? allPlayersMedia, bool? isPlayerctlInstalled, bool? hasActivePlayer, List<String>? availablePlayers, String? selectedPlayer, bool? isLoading, String? errorMessage, int? volume, String? shuffleStatus, String? loopStatus}) PlayerState
Copy with method for creating updated states
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Convert PlayerState to JSON
toString() String
A string representation of this object.

Operators

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