forked from firka/student-legacy
rounding shits
This commit is contained in:
parent
a435f56f2e
commit
773a8f61e9
@ -60,6 +60,8 @@ const userDataDB = DatabaseStruct("user_data", {
|
|||||||
"goal_pin_dates": String,
|
"goal_pin_dates": String,
|
||||||
// todo and notes
|
// todo and notes
|
||||||
"todo_items": String, "self_notes": String,
|
"todo_items": String, "self_notes": String,
|
||||||
|
// v5 shit
|
||||||
|
"roundings": String,
|
||||||
});
|
});
|
||||||
|
|
||||||
Future<void> createTable(Database db, DatabaseStruct struct) =>
|
Future<void> createTable(Database db, DatabaseStruct struct) =>
|
||||||
@ -118,7 +120,9 @@ Future<Database> initDB(DatabaseProvider database) async {
|
|||||||
"goal_befores": "{}",
|
"goal_befores": "{}",
|
||||||
"goal_pin_dates": "{}",
|
"goal_pin_dates": "{}",
|
||||||
// todo and notes
|
// todo and notes
|
||||||
"todo_items": "{}", "self_notes": "[]"
|
"todo_items": "{}", "self_notes": "[]",
|
||||||
|
// v5 shit
|
||||||
|
"roundings": "{}",
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
print("ERROR: migrateDB: $error");
|
print("ERROR: migrateDB: $error");
|
||||||
|
@ -305,4 +305,15 @@ class UserDatabaseQuery {
|
|||||||
.toList();
|
.toList();
|
||||||
return selfNotes;
|
return selfNotes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// v5
|
||||||
|
Future<Map<String, String>> getRoundings({required String userId}) async {
|
||||||
|
List<Map> userData =
|
||||||
|
await db.query("user_data", where: "id = ?", whereArgs: [userId]);
|
||||||
|
if (userData.isEmpty) return {};
|
||||||
|
String? roundingsJson = userData.elementAt(0)["roundings"] as String?;
|
||||||
|
if (roundingsJson == null) return {};
|
||||||
|
return (jsonDecode(roundingsJson) as Map)
|
||||||
|
.map((key, value) => MapEntry(key.toString(), value.toString()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -193,4 +193,12 @@ class UserDatabaseStore {
|
|||||||
await db.update("user_data", {"self_notes": selfNotesJson},
|
await db.update("user_data", {"self_notes": selfNotesJson},
|
||||||
where: "id = ?", whereArgs: [userId]);
|
where: "id = ?", whereArgs: [userId]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// v5
|
||||||
|
Future<void> storeRoundings(Map<String, String> roundings,
|
||||||
|
{required String userId}) async {
|
||||||
|
String roundingsJson = jsonEncode(roundings);
|
||||||
|
await db.update("user_data", {"roundings": roundingsJson},
|
||||||
|
where: "id = ?", whereArgs: [userId]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,14 +5,18 @@ class GradeSubject {
|
|||||||
Category category;
|
Category category;
|
||||||
String name;
|
String name;
|
||||||
String? renamedTo;
|
String? renamedTo;
|
||||||
|
double? customRounding;
|
||||||
|
|
||||||
bool get isRenamed => renamedTo != null;
|
bool get isRenamed => renamedTo != null;
|
||||||
|
bool get hasCustomRounding => customRounding != null;
|
||||||
|
|
||||||
GradeSubject({
|
GradeSubject({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.category,
|
required this.category,
|
||||||
required this.name,
|
required this.name,
|
||||||
this.renamedTo,
|
this.renamedTo,
|
||||||
|
// v5
|
||||||
|
this.customRounding,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory GradeSubject.fromJson(Map json) {
|
factory GradeSubject.fromJson(Map json) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// ignore_for_file: no_leading_underscores_for_local_identifiers
|
// ignore_for_file: no_leading_underscores_for_local_identifiers, use_build_context_synchronously
|
||||||
|
|
||||||
import 'package:filcnaplo/api/providers/user_provider.dart';
|
import 'package:filcnaplo/api/providers/user_provider.dart';
|
||||||
import 'package:filcnaplo/api/providers/database_provider.dart';
|
import 'package:filcnaplo/api/providers/database_provider.dart';
|
||||||
@ -45,17 +45,21 @@ class AbsenceProvider with ChangeNotifier {
|
|||||||
(await _database.query.getSettings(_database)).renamedSubjectsEnabled
|
(await _database.query.getSettings(_database)).renamedSubjectsEnabled
|
||||||
? await _database.userQuery.renamedSubjects(
|
? await _database.userQuery.renamedSubjects(
|
||||||
userId:
|
userId:
|
||||||
// ignore: use_build_context_synchronously
|
|
||||||
Provider.of<UserProvider>(_context, listen: false).user!.id)
|
Provider.of<UserProvider>(_context, listen: false).user!.id)
|
||||||
: {};
|
: {};
|
||||||
Map<String, String> renamedTeachers =
|
Map<String, String> renamedTeachers =
|
||||||
(await _database.query.getSettings(_database)).renamedTeachersEnabled
|
(await _database.query.getSettings(_database)).renamedTeachersEnabled
|
||||||
? await _database.userQuery.renamedTeachers(
|
? await _database.userQuery.renamedTeachers(
|
||||||
userId:
|
userId:
|
||||||
// ignore: use_build_context_synchronously
|
|
||||||
Provider.of<UserProvider>(_context, listen: false).user!.id)
|
Provider.of<UserProvider>(_context, listen: false).user!.id)
|
||||||
: {};
|
: {};
|
||||||
|
|
||||||
|
// v5
|
||||||
|
Map<String, String> customRoundings = await _database.userQuery
|
||||||
|
.getRoundings(
|
||||||
|
userId:
|
||||||
|
Provider.of<UserProvider>(_context, listen: false).user!.id);
|
||||||
|
|
||||||
for (Absence absence in _absences) {
|
for (Absence absence in _absences) {
|
||||||
absence.subject.renamedTo = renamedSubjects.isNotEmpty
|
absence.subject.renamedTo = renamedSubjects.isNotEmpty
|
||||||
? renamedSubjects[absence.subject.id]
|
? renamedSubjects[absence.subject.id]
|
||||||
@ -63,6 +67,11 @@ class AbsenceProvider with ChangeNotifier {
|
|||||||
absence.teacher.renamedTo = renamedTeachers.isNotEmpty
|
absence.teacher.renamedTo = renamedTeachers.isNotEmpty
|
||||||
? renamedTeachers[absence.teacher.id]
|
? renamedTeachers[absence.teacher.id]
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
|
// v5
|
||||||
|
absence.subject.customRounding = customRoundings.isNotEmpty
|
||||||
|
? double.parse(customRoundings[absence.subject.id] ?? '5.0')
|
||||||
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
@ -87,6 +87,10 @@ class GradeProvider with ChangeNotifier {
|
|||||||
? await _database.userQuery.renamedTeachers(userId: _user.user!.id)
|
? await _database.userQuery.renamedTeachers(userId: _user.user!.id)
|
||||||
: {};
|
: {};
|
||||||
|
|
||||||
|
// v5
|
||||||
|
Map<String, String> customRoundings =
|
||||||
|
await _database.userQuery.getRoundings(userId: _user.user!.id);
|
||||||
|
|
||||||
for (Grade grade in _grades) {
|
for (Grade grade in _grades) {
|
||||||
grade.subject.renamedTo =
|
grade.subject.renamedTo =
|
||||||
renamedSubjects.isNotEmpty ? renamedSubjects[grade.subject.id] : null;
|
renamedSubjects.isNotEmpty ? renamedSubjects[grade.subject.id] : null;
|
||||||
@ -109,6 +113,11 @@ class GradeProvider with ChangeNotifier {
|
|||||||
""
|
""
|
||||||
? '${grade.json!["SzovegesErtekelesRovidNev"]}'.i18n
|
? '${grade.json!["SzovegesErtekelesRovidNev"]}'.i18n
|
||||||
: grade.value.valueName;
|
: grade.value.valueName;
|
||||||
|
|
||||||
|
// v5
|
||||||
|
grade.subject.customRounding = customRoundings.isNotEmpty
|
||||||
|
? double.parse(customRoundings[grade.subject.id] ?? '5.0')
|
||||||
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
@ -45,6 +45,10 @@ class TimetableProvider with ChangeNotifier {
|
|||||||
? await _database.userQuery.renamedTeachers(userId: _user.id!)
|
? await _database.userQuery.renamedTeachers(userId: _user.id!)
|
||||||
: {};
|
: {};
|
||||||
|
|
||||||
|
// v5
|
||||||
|
Map<String, String> customRoundings =
|
||||||
|
await _database.userQuery.getRoundings(userId: _user.user!.id);
|
||||||
|
|
||||||
for (Lesson lesson in lessons.values.expand((e) => e)) {
|
for (Lesson lesson in lessons.values.expand((e) => e)) {
|
||||||
lesson.subject.renamedTo = renamedSubjects.isNotEmpty
|
lesson.subject.renamedTo = renamedSubjects.isNotEmpty
|
||||||
? renamedSubjects[lesson.subject.id]
|
? renamedSubjects[lesson.subject.id]
|
||||||
@ -52,6 +56,11 @@ class TimetableProvider with ChangeNotifier {
|
|||||||
lesson.teacher.renamedTo = renamedTeachers.isNotEmpty
|
lesson.teacher.renamedTo = renamedTeachers.isNotEmpty
|
||||||
? renamedTeachers[lesson.teacher.id]
|
? renamedTeachers[lesson.teacher.id]
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
|
// v5
|
||||||
|
lesson.subject.customRounding = customRoundings.isNotEmpty
|
||||||
|
? double.parse(customRoundings[lesson.subject.id] ?? '5.0')
|
||||||
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
@ -1,14 +1,19 @@
|
|||||||
// ignore_for_file: prefer_function_declarations_over_variables, library_private_types_in_public_api
|
// ignore_for_file: prefer_function_declarations_over_variables, library_private_types_in_public_api, use_build_context_synchronously
|
||||||
|
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:filcnaplo/api/providers/database_provider.dart';
|
||||||
|
import 'package:filcnaplo/api/providers/user_provider.dart';
|
||||||
import 'package:filcnaplo/helpers/quick_actions.dart';
|
import 'package:filcnaplo/helpers/quick_actions.dart';
|
||||||
import 'package:filcnaplo/icons/filc_icons.dart';
|
import 'package:filcnaplo/icons/filc_icons.dart';
|
||||||
import 'package:filcnaplo/models/settings.dart';
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
import 'package:filcnaplo/theme/observer.dart';
|
import 'package:filcnaplo/theme/observer.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/grade.dart';
|
import 'package:filcnaplo_kreta_api/models/grade.dart';
|
||||||
|
import 'package:filcnaplo_kreta_api/models/subject.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/week.dart';
|
import 'package:filcnaplo_kreta_api/models/week.dart';
|
||||||
|
import 'package:filcnaplo_kreta_api/providers/absence_provider.dart';
|
||||||
|
import 'package:filcnaplo_kreta_api/providers/grade_provider.dart';
|
||||||
import 'package:filcnaplo_kreta_api/providers/timetable_provider.dart';
|
import 'package:filcnaplo_kreta_api/providers/timetable_provider.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/bottom_sheet_menu/bottom_sheet_menu.dart';
|
import 'package:filcnaplo_mobile_ui/common/bottom_sheet_menu/bottom_sheet_menu.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/bottom_sheet_menu/bottom_sheet_menu_item.dart';
|
import 'package:filcnaplo_mobile_ui/common/bottom_sheet_menu/bottom_sheet_menu_item.dart';
|
||||||
@ -179,6 +184,18 @@ class SettingsHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// new v5 roundings
|
||||||
|
static void newRoundings(BuildContext context, GradeSubject subject) {
|
||||||
|
showRoundedModalBottomSheet(
|
||||||
|
context,
|
||||||
|
child: RoundingSetting(
|
||||||
|
rounding: subject.customRounding,
|
||||||
|
subjectId: subject.id,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// end
|
||||||
|
|
||||||
static void theme(BuildContext context) {
|
static void theme(BuildContext context) {
|
||||||
var settings = Provider.of<SettingsProvider>(context, listen: false);
|
var settings = Provider.of<SettingsProvider>(context, listen: false);
|
||||||
void Function(ThemeMode) setTheme = (mode) {
|
void Function(ThemeMode) setTheme = (mode) {
|
||||||
@ -353,7 +370,7 @@ class SettingsHelper {
|
|||||||
setSystemChrome(context);
|
setSystemChrome(context);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
title: Text("add_user"),
|
title: const Text("add_user"),
|
||||||
leading: const Icon(FeatherIcons.userPlus),
|
leading: const Icon(FeatherIcons.userPlus),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@ -366,7 +383,10 @@ class SettingsHelper {
|
|||||||
|
|
||||||
// Rounding modal
|
// Rounding modal
|
||||||
class RoundingSetting extends StatefulWidget {
|
class RoundingSetting extends StatefulWidget {
|
||||||
const RoundingSetting({super.key});
|
const RoundingSetting({super.key, this.rounding, this.subjectId});
|
||||||
|
|
||||||
|
final double? rounding;
|
||||||
|
final String? subjectId;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_RoundingSettingState createState() => _RoundingSettingState();
|
_RoundingSettingState createState() => _RoundingSettingState();
|
||||||
@ -378,12 +398,19 @@ class _RoundingSettingState extends State<RoundingSetting> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
rounding =
|
|
||||||
Provider.of<SettingsProvider>(context, listen: false).rounding / 10;
|
rounding = (widget.rounding ??
|
||||||
|
Provider.of<SettingsProvider>(context, listen: false).rounding) /
|
||||||
|
10;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
UserProvider userProvider =
|
||||||
|
Provider.of<UserProvider>(context, listen: false);
|
||||||
|
DatabaseProvider databaseProvider =
|
||||||
|
Provider.of<DatabaseProvider>(context, listen: false);
|
||||||
|
|
||||||
int roundingResult;
|
int roundingResult;
|
||||||
|
|
||||||
if (4.5 >= 4.5.floor() + rounding) {
|
if (4.5 >= 4.5.floor() + rounding) {
|
||||||
@ -438,10 +465,32 @@ class _RoundingSettingState extends State<RoundingSetting> {
|
|||||||
padding: const EdgeInsets.only(bottom: 12.0, top: 6.0),
|
padding: const EdgeInsets.only(bottom: 12.0, top: 6.0),
|
||||||
child: MaterialActionButton(
|
child: MaterialActionButton(
|
||||||
child: Text(SettingsLocalization("done").i18n),
|
child: Text(SettingsLocalization("done").i18n),
|
||||||
onPressed: () {
|
onPressed: () async {
|
||||||
Provider.of<SettingsProvider>(context, listen: false)
|
if (widget.rounding == null) {
|
||||||
.update(rounding: (rounding * 10).toInt());
|
Provider.of<SettingsProvider>(context, listen: false)
|
||||||
Navigator.of(context).maybePop();
|
.update(rounding: (rounding * 10).toInt());
|
||||||
|
} else {
|
||||||
|
Map<String, String> roundings = await databaseProvider.userQuery
|
||||||
|
.getRoundings(userId: userProvider.id!);
|
||||||
|
|
||||||
|
roundings[widget.subjectId!] = (rounding * 10).toStringAsFixed(2);
|
||||||
|
|
||||||
|
await databaseProvider.userStore
|
||||||
|
.storeRoundings(roundings, userId: userProvider.id!);
|
||||||
|
|
||||||
|
await Provider.of<GradeProvider>(context, listen: false)
|
||||||
|
.convertBySettings();
|
||||||
|
await Provider.of<TimetableProvider>(context, listen: false)
|
||||||
|
.convertBySettings();
|
||||||
|
await Provider.of<AbsenceProvider>(context, listen: false)
|
||||||
|
.convertBySettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ik i'm like a kreta dev, but setstate isn't working, so please don't kill me bye :3
|
||||||
|
// actually it also looks good and it's kinda useful
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
// setState(() {});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -12,7 +12,7 @@ import 'package:filcnaplo_kreta_api/providers/grade_provider.dart';
|
|||||||
import 'package:filcnaplo_kreta_api/providers/timetable_provider.dart';
|
import 'package:filcnaplo_kreta_api/providers/timetable_provider.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/panel/panel_button.dart';
|
import 'package:filcnaplo_mobile_ui/common/panel/panel_button.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/splitted_panel/splitted_panel.dart';
|
import 'package:filcnaplo_mobile_ui/common/splitted_panel/splitted_panel.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/screens/settings/settings_helper.dart';
|
// import 'package:filcnaplo_mobile_ui/screens/settings/settings_helper.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
@ -20,8 +20,11 @@ import 'package:provider/provider.dart';
|
|||||||
import 'edit_subject.i18n.dart';
|
import 'edit_subject.i18n.dart';
|
||||||
|
|
||||||
class EditSubjectScreen extends StatefulWidget {
|
class EditSubjectScreen extends StatefulWidget {
|
||||||
const EditSubjectScreen(
|
const EditSubjectScreen({
|
||||||
{super.key, required this.subject, required this.teacher});
|
super.key,
|
||||||
|
required this.subject,
|
||||||
|
required this.teacher,
|
||||||
|
});
|
||||||
|
|
||||||
final GradeSubject subject;
|
final GradeSubject subject;
|
||||||
final Teacher teacher;
|
final Teacher teacher;
|
||||||
@ -139,38 +142,41 @@ class EditSubjectScreenState extends State<EditSubjectScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
// edit rounding
|
// edit rounding
|
||||||
SplittedPanel(
|
// SplittedPanel(
|
||||||
padding: const EdgeInsets.only(top: 9.0),
|
// padding: const EdgeInsets.only(top: 9.0),
|
||||||
cardPadding: const EdgeInsets.all(4.0),
|
// cardPadding: const EdgeInsets.all(4.0),
|
||||||
isSeparated: true,
|
// isSeparated: true,
|
||||||
children: [
|
// children: [
|
||||||
PanelButton(
|
// PanelButton(
|
||||||
onPressed: () {
|
// onPressed: () {
|
||||||
SettingsHelper.rounding(context);
|
// SettingsHelper.newRoundings(context, widget.subject);
|
||||||
setState(() {});
|
// setState(() {});
|
||||||
},
|
// },
|
||||||
title: Text(
|
// title: Text(
|
||||||
"rounding".i18n,
|
// "rounding".i18n,
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
color: AppColors.of(context).text.withOpacity(.95),
|
// color: AppColors.of(context).text.withOpacity(.95),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
leading: Icon(
|
// leading: Icon(
|
||||||
FeatherIcons.gitCommit,
|
// FeatherIcons.gitCommit,
|
||||||
size: 22.0,
|
// size: 22.0,
|
||||||
color: AppColors.of(context).text.withOpacity(.95),
|
// color: AppColors.of(context).text.withOpacity(.95),
|
||||||
),
|
// ),
|
||||||
trailing: Text(
|
// trailing: Text(
|
||||||
(settingsProvider.rounding / 10).toStringAsFixed(1),
|
// ((widget.subject.customRounding ??
|
||||||
style: const TextStyle(fontSize: 14.0),
|
// settingsProvider.rounding) /
|
||||||
),
|
// 10)
|
||||||
borderRadius: const BorderRadius.vertical(
|
// .toStringAsFixed(1),
|
||||||
top: Radius.circular(12.0),
|
// style: const TextStyle(fontSize: 14.0),
|
||||||
bottom: Radius.circular(12.0),
|
// ),
|
||||||
),
|
// borderRadius: const BorderRadius.vertical(
|
||||||
),
|
// top: Radius.circular(12.0),
|
||||||
],
|
// bottom: Radius.circular(12.0),
|
||||||
),
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// ignore_for_file: use_build_context_synchronously
|
// ignore_for_file: use_build_context_synchronously
|
||||||
|
|
||||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||||
|
import 'package:filcnaplo/api/providers/user_provider.dart';
|
||||||
import 'package:filcnaplo/helpers/subject.dart';
|
import 'package:filcnaplo/helpers/subject.dart';
|
||||||
import 'package:filcnaplo/models/settings.dart';
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
@ -62,6 +63,7 @@ class PersonalizeSettingsScreen extends StatefulWidget {
|
|||||||
class PersonalizeSettingsScreenState extends State<PersonalizeSettingsScreen>
|
class PersonalizeSettingsScreenState extends State<PersonalizeSettingsScreen>
|
||||||
with SingleTickerProviderStateMixin {
|
with SingleTickerProviderStateMixin {
|
||||||
late SettingsProvider settingsProvider;
|
late SettingsProvider settingsProvider;
|
||||||
|
late UserProvider user;
|
||||||
|
|
||||||
late AnimationController _hideContainersController;
|
late AnimationController _hideContainersController;
|
||||||
|
|
||||||
@ -179,6 +181,7 @@ class PersonalizeSettingsScreenState extends State<PersonalizeSettingsScreen>
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
settingsProvider = Provider.of<SettingsProvider>(context);
|
settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
|
user = Provider.of<UserProvider>(context);
|
||||||
|
|
||||||
String themeModeText = {
|
String themeModeText = {
|
||||||
ThemeMode.light: "light".i18n,
|
ThemeMode.light: "light".i18n,
|
||||||
@ -517,7 +520,7 @@ class PersonalizeSettingsScreenState extends State<PersonalizeSettingsScreen>
|
|||||||
),
|
),
|
||||||
))
|
))
|
||||||
.toList(),
|
.toList(),
|
||||||
onChanged: (String? v) {
|
onChanged: (String? v) async {
|
||||||
Navigator.of(context, rootNavigator: true).push(
|
Navigator.of(context, rootNavigator: true).push(
|
||||||
CupertinoPageRoute(
|
CupertinoPageRoute(
|
||||||
builder: (context) => EditSubjectScreen(
|
builder: (context) => EditSubjectScreen(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user