toJson method Null safety

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
  json.addAll({
    'parameterType': parameterType?.toJson(),
    'fixed': fixed,
  });
  _setIfNotNull(json, 'name', name);
  _setIfNotNull(json, 'required', required);
  return json;
}