Add constructor (+ autoformat)

This commit is contained in:
krawieck 2020-08-09 21:15:05 +02:00
parent 4de70c8c24
commit 8dee300ffa
1 changed files with 27 additions and 0 deletions

View File

@ -8,16 +8,22 @@ class UserView {
final int id;
final String actorId;
final String name;
/// can be null
final String preferredUsername;
/// can be null
final String avatar;
/// can be null
final String banner;
/// can be null
final String email;
/// can be null
final String matrixUserId;
/// can be null
final String bio;
final bool local;
@ -31,6 +37,27 @@ class UserView {
final int numberOfComments;
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) =>
_$UserViewFromJson(json);
}