toJson method Null safety

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

Implementation

@override
Map<String, dynamic> toJson() {
  final ret = super.toJson();
  ret['url'] = uploadFile.url;
  ret['file_name'] = uploadFile.name;
  ret['file_size'] = uploadFile.fileSize;
  ret['file_type'] = uploadFile.mimeType;
  ret['thumbnails'] = thumbnailSizes?.map((e) => e.toString()).toList();
  ret.removeWhere((key, value) => value == null);
  return ret;
}