class Evento { final int id; final String tipo; // alerta / noticia / notificacion / general final String titulo; final String? descripcion; final String hora; final String timestamp; final bool leido; final bool sincronizado; const Evento({ required this.id, required this.tipo, required this.titulo, this.descripcion, required this.hora, required this.timestamp, this.leido = false, this.sincronizado = false, }); factory Evento.fromMap(Map m) => Evento( id: m['id'] as int, tipo: m['tipo'] as String, titulo: m['titulo'] as String, descripcion: m['descripcion'] as String?, hora: m['hora'] as String, timestamp: m['timestamp'] as String, leido: (m['leido'] as int) == 1, sincronizado: (m['sincronizado'] as int) == 1, ); Map toMap() => { 'id': id, 'tipo': tipo, 'titulo': titulo, 'descripcion': descripcion, 'hora': hora, 'timestamp': timestamp, 'leido': leido ? 1 : 0, 'sincronizado': sincronizado ? 1 : 0, }; }