toJson method

Object toJson()

Converts this object to something serializable in JSON.

Implementation

Object toJson() {
  final Map<String, Object> json = <String, Object>{};

  if (position != null) {
    json['position'] = position!.toJson();
  }

  if (icon != null) {
    json['icon'] = icon!.toJson();
  }

  if (title != null) {
    json['title'] = title!;
  }

  if (titleColor != null) {
    json['titleColor'] = titleColor!.value;
  }

  json['visible'] = visible;

  return json;
}