nickname changing
This commit is contained in:
@@ -15,6 +15,7 @@ class UserProvider with ChangeNotifier {
|
|||||||
String? get password => user?.password;
|
String? get password => user?.password;
|
||||||
Role? get role => user?.role;
|
Role? get role => user?.role;
|
||||||
Student? get student => user?.student;
|
Student? get student => user?.student;
|
||||||
|
String? get nickname => user?.nickname;
|
||||||
|
|
||||||
void setUser(String userId) {
|
void setUser(String userId) {
|
||||||
_selectedUserId = 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,
|
"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,
|
"grade_opening_fun": int, "icon_pack": String,
|
||||||
});
|
});
|
||||||
const usersDB = DatabaseStruct(
|
const usersDB = DatabaseStruct("users", {
|
||||||
"users", {"id": String, "name": String, "username": String, "password": String, "institute_code": String, "student": String, "role": int});
|
"id": String, "name": String, "username": String, "password": String, "institute_code": String, "student": String, "role": int,
|
||||||
|
"nickname": String // premium only
|
||||||
|
});
|
||||||
const userDataDB = DatabaseStruct("user_data", {
|
const userDataDB = DatabaseStruct("user_data", {
|
||||||
"id": String, "grades": String, "timetable": String, "exams": String, "homework": String, "messages": String, "notes": String,
|
"id": String, "grades": String, "timetable": String, "exams": String, "homework": String, "messages": String, "notes": String,
|
||||||
"events": String, "absences": String, "group_averages": String,
|
"events": String, "absences": String, "group_averages": String,
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ class User {
|
|||||||
String name;
|
String name;
|
||||||
Student student;
|
Student student;
|
||||||
Role role;
|
Role role;
|
||||||
|
String nickname;
|
||||||
|
|
||||||
User({
|
User({
|
||||||
String? id,
|
String? id,
|
||||||
@@ -22,6 +23,7 @@ class User {
|
|||||||
required this.instituteCode,
|
required this.instituteCode,
|
||||||
required this.student,
|
required this.student,
|
||||||
required this.role,
|
required this.role,
|
||||||
|
this.nickname = "",
|
||||||
}) {
|
}) {
|
||||||
if (id != null) {
|
if (id != null) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@@ -39,6 +41,7 @@ class User {
|
|||||||
name: map["name"].trim(),
|
name: map["name"].trim(),
|
||||||
student: Student.fromJson(jsonDecode(map["student"])),
|
student: Student.fromJson(jsonDecode(map["student"])),
|
||||||
role: Role.values[map["role"] ?? 0],
|
role: Role.values[map["role"] ?? 0],
|
||||||
|
nickname: map["nickname"] ?? "",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,6 +54,7 @@ class User {
|
|||||||
"name": name,
|
"name": name,
|
||||||
"student": jsonEncode(student.json),
|
"student": jsonEncode(student.json),
|
||||||
"role": role.index,
|
"role": role.index,
|
||||||
|
"nickname": nickname,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ dependencies:
|
|||||||
path: "../filcnaplo_desktop_ui/"
|
path: "../filcnaplo_desktop_ui/"
|
||||||
filcnaplo_kreta_api:
|
filcnaplo_kreta_api:
|
||||||
path: "../filcnaplo_kreta_api/"
|
path: "../filcnaplo_kreta_api/"
|
||||||
|
filcnaplo_premium:
|
||||||
|
path: "../filcnaplo_premium/"
|
||||||
|
|
||||||
flutter_localizations:
|
flutter_localizations:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|||||||
Submodule filcnaplo_kreta_api updated: bcd9755222...66a65ad649
Submodule filcnaplo_mobile_ui updated: 9278bbb8ec...8af704591c
1
filcnaplo_premium
Submodule
1
filcnaplo_premium
Submodule
Submodule filcnaplo_premium added at 54b166839a
Reference in New Issue
Block a user