nickname changing

This commit is contained in:
55nknown
2022-11-15 09:00:38 +01:00
parent 82671f5ec9
commit f8cfa04d04
7 changed files with 14 additions and 4 deletions

View File

@@ -13,6 +13,7 @@ class User {
String name;
Student student;
Role role;
String nickname;
User({
String? id,
@@ -22,6 +23,7 @@ class User {
required this.instituteCode,
required this.student,
required this.role,
this.nickname = "",
}) {
if (id != null) {
this.id = id;
@@ -39,6 +41,7 @@ class User {
name: map["name"].trim(),
student: Student.fromJson(jsonDecode(map["student"])),
role: Role.values[map["role"] ?? 0],
nickname: map["nickname"] ?? "",
);
}
@@ -51,6 +54,7 @@ class User {
"name": name,
"student": jsonEncode(student.json),
"role": role.index,
"nickname": nickname,
};
}