MusicCollectionCubit class

A coleção de "Minhas músicas" (ver o arquivo). catalog é a coleção e as medidas; track diz o que a lista mostra desta trilha.

Inheritance

Constructors

MusicCollectionCubit({required MusicCatalog catalog, required SongListTrack track, MusicCollectionState? initial})
initial é o estado de partida: a tela não passa nada; os testes o usam para pôr resumos à mão (sem o Verovio) na lista.

Properties

allHashes → Set<String>
Os hashes de toda a coleção (não só os à vista): para "Tirar todas".
no setter
catalog → MusicCatalog
final
collection → MusicCollection
A coleção: a pasta do desktop, ou as cópias do aparelho.
no setter
counts → Map<MusicFilter, int>
Quantas músicas cai em cada filtro, com a busca de agora.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isClosed → bool
Whether the bloc is closed.
no setterinherited
lines → List<MusicSongLine>
As linhas com o progresso de agora, na ordem da coleção (a lista ordena depois).
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
state → MusicCollectionState
The current state.
no setterinherited
stream → Stream<MusicCollectionState>
The current stream of states.
no setterinherited
track → SongListTrack
O que a lista faz nesta trilha: o progresso, o filtro e o "Ouvir".
final
visible → List<MusicSongLine>
As músicas à vista: o filtro, a busca e a ordem de agora.
no setter

Methods

addError(Object error, [StackTrace? stackTrace]) → void
Reports an error which triggers onError with an optional StackTrace.
inherited
addFiles(List<({Uint8List bytes, String name})> files, {bool folder = false}) → Future<void>
Acrescenta as músicas de files (escolhidas pela tela) e mede o que entrou. folder diz que a escolha foi uma pasta: sem música nela (e sem cancelar), avisa.
chooseFolder(String path) → Future<void>
Aponta a pasta path (desktop) e mede o que tiver nela.
close() → Future<void>
Closes the instance. This method should be called when the instance is no longer needed. Once close is called, the instance can no longer be used.
inherited
emit(MusicCollectionState state) → void
Updates the state to the provided state. emit does nothing if the state being emitted is equal to the current state.
inherited
listenOf(MusicSummary summary) → Future<MusicListen>
"Ouvir" (LP23.8d): a prévia da linha, ou o motivo de ela não tocar.
markOpened(String hash) → void
Grava hash como a última música aberta, para o topo da lista. A tela da música abre depois disso.
measure() → Future<void>
Lê a coleção e mede o que é novo, com o progresso na tela; depois relê as etapas feitas. A lista só volta quando a medida acaba.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onChange(Change<MusicCollectionState> change) → void
Called whenever a change occurs with the given change. A change occurs when a new state is emitted. onChange is called before the state of the cubit is updated. onChange is a great spot to add logging/analytics for a specific cubit.
inherited
onError(Object error, StackTrace stackTrace) → void
Called whenever an error occurs and notifies BlocObserver.onError.
inherited
reloadState() → Future<void>
Relê as etapas feitas (o progresso de cada música) e a última música aberta.
removeHashes(Set<String> hashes) → Future<void>
Tira as músicas hashes (as escolhidas, ou todas) e sai do modo de escolher.
removeOne(String hash) → Future<void>
Tira a música hash da coleção (o "Tirar" da linha) e mede de novo.
say(String text) → void
Põe um aviso na tela (o SnackBar que a tela mostra).
setFilter(MusicFilter filter) → void
setQuery(String query) → void
sortBy(MusicSortKey key) → void
Troca a ordem pela chave key (a mesma chave inverte a direção).
toggleAll() → void
Escolhe todas as músicas à vista; com todas já escolhidas, limpa.
toggleSelected(String hash) → void
Escolhe ou desescolhe a música hash.
toggleSelecting() → void
Liga ou desliga o modo de escolher; ao mudar, esquece as escolhas.
toString() → String
A string representation of this object.
inherited

Operators

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