toJson method Null safety

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
  json.addAll({
    'names': names?.map((f) => f).toList(),
    'bounds': bounds?.toJson(),
    'defaults': defaults?.toJson(),
  });
  return json;
}