36 lines
890 B
Dart
36 lines
890 B
Dart
class Servicio {
|
|
final int? id;
|
|
final String nombre;
|
|
final String icono;
|
|
final int color;
|
|
final int diaVencimiento;
|
|
final String fechaCreacion;
|
|
|
|
Servicio({
|
|
this.id,
|
|
required this.nombre,
|
|
required this.icono,
|
|
required this.color,
|
|
required this.diaVencimiento,
|
|
required this.fechaCreacion,
|
|
});
|
|
|
|
Map<String, dynamic> toMap() => {
|
|
'id': id,
|
|
'nombre': nombre,
|
|
'icono': icono,
|
|
'color': color,
|
|
'dia_vencimiento': diaVencimiento,
|
|
'fecha_creacion': fechaCreacion,
|
|
};
|
|
|
|
factory Servicio.fromMap(Map<String, dynamic> map) => Servicio(
|
|
id: map['id'] as int?,
|
|
nombre: map['nombre'] as String,
|
|
icono: map['icono'] as String,
|
|
color: map['color'] as int,
|
|
diaVencimiento: map['dia_vencimiento'] as int,
|
|
fechaCreacion: map['fecha_creacion'] as String,
|
|
);
|
|
}
|