toJson method

  1. @override
Map<String, Object> toJson()
override

Converts the object to a JSON-encodable object.

Implementation

@override
Map<String, Object> toJson() => {
      if (id.isNotEmpty) 'id': id,
      if (status.isNotEmpty) 'status': status,
      if (code.isNotEmpty) 'code': code,
      if (title.isNotEmpty) 'title': title,
      if (detail.isNotEmpty) 'detail': detail,
      if (source.isNotEmpty) 'source': source,
      if (links.isNotEmpty) 'links': links,
      if (meta.isNotEmpty) 'meta': meta,
    };