toJson method

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

Implementation

@override
Map<String, dynamic> toJson() {
  Map<String, dynamic> jsonData = {};
  jsonData['data'] = data.toJson();
  if (id != null) jsonData['id'] = id;
  if (description != null) jsonData['description'] = description;
  if (filename != null) jsonData['filename'] = filename;
  if (mediaType != null) jsonData['media_type'] = mediaType;
  if (format != null) jsonData['format'] = format;
  if (lastmodTime != null) {
    jsonData['lastmod_time'] = lastmodTime!.millisecondsSinceEpoch ~/ 1000;
  }
  if (byteCount != null) jsonData['byte_count'] = byteCount;
  return jsonData;
}