toJson method

Map<String, dynamic> toJson()

Returns the data fields of NotificationButton in JSON format.

Implementation

Map<String, dynamic> toJson() {
  String? textColorRgb;
  if (textColor != null) {
    textColorRgb = '${textColor!.red},${textColor!.green},${textColor!.blue}';
  }

  return {
    'id': id,
    'text': text,
    'textColorRgb': textColorRgb,
  };
}