toJson method

Map<String, dynamic> toJson()

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 {
    'resType': resType.toString().split('.').last,
    'resPrefix': resPrefix.toString().split('.').last,
    'name': name,
    'backgroundColorRgb': backgroundColorRgb,
  };
}