factory Trait.fromJson(Map<String, dynamic> json) { return Trait( name: (json['Name'] as String?)?.toAttributeName(), score: json['Score'] as double?, ); }