ChordPlayState.fromJson constructor
- Object? json
Lê o JSON guardado; o que não for válido volta ao vazio.
Implementation
factory ChordPlayState.fromJson(Object? json) {
if (json is! Map) return const ChordPlayState();
final hash = json['hash'];
return ChordPlayState(
hash: hash is String && hash.isNotEmpty ? hash : null,
played: _strings(json['played']),
done: _readDone(json['feitos']),
);
}