01a0f1029f
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
24 lines
585 B
Dart
24 lines
585 B
Dart
/// Une récompense du catalogue que le client peut viser avec ses points.
|
|
class Recompense {
|
|
final String id;
|
|
final String nom;
|
|
final double coutPoints;
|
|
final bool actif;
|
|
|
|
const Recompense({
|
|
required this.id,
|
|
required this.nom,
|
|
required this.coutPoints,
|
|
this.actif = true,
|
|
});
|
|
|
|
factory Recompense.fromMap(Map<String, dynamic> map) {
|
|
return Recompense(
|
|
id: map['id'].toString(),
|
|
nom: (map['nom'] as String?) ?? '',
|
|
coutPoints: (map['cout_points'] as num?)?.toDouble() ?? 0,
|
|
actif: (map['actif'] as bool?) ?? true,
|
|
);
|
|
}
|
|
}
|