toJson method Null safety

Map toJson()

Implementation

Map toJson(){
  Map result = {};

  if (count != null) result.addAll({"count": count});
  if (result != null) result.addAll({"result": result});
  if (imageQualityList != null) result.addAll({"imageQualityList": imageQualityList});
  if (pageIndex != null) result.addAll({"pageIndex": pageIndex});

  return result;
}