class License { String? name; String? spdxId; License(this.name,this.spdxId); String get type { return spdxId ==null?"未知":spdxId!; } factory License.fromJson(Map json) => License( json['name'] as String?, json['spdx_id'] as String?, ); Map toJson() => { 'name': name, 'spdx_id': spdxId, }; }