toMap method
toMap is the method to convert the class to a map.
Implementation
Map<String, dynamic> toMap() {
return {
'level': level,
'health': health,
'status': status,
'powerSource': powerSource,
'technology': technology,
'temperature': temperature,
'voltage': voltage,
'powerProfile': powerProfile,
};
}