create static method
PowerData
create({
- bool schemeUtilsIsSetDefaultData = false,
- String special_type = "powerData",
- num? level,
- bool? is_charging,
override
return original data json
Implementation
static PowerData create({
bool schemeUtilsIsSetDefaultData = false,
String special_type = "powerData",
num? level,
bool? is_charging,
}) {
// PowerData powerData = PowerData({
final Map powerData_data_create_json = {
"@type": special_type,
"level": level,
"is_charging": is_charging,
};
powerData_data_create_json.removeWhere((key, value) => value == null);
if (schemeUtilsIsSetDefaultData) {
defaultData.forEach((key, value) {
if (powerData_data_create_json.containsKey(key) == false) {
powerData_data_create_json[key] = value;
}
});
}
return PowerData(powerData_data_create_json);
}