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 map) => Battery( id: map["id"], name: map["name"], type: map["type"], voltage: map["voltage"], imageUuid: map["image_uuid"], ); Map toMap() { return { "id": id, "name": name, "type": type, "voltage": voltage, "image_uuid": imageUuid, }; } }