34 lines
594 B
Dart
34 lines
594 B
Dart
class Battery {
|
|
int? id;
|
|
String name;
|
|
String type;
|
|
double voltage;
|
|
String? imageUuid;
|
|
|
|
Battery({
|
|
this.id,
|
|
required this.name,
|
|
required this.type,
|
|
required this.voltage,
|
|
this.imageUuid,
|
|
});
|
|
|
|
factory Battery.fromMap(Map<String, dynamic> map) => Battery(
|
|
id: map["id"],
|
|
name: map["name"],
|
|
type: map["type"],
|
|
voltage: map["voltage"],
|
|
imageUuid: map["image_uuid"],
|
|
);
|
|
|
|
Map<String, dynamic> toMap() {
|
|
return {
|
|
"id": id,
|
|
"name": name,
|
|
"type": type,
|
|
"voltage": voltage,
|
|
"image_uuid": imageUuid,
|
|
};
|
|
}
|
|
}
|