toJson method Null safety

Map toJson()

Implementation

Map toJson() {
  Map _result = {};

  if (errorCode != null) _result.addAll({"errorCode": errorCode});
  if (message != null) _result.addAll({"message": message});

  return _result;
}