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