toJson method
Implementation
Map<String, dynamic> toJson() {
return {
'channelId': channelId,
'channelName': channelName,
'badge': badge,
'channelDescription': channelDescription,
'lights': lights,
'lightColor': lightColor == null
? null
: {
'alpha': (lightColor!.a * 255.0).round().clamp(0, 255),
'red': (lightColor!.r * 255.0).round().clamp(0, 255),
'green': (lightColor!.g * 255.0).round().clamp(0, 255),
'blue': (lightColor!.b * 255.0).round().clamp(0, 255),
},
'playSound': playSound,
'importance': importance?.name,
'visibility': visibility?.name,
'vibrate': vibrate,
'vibrationPattern': vibrationPattern,
'registerBackgroundHandler': registerBackgroundHandler,
};
}