modelos y provider creados

This commit is contained in:
Abraham
2025-07-16 13:53:23 -07:00
parent 14775dc90d
commit 9488188de5
18 changed files with 3050 additions and 42 deletions

View File

@@ -0,0 +1,41 @@
import 'dart:convert';
class DetalleCable {
final String componenteId;
final String? tipoCable;
final String? color;
final double? tamano;
final String? tipoConector;
DetalleCable({
required this.componenteId,
this.tipoCable,
this.color,
this.tamano,
this.tipoConector,
});
factory DetalleCable.fromMap(Map<String, dynamic> map) {
return DetalleCable(
componenteId: map['componente_id'],
tipoCable: map['tipo_cable'],
color: map['color'],
tamano: map['tamaño']?.toDouble(),
tipoConector: map['tipo_conector'],
);
}
Map<String, dynamic> toMap() {
return {
'componente_id': componenteId,
'tipo_cable': tipoCable,
'color': color,
'tamaño': tamano,
'tipo_conector': tipoConector,
};
}
factory DetalleCable.fromJson(String source) =>
DetalleCable.fromMap(json.decode(source));
String toJson() => json.encode(toMap());
}