nickname changing
This commit is contained in:
parent
82671f5ec9
commit
f8cfa04d04
@ -15,6 +15,7 @@ class UserProvider with ChangeNotifier {
|
||||
String? get password => user?.password;
|
||||
Role? get role => user?.role;
|
||||
Student? get student => user?.student;
|
||||
String? get nickname => user?.nickname;
|
||||
|
||||
void setUser(String userId) {
|
||||
_selectedUserId = userId;
|
||||
|
@ -17,8 +17,10 @@ const settingsDB = DatabaseStruct("settings", {
|
||||
"x_filc_id": String, "graph_class_avg": int, "presentation_mode": int, "bell_delay": int, "bell_delay_enabled": int,
|
||||
"grade_opening_fun": int, "icon_pack": String,
|
||||
});
|
||||
const usersDB = DatabaseStruct(
|
||||
"users", {"id": String, "name": String, "username": String, "password": String, "institute_code": String, "student": String, "role": int});
|
||||
const usersDB = DatabaseStruct("users", {
|
||||
"id": String, "name": String, "username": String, "password": String, "institute_code": String, "student": String, "role": int,
|
||||
"nickname": String // premium only
|
||||
});
|
||||
const userDataDB = DatabaseStruct("user_data", {
|
||||
"id": String, "grades": String, "timetable": String, "exams": String, "homework": String, "messages": String, "notes": String,
|
||||
"events": String, "absences": String, "group_averages": String,
|
||||
|
@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,8 @@ dependencies:
|
||||
path: "../filcnaplo_desktop_ui/"
|
||||
filcnaplo_kreta_api:
|
||||
path: "../filcnaplo_kreta_api/"
|
||||
filcnaplo_premium:
|
||||
path: "../filcnaplo_premium/"
|
||||
|
||||
flutter_localizations:
|
||||
sdk: flutter
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit bcd97552227f418898d6a42f671024e479ecb1b4
|
||||
Subproject commit 66a65ad6494f8b8912735ab43a524967d11b525a
|
@ -1 +1 @@
|
||||
Subproject commit 9278bbb8ec7e1cee072812946fc72a98777c7db4
|
||||
Subproject commit 8af704591c96592b7883a29977e69e798029a3aa
|
1
filcnaplo_premium
Submodule
1
filcnaplo_premium
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 54b166839a9a06680b51628567749421f3d9cca8
|
Loading…
x
Reference in New Issue
Block a user