Initial commit
This commit is contained in:
35
lib/models/servicio.dart
Normal file
35
lib/models/servicio.dart
Normal file
@@ -0,0 +1,35 @@
|
||||
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,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user