Files
packet/lib/domain/entities/biblioteca.dart

34 lines
789 B
Dart
Raw Normal View History

class Biblioteca {
final int? id;
final String nombre;
final String url;
final String endpoint;
final String? hBiblioteca;
Biblioteca({
this.id,
required this.nombre,
required this.url,
required this.endpoint,
this.hBiblioteca,
});
String get fullUrl => '$url$endpoint';
factory Biblioteca.fromMap(Map<String, dynamic> map) => Biblioteca(
id: map['id'] as int?,
nombre: map['nombre'] as String,
url: map['url'] as String,
endpoint: map['endpoint'] as String,
hBiblioteca: map['h_biblioteca'] as String?,
);
Map<String, dynamic> toMap() => {
if (id != null) 'id': id,
'nombre': nombre,
'url': url,
'endpoint': endpoint,
'h_biblioteca': hBiblioteca,
};
}