class Team {
  final String id;
  final String name;
  final String season;
  final String imageUrl;
  final bool isFavorite;

  Team({
    required this.id,
    required this.name,
    required this.season,
    required this.imageUrl,
    this.isFavorite = false
  });

  // Converte de Mapa (o formato da nossa "memória") para Objeto
  factory Team.fromMap(Map<String, dynamic> map) {
    return Team(
      id: map['id'] ?? '',
      name: map['name'] ?? '',
      season: map['season'] ?? '',
      imageUrl: map['image_url'] ?? '',
      isFavorite: map['is_favorite'] ?? false,
    );
  }

  // Converte de Objeto para Mapa (para guardar na lista)
  Map<String, dynamic> toMap() {
    return {
      'id': id,
      'name': name,
      'season': season,
      'image_url': imageUrl,
      'is_favorite': isFavorite,
    };
  }
}