Add constructor (+ autoformat)
This commit is contained in:
parent
4de70c8c24
commit
8dee300ffa
|
@ -8,16 +8,22 @@ class UserView {
|
||||||
final int id;
|
final int id;
|
||||||
final String actorId;
|
final String actorId;
|
||||||
final String name;
|
final String name;
|
||||||
|
|
||||||
/// can be null
|
/// can be null
|
||||||
final String preferredUsername;
|
final String preferredUsername;
|
||||||
|
|
||||||
/// can be null
|
/// can be null
|
||||||
final String avatar;
|
final String avatar;
|
||||||
|
|
||||||
/// can be null
|
/// can be null
|
||||||
final String banner;
|
final String banner;
|
||||||
|
|
||||||
/// can be null
|
/// can be null
|
||||||
final String email;
|
final String email;
|
||||||
|
|
||||||
/// can be null
|
/// can be null
|
||||||
final String matrixUserId;
|
final String matrixUserId;
|
||||||
|
|
||||||
/// can be null
|
/// can be null
|
||||||
final String bio;
|
final String bio;
|
||||||
final bool local;
|
final bool local;
|
||||||
|
@ -31,6 +37,27 @@ class UserView {
|
||||||
final int numberOfComments;
|
final int numberOfComments;
|
||||||
final int commentScore;
|
final int commentScore;
|
||||||
|
|
||||||
|
const UserView({
|
||||||
|
this.id,
|
||||||
|
this.actorId,
|
||||||
|
this.name,
|
||||||
|
this.preferredUsername,
|
||||||
|
this.avatar,
|
||||||
|
this.banner,
|
||||||
|
this.email,
|
||||||
|
this.matrixUserId,
|
||||||
|
this.bio,
|
||||||
|
this.local,
|
||||||
|
this.admin,
|
||||||
|
this.banned,
|
||||||
|
this.showAvatars,
|
||||||
|
this.sendNotificationsToEmail,
|
||||||
|
this.published,
|
||||||
|
this.numberOfPosts,
|
||||||
|
this.postScore,
|
||||||
|
this.numberOfComments,
|
||||||
|
this.commentScore,
|
||||||
|
});
|
||||||
factory UserView.fromJson(Map<String, dynamic> json) =>
|
factory UserView.fromJson(Map<String, dynamic> json) =>
|
||||||
_$UserViewFromJson(json);
|
_$UserViewFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue