Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多个@JsonKey使用,只有最后一个属性输出 #40

Open
liubaoxinggo opened this issue Aug 4, 2020 · 0 comments
Open

多个@JsonKey使用,只有最后一个属性输出 #40

liubaoxinggo opened this issue Aug 4, 2020 · 0 comments

Comments

@liubaoxinggo
Copy link

`
{
"Euid": "sample string 1",

"Name": "sample string 2",

"DepartmentId": "sample string 3",

"@jsonkey(ignore: true) String":"Pinyin",

"@jsonkey(ignore: true) String":"firstName",

"@jsonkey(ignore: true) String":"tagIndex"
}
`
执行命令后输出如下

`@JsonSerializable()
class Employee {
Employee();

String Euid;
String Name;
String DepartmentId;
@JsonKey(ignore: true) String tagIndex;

factory Employee.fromJson(Map<String,dynamic> json) => _$EmployeeFromJson(json);
Map<String, dynamic> toJson() => _$EmployeeToJson(this);

}
`
带有@jsonkey的只输出了最后一个,希望可以解决,大佬!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant