toJson method
Returns the data fields of NotificationIconData in JSON format.
Implementation
Map<String, dynamic> toJson() {
String? backgroundColorRgb;
if (backgroundColor != null) {
backgroundColorRgb =
'${backgroundColor!.red},${backgroundColor!.green},${backgroundColor!.blue}';
}
return {
JsonKeys.resType: resType.toString().split('.').last,
JsonKeys.resPrefix: resPrefix.toString().split('.').last,
JsonKeys.name: name,
JsonKeys.backgroundColorRgb: backgroundColorRgb,
};
}