feat(favorites): add group persistence foundation
This commit is contained in:
@@ -18,6 +18,7 @@ class Emisora {
|
||||
final int votes;
|
||||
final int clickcount;
|
||||
final int orden;
|
||||
final String grupoFavoritosId;
|
||||
|
||||
const Emisora({
|
||||
this.id,
|
||||
@@ -34,6 +35,7 @@ class Emisora {
|
||||
this.votes = 0,
|
||||
this.clickcount = 0,
|
||||
this.orden = 0,
|
||||
this.grupoFavoritosId = 'sin_asignar',
|
||||
});
|
||||
|
||||
/// Construye una [Emisora] desde la respuesta JSON de Radio Browser API.
|
||||
@@ -71,6 +73,7 @@ class Emisora {
|
||||
votes: map['votes'] as int? ?? 0,
|
||||
clickcount: map['clickcount'] as int? ?? 0,
|
||||
orden: map['orden'] as int? ?? 0,
|
||||
grupoFavoritosId: map['grupo_id'] as String? ?? 'sin_asignar',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -90,6 +93,7 @@ class Emisora {
|
||||
'votes': votes,
|
||||
'clickcount': clickcount,
|
||||
'orden': orden,
|
||||
'grupo_id': grupoFavoritosId,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -108,6 +112,7 @@ class Emisora {
|
||||
int? votes,
|
||||
int? clickcount,
|
||||
int? orden,
|
||||
String? grupoFavoritosId,
|
||||
}) {
|
||||
return Emisora(
|
||||
id: id ?? this.id,
|
||||
@@ -124,6 +129,7 @@ class Emisora {
|
||||
votes: votes ?? this.votes,
|
||||
clickcount: clickcount ?? this.clickcount,
|
||||
orden: orden ?? this.orden,
|
||||
grupoFavoritosId: grupoFavoritosId ?? this.grupoFavoritosId,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user