copyWith method
copyWith is the method to copy the class.
Implementation
Battery copyWith({
int? level,
String? health,
String? status,
String? powerSource,
String? technology,
String? temperature,
String? voltage,
String? powerProfile,
}) {
return Battery(
level: level ?? this.level,
health: health ?? this.health,
status: status ?? this.status,
powerSource: powerSource ?? this.powerSource,
technology: technology ?? this.technology,
temperature: temperature ?? this.temperature,
voltage: voltage ?? this.voltage,
powerProfile: powerProfile ?? this.powerProfile,
);
}