Collection class
Classe que gerencia a coleção dos decks de Flashcards do usuário
- Inheritance
- Object
- ChangeNotifier
- Collection
- Annotations
- @JsonSerializable(explicitToJson: true)
Constructors
-
Collection({List<
Deck> decks}) - Método construtor
-
Collection.fromJson(Map<
String, dynamic> json) -
Transforma um Map em uma Collection
factory
Properties
-
decks
↔ List<
Deck> -
A lista contendo todos os decks na coleção
@JsonKey(required: true, disallowNullValue: true), read / write
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- hasListeners → bool
-
Whether any listeners are currently registered. [...]
@protected, read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes. [...]
inherited
-
createDeck(
String deckName) → void - Cria um deck vazio novo para o usuário
-
deleteDeck(
String deckName) → void - Deleta um deck da coleção
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener and removeListener will throw after the object is
disposed). [...]
@mustCallSuper, inherited
-
editDeck(
String deckName, int operacao, Flashcard card, {Flashcard replaceCard}) → void - Edita um deck da coleção, podendo remover, adicionar ou modificar um flashcard
-
exportDeck(
String deckName) → String - Exporta o deck como uma string que representa o JSON do deck
-
findDeck(
String deckName) → int - Procura um deck na lista de decks e retorna o index, se não existir então a posição -1 é retornada
-
getDeck(
String deckName) → Deck - Retorna um deck da lista de decks com o nome deckName
-
importDeck(
String jsonDeck) → void - Importa um deck, dado uma String
-
loadFile(
) → Future< void> - Carrega a coleção no aparelho
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
notify(
String error) → void -
notifyListeners(
) → void -
Call all the registered listeners. [...]
@protected, @visibleForTesting, inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes. [...]
inherited
-
resetDeck(
String deckName) → void - Reseta o deck na lista
-
saveFile(
) → void - Salva a coleção no aparelho
-
setDeckName(
String deckName, String newDeckName) → void - Atribui um outro nome para um deck
-
toJson(
) → Map< String, dynamic> - Transforma uma Collection em um Map
-
toString(
) → String -
A string representation of this object. [...]
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited