toJson method

Object toJson()

Implementation

Object toJson () {
  List<dynamic> fields = [];

  if (this.fields != null) {
    for (Field field in this.fields!) {
      fields.add(field.toJson());
    }
  }

  return {
    'title': title,
    'description': description,
    'footer': footer?.toJson(),
    'timestamp': timestamp?.toIso8601String(),
    'fields': fields,
    'color': color != null ? int.parse(color.toString().replaceAll('#', ''), radix: 16) : null,
    'image': image?.toJson(),
    'thumbnail': thumbnail?.toJson(),
    'author': author?.toJson(),
  };
}