commit
c78b8d3b97
@ -17,7 +17,7 @@ const settingsDB = DatabaseStruct("settings", {
|
|||||||
"notifications": int, "notifications_bitfield": int, "notification_poll_interval": int, // notifications
|
"notifications": int, "notifications_bitfield": int, "notification_poll_interval": int, // notifications
|
||||||
"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, "premium_scopes": String, "premium_token": String, "premium_login": String,
|
"grade_opening_fun": int, "icon_pack": String, "premium_scopes": String, "premium_token": String, "premium_login": String,
|
||||||
"last_account_id": String, "renamed_subjects_enabled": int,
|
"last_account_id": String, "renamed_subjects_enabled": int, "renamed_subjects_italics":int,
|
||||||
});
|
});
|
||||||
// DON'T FORGET TO UPDATE DEFAULT VALUES IN `initDB` MIGRATION OR ELSE PARENTS WILL COMPLAIN ABOUT THEIR CHILDREN MISSING
|
// DON'T FORGET TO UPDATE DEFAULT VALUES IN `initDB` MIGRATION OR ELSE PARENTS WILL COMPLAIN ABOUT THEIR CHILDREN MISSING
|
||||||
// YOU'VE BEEN WARNED!!!
|
// YOU'VE BEEN WARNED!!!
|
||||||
|
@ -68,6 +68,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
String _premiumLogin;
|
String _premiumLogin;
|
||||||
String _lastAccountId;
|
String _lastAccountId;
|
||||||
bool _renamedSubjectsEnabled;
|
bool _renamedSubjectsEnabled;
|
||||||
|
bool _renamedSubjectsItalics;
|
||||||
|
|
||||||
SettingsProvider({
|
SettingsProvider({
|
||||||
DatabaseProvider? database,
|
DatabaseProvider? database,
|
||||||
@ -104,6 +105,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
required String premiumLogin,
|
required String premiumLogin,
|
||||||
required String lastAccountId,
|
required String lastAccountId,
|
||||||
required bool renameSubjectsEnabled,
|
required bool renameSubjectsEnabled,
|
||||||
|
required bool renameSubjectsItalics,
|
||||||
}) : _database = database,
|
}) : _database = database,
|
||||||
_language = language,
|
_language = language,
|
||||||
_startPage = startPage,
|
_startPage = startPage,
|
||||||
@ -137,7 +139,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
_premiumAccessToken = premiumAccessToken,
|
_premiumAccessToken = premiumAccessToken,
|
||||||
_premiumLogin = premiumLogin,
|
_premiumLogin = premiumLogin,
|
||||||
_lastAccountId = lastAccountId,
|
_lastAccountId = lastAccountId,
|
||||||
_renamedSubjectsEnabled = renameSubjectsEnabled;
|
_renamedSubjectsEnabled = renameSubjectsEnabled,
|
||||||
|
_renamedSubjectsItalics = renameSubjectsItalics;
|
||||||
|
|
||||||
factory SettingsProvider.fromMap(Map map,
|
factory SettingsProvider.fromMap(Map map,
|
||||||
{required DatabaseProvider database}) {
|
{required DatabaseProvider database}) {
|
||||||
@ -191,6 +194,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
premiumLogin: map["premium_login"],
|
premiumLogin: map["premium_login"],
|
||||||
lastAccountId: map["last_account_id"],
|
lastAccountId: map["last_account_id"],
|
||||||
renameSubjectsEnabled: map["renamed_subjects_enabled"] == 1,
|
renameSubjectsEnabled: map["renamed_subjects_enabled"] == 1,
|
||||||
|
renameSubjectsItalics: map["renamed_subjects_italics"] == 0,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,7 +235,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
"premium_token": _premiumAccessToken,
|
"premium_token": _premiumAccessToken,
|
||||||
"premium_login": _premiumLogin,
|
"premium_login": _premiumLogin,
|
||||||
"last_account_id": _lastAccountId,
|
"last_account_id": _lastAccountId,
|
||||||
"renamed_subjects_enabled": _renamedSubjectsEnabled ? 1 : 0
|
"renamed_subjects_enabled": _renamedSubjectsEnabled ? 1 : 0,
|
||||||
|
"renamed_subjects_italics": _renamedSubjectsItalics ? 1 : 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,6 +282,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
premiumLogin: "igen",
|
premiumLogin: "igen",
|
||||||
lastAccountId: "",
|
lastAccountId: "",
|
||||||
renameSubjectsEnabled: false,
|
renameSubjectsEnabled: false,
|
||||||
|
renameSubjectsItalics: false,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,6 +323,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
String get premiumLogin => _premiumLogin;
|
String get premiumLogin => _premiumLogin;
|
||||||
String get lastAccountId => _lastAccountId;
|
String get lastAccountId => _lastAccountId;
|
||||||
bool get renamedSubjectsEnabled => _renamedSubjectsEnabled;
|
bool get renamedSubjectsEnabled => _renamedSubjectsEnabled;
|
||||||
|
bool get renamedSubjectsItalics => _renamedSubjectsItalics;
|
||||||
|
|
||||||
Future<void> update({
|
Future<void> update({
|
||||||
bool store = true,
|
bool store = true,
|
||||||
@ -353,6 +360,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
String? premiumLogin,
|
String? premiumLogin,
|
||||||
String? lastAccountId,
|
String? lastAccountId,
|
||||||
bool? renamedSubjectsEnabled,
|
bool? renamedSubjectsEnabled,
|
||||||
|
bool? renamedSubjectsItalics,
|
||||||
}) async {
|
}) async {
|
||||||
if (language != null && language != _language) _language = language;
|
if (language != null && language != _language) _language = language;
|
||||||
if (startPage != null && startPage != _startPage) _startPage = startPage;
|
if (startPage != null && startPage != _startPage) _startPage = startPage;
|
||||||
@ -415,7 +423,9 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
if (renamedSubjectsEnabled != null &&
|
if (renamedSubjectsEnabled != null &&
|
||||||
renamedSubjectsEnabled != _renamedSubjectsEnabled)
|
renamedSubjectsEnabled != _renamedSubjectsEnabled)
|
||||||
_renamedSubjectsEnabled = renamedSubjectsEnabled;
|
_renamedSubjectsEnabled = renamedSubjectsEnabled;
|
||||||
|
if (renamedSubjectsItalics != null &&
|
||||||
|
renamedSubjectsItalics != _renamedSubjectsItalics)
|
||||||
|
_renamedSubjectsItalics = renamedSubjectsItalics;
|
||||||
if (store) await _database?.store.storeSettings(this);
|
if (store) await _database?.store.storeSettings(this);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,8 @@ class GradeTile extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
String title;
|
String title;
|
||||||
String subtitle;
|
String subtitle;
|
||||||
|
bool isTitleItalic = false;
|
||||||
|
bool isSubtitleItalic = false;
|
||||||
EdgeInsets leadingPadding = EdgeInsets.zero;
|
EdgeInsets leadingPadding = EdgeInsets.zero;
|
||||||
bool isSubjectView = SubjectGradesContainer.of(context) != null;
|
bool isSubjectView = SubjectGradesContainer.of(context) != null;
|
||||||
String subjectName =
|
String subjectName =
|
||||||
@ -32,7 +34,8 @@ class GradeTile extends StatelessWidget {
|
|||||||
|
|
||||||
GradeCalculatorProvider calculatorProvider =
|
GradeCalculatorProvider calculatorProvider =
|
||||||
Provider.of<GradeCalculatorProvider>(context, listen: false);
|
Provider.of<GradeCalculatorProvider>(context, listen: false);
|
||||||
|
SettingsProvider settingsProvider =
|
||||||
|
Provider.of<SettingsProvider>(context);
|
||||||
// Test order:
|
// Test order:
|
||||||
// description
|
// description
|
||||||
// mode
|
// mode
|
||||||
@ -47,6 +50,7 @@ class GradeTile extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
title = subjectName;
|
title = subjectName;
|
||||||
|
isTitleItalic = grade.subject.isRenamed && settingsProvider.renamedSubjectsItalics;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test order:
|
// Test order:
|
||||||
@ -58,6 +62,7 @@ class GradeTile extends StatelessWidget {
|
|||||||
? modeDescription
|
? modeDescription
|
||||||
: ""
|
: ""
|
||||||
: subjectName;
|
: subjectName;
|
||||||
|
isSubtitleItalic = isSubjectView ? false : grade.subject.isRenamed && settingsProvider.renamedSubjectsItalics;
|
||||||
} else {
|
} else {
|
||||||
subtitle = grade.value.valueName.split("(")[0];
|
subtitle = grade.value.valueName.split("(")[0];
|
||||||
}
|
}
|
||||||
@ -122,7 +127,7 @@ class GradeTile extends StatelessWidget {
|
|||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
fontStyle: grade.subject.isRenamed && title == subjectName
|
fontStyle: isTitleItalic
|
||||||
? FontStyle.italic
|
? FontStyle.italic
|
||||||
: null),
|
: null),
|
||||||
),
|
),
|
||||||
@ -144,7 +149,7 @@ class GradeTile extends StatelessWidget {
|
|||||||
subtitle,
|
subtitle,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(fontWeight: FontWeight.w500),
|
style: TextStyle(fontWeight: FontWeight.w500, fontStyle: isSubtitleItalic ? FontStyle.italic : null),
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
trailing: isSubjectView
|
trailing: isSubjectView
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo_kreta_api/providers/exam_provider.dart';
|
import 'package:filcnaplo_kreta_api/providers/exam_provider.dart';
|
||||||
import 'package:filcnaplo_kreta_api/providers/homework_provider.dart';
|
import 'package:filcnaplo_kreta_api/providers/homework_provider.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
@ -31,6 +32,8 @@ class LessonTile extends StatelessWidget {
|
|||||||
bool fillLeading = false;
|
bool fillLeading = false;
|
||||||
String lessonIndexTrailing = "";
|
String lessonIndexTrailing = "";
|
||||||
|
|
||||||
|
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
|
|
||||||
// Only put a trailing . if its a digit
|
// Only put a trailing . if its a digit
|
||||||
if (RegExp(r'\d').hasMatch(lesson.lessonIndex)) lessonIndexTrailing = ".";
|
if (RegExp(r'\d').hasMatch(lesson.lessonIndex)) lessonIndexTrailing = ".";
|
||||||
|
|
||||||
@ -159,7 +162,7 @@ class LessonTile extends StatelessWidget {
|
|||||||
.text
|
.text
|
||||||
.withOpacity(!lesson.isEmpty ? 1.0 : 0.5),
|
.withOpacity(!lesson.isEmpty ? 1.0 : 0.5),
|
||||||
fontStyle:
|
fontStyle:
|
||||||
lesson.subject.isRenamed ? FontStyle.italic : null),
|
lesson.subject.isRenamed && settingsProvider.renamedSubjectsItalics ? FontStyle.italic : null),
|
||||||
),
|
),
|
||||||
subtitle: description != ""
|
subtitle: description != ""
|
||||||
? Text(
|
? Text(
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
import 'package:filcnaplo/helpers/subject.dart';
|
import 'package:filcnaplo/helpers/subject.dart';
|
||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
import 'package:filcnaplo/utils/format.dart';
|
import 'package:filcnaplo/utils/format.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/subject.dart';
|
import 'package:filcnaplo_kreta_api/models/subject.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/widgets/absence/absence_display.dart';
|
import 'package:filcnaplo_mobile_ui/common/widgets/absence/absence_display.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class AbsenceSubjectTile extends StatelessWidget {
|
class AbsenceSubjectTile extends StatelessWidget {
|
||||||
const AbsenceSubjectTile(this.subject, {Key? key, this.percentage = 0.0, this.excused = 0, this.unexcused = 0, this.pending = 0, this.onTap})
|
const AbsenceSubjectTile(this.subject, {Key? key, this.percentage = 0.0, this.excused = 0, this.unexcused = 0, this.pending = 0, this.onTap})
|
||||||
@ -19,6 +21,7 @@ class AbsenceSubjectTile extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
return Material(
|
return Material(
|
||||||
type: MaterialType.transparency,
|
type: MaterialType.transparency,
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
@ -33,7 +36,7 @@ class AbsenceSubjectTile extends StatelessWidget {
|
|||||||
subject.renamedTo ?? subject.name.capital(),
|
subject.renamedTo ?? subject.name.capital(),
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 15.0, fontStyle: subject.isRenamed ? FontStyle.italic : null),
|
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 15.0, fontStyle: subject.isRenamed && settingsProvider.renamedSubjectsItalics ? FontStyle.italic : null),
|
||||||
),
|
),
|
||||||
subtitle: AbsenceDisplay(excused, unexcused, pending),
|
subtitle: AbsenceDisplay(excused, unexcused, pending),
|
||||||
trailing: Row(
|
trailing: Row(
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
import 'package:filcnaplo/utils/format.dart';
|
import 'package:filcnaplo/utils/format.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/absence.dart';
|
import 'package:filcnaplo_kreta_api/models/absence.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/widgets/absence_group/absence_group_container.dart';
|
import 'package:filcnaplo_mobile_ui/common/widgets/absence_group/absence_group_container.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 'absence_tile.i18n.dart';
|
import 'absence_tile.i18n.dart';
|
||||||
|
|
||||||
class AbsenceTile extends StatelessWidget {
|
class AbsenceTile extends StatelessWidget {
|
||||||
@ -18,6 +20,7 @@ class AbsenceTile extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Color color = justificationColor(absence.state, context: context);
|
Color color = justificationColor(absence.state, context: context);
|
||||||
bool group = AbsenceGroupContainer.of(context) != null;
|
bool group = AbsenceGroupContainer.of(context) != null;
|
||||||
|
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@ -66,7 +69,7 @@ class AbsenceTile extends StatelessWidget {
|
|||||||
(absence.lessonIndex != null ? "${absence.lessonIndex}. " : "") + (absence.subject.renamedTo ?? absence.subject.name.capital()),
|
(absence.lessonIndex != null ? "${absence.lessonIndex}. " : "") + (absence.subject.renamedTo ?? absence.subject.name.capital()),
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontWeight: FontWeight.w500, fontSize: 14.0, fontStyle: absence.subject.isRenamed ? FontStyle.italic : null),
|
style: TextStyle(fontWeight: FontWeight.w500, fontSize: 14.0, fontStyle: absence.subject.isRenamed && settingsProvider.renamedSubjectsItalics ? FontStyle.italic : null),
|
||||||
),
|
),
|
||||||
subtitle: !group
|
subtitle: !group
|
||||||
? Text(
|
? Text(
|
||||||
@ -74,7 +77,7 @@ class AbsenceTile extends StatelessWidget {
|
|||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
// DateFormat("MM. dd. (EEEEE)", I18n.of(context).locale.toString()).format(absence.date),
|
// DateFormat("MM. dd. (EEEEE)", I18n.of(context).locale.toString()).format(absence.date),
|
||||||
style: TextStyle(fontWeight: FontWeight.w500, fontStyle: absence.subject.isRenamed ? FontStyle.italic : null),
|
style: TextStyle(fontWeight: FontWeight.w500, fontStyle: absence.subject.isRenamed && settingsProvider.renamedSubjectsItalics ? FontStyle.italic : null),
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
// ignore_for_file: empty_catches
|
// ignore_for_file: empty_catches
|
||||||
|
|
||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/absence.dart';
|
import 'package:filcnaplo_kreta_api/models/absence.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/bottom_card.dart';
|
import 'package:filcnaplo_mobile_ui/common/bottom_card.dart';
|
||||||
@ -12,6 +13,7 @@ import 'package:filcnaplo_mobile_ui/pages/timetable/timetable_page.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:filcnaplo/utils/reverse_search.dart';
|
import 'package:filcnaplo/utils/reverse_search.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'absence_view.i18n.dart';
|
import 'absence_view.i18n.dart';
|
||||||
|
|
||||||
class AbsenceView extends StatelessWidget {
|
class AbsenceView extends StatelessWidget {
|
||||||
@ -28,6 +30,7 @@ class AbsenceView extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Color color = AbsenceTile.justificationColor(absence.state, context: context);
|
Color color = AbsenceTile.justificationColor(absence.state, context: context);
|
||||||
|
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 12.0),
|
padding: const EdgeInsets.only(bottom: 12.0),
|
||||||
@ -57,7 +60,7 @@ class AbsenceView extends StatelessWidget {
|
|||||||
absence.subject.renamedTo ?? absence.subject.name.capital(),
|
absence.subject.renamedTo ?? absence.subject.name.capital(),
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontWeight: FontWeight.w700, fontStyle: absence.subject.isRenamed ? FontStyle.italic : null),
|
style: TextStyle(fontWeight: FontWeight.w700, fontStyle: absence.subject.isRenamed && settingsProvider.renamedSubjectsItalics ? FontStyle.italic : null),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
absence.teacher,
|
absence.teacher,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:filcnaplo/helpers/subject.dart';
|
import 'package:filcnaplo/helpers/subject.dart';
|
||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/grade.dart';
|
import 'package:filcnaplo_kreta_api/models/grade.dart';
|
||||||
import 'package:filcnaplo/ui/widgets/grade/grade_tile.dart';
|
import 'package:filcnaplo/ui/widgets/grade/grade_tile.dart';
|
||||||
@ -6,6 +7,7 @@ import 'package:filcnaplo_mobile_ui/pages/grades/subject_grades_container.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:filcnaplo/utils/format.dart';
|
import 'package:filcnaplo/utils/format.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'certification_tile.i18n.dart';
|
import 'certification_tile.i18n.dart';
|
||||||
|
|
||||||
class CertificationTile extends StatelessWidget {
|
class CertificationTile extends StatelessWidget {
|
||||||
@ -20,6 +22,8 @@ class CertificationTile extends StatelessWidget {
|
|||||||
bool isSubjectView = SubjectGradesContainer.of(context) != null;
|
bool isSubjectView = SubjectGradesContainer.of(context) != null;
|
||||||
String certificationName;
|
String certificationName;
|
||||||
|
|
||||||
|
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
|
|
||||||
switch (grade.type) {
|
switch (grade.type) {
|
||||||
case GradeType.endYear:
|
case GradeType.endYear:
|
||||||
certificationName = "final".i18n;
|
certificationName = "final".i18n;
|
||||||
@ -78,7 +82,7 @@ class CertificationTile extends StatelessWidget {
|
|||||||
title: Text(isSubjectView ? certificationName : grade.subject.renamedTo ?? grade.subject.name.capital(),
|
title: Text(isSubjectView ? certificationName : grade.subject.renamedTo ?? grade.subject.name.capital(),
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 18.0, fontStyle: grade.subject.isRenamed ? FontStyle.italic : null)),
|
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 18.0, fontStyle: grade.subject.isRenamed && settingsProvider.renamedSubjectsItalics ? FontStyle.italic : null)),
|
||||||
subtitle: Text(grade.value.valueName, style: const TextStyle(fontWeight: FontWeight.w600, fontSize: 16.0)),
|
subtitle: Text(grade.value.valueName, style: const TextStyle(fontWeight: FontWeight.w600, fontSize: 16.0)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
import 'package:filcnaplo/helpers/subject.dart';
|
import 'package:filcnaplo/helpers/subject.dart';
|
||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
import 'package:filcnaplo/utils/format.dart';
|
import 'package:filcnaplo/utils/format.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/subject.dart';
|
import 'package:filcnaplo_kreta_api/models/subject.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/average_display.dart';
|
import 'package:filcnaplo_mobile_ui/common/average_display.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class GradeSubjectTile extends StatelessWidget {
|
class GradeSubjectTile extends StatelessWidget {
|
||||||
const GradeSubjectTile(this.subject,
|
const GradeSubjectTile(this.subject,
|
||||||
@ -19,10 +21,10 @@ class GradeSubjectTile extends StatelessWidget {
|
|||||||
final double average;
|
final double average;
|
||||||
final double groupAverage;
|
final double groupAverage;
|
||||||
final double averageBefore;
|
final double averageBefore;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Color textColor = AppColors.of(context).text;
|
Color textColor = AppColors.of(context).text;
|
||||||
|
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
|
|
||||||
// Failing indicator
|
// Failing indicator
|
||||||
if (average < 2.0 && average >= 1.0) {
|
if (average < 2.0 && average >= 1.0) {
|
||||||
@ -54,7 +56,7 @@ class GradeSubjectTile extends StatelessWidget {
|
|||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
color: textColor,
|
color: textColor,
|
||||||
fontStyle: subject.isRenamed ? FontStyle.italic : null),
|
fontStyle: settingsProvider.renamedSubjectsItalics && subject.isRenamed ? FontStyle.italic : null),
|
||||||
),
|
),
|
||||||
trailing: Row(
|
trailing: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
@ -17,6 +17,7 @@ class GradeView extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 12.0),
|
padding: const EdgeInsets.only(bottom: 12.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -29,7 +30,7 @@ class GradeView extends StatelessWidget {
|
|||||||
grade.subject.renamedTo ?? grade.subject.name.capital(),
|
grade.subject.renamedTo ?? grade.subject.name.capital(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontWeight: FontWeight.w600, fontStyle: grade.subject.isRenamed ? FontStyle.italic : null),
|
style: TextStyle(fontWeight: FontWeight.w600, fontStyle: grade.subject.isRenamed && settingsProvider.renamedSubjectsItalics ? FontStyle.italic : null),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
!Provider.of<SettingsProvider>(context, listen: false).presentationMode ? grade.teacher : "Tanár",
|
!Provider.of<SettingsProvider>(context, listen: false).presentationMode ? grade.teacher : "Tanár",
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
import 'package:filcnaplo/helpers/subject.dart';
|
import 'package:filcnaplo/helpers/subject.dart';
|
||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/homework.dart';
|
import 'package:filcnaplo_kreta_api/models/homework.dart';
|
||||||
import 'package:filcnaplo/utils/format.dart';
|
import 'package:filcnaplo/utils/format.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';
|
||||||
|
|
||||||
class HomeworkTile extends StatelessWidget {
|
class HomeworkTile extends StatelessWidget {
|
||||||
const HomeworkTile(this.homework,
|
const HomeworkTile(this.homework,
|
||||||
@ -17,6 +19,8 @@ class HomeworkTile extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
|
|
||||||
return Material(
|
return Material(
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
@ -65,7 +69,7 @@ class HomeworkTile extends StatelessWidget {
|
|||||||
homework.subject.renamedTo ?? homework.subject.name.capital(),
|
homework.subject.renamedTo ?? homework.subject.name.capital(),
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
style: TextStyle(fontWeight: FontWeight.w600, fontStyle: homework.subject.isRenamed && settingsProvider.renamedSubjectsItalics ? FontStyle.italic : null),
|
||||||
),
|
),
|
||||||
subtitle: censored
|
subtitle: censored
|
||||||
? Wrap(
|
? Wrap(
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:filcnaplo/helpers/subject.dart';
|
import 'package:filcnaplo/helpers/subject.dart';
|
||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/homework.dart';
|
import 'package:filcnaplo_kreta_api/models/homework.dart';
|
||||||
import 'package:filcnaplo/utils/format.dart';
|
import 'package:filcnaplo/utils/format.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/detail.dart';
|
import 'package:filcnaplo_mobile_ui/common/detail.dart';
|
||||||
@ -7,6 +8,7 @@ import 'package:filcnaplo_mobile_ui/common/widgets/homework/homework_attachment_
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_custom_tabs/flutter_custom_tabs.dart';
|
import 'package:flutter_custom_tabs/flutter_custom_tabs.dart';
|
||||||
import 'package:flutter_linkify/flutter_linkify.dart';
|
import 'package:flutter_linkify/flutter_linkify.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'homework_view.i18n.dart';
|
import 'homework_view.i18n.dart';
|
||||||
|
|
||||||
class HomeworkView extends StatelessWidget {
|
class HomeworkView extends StatelessWidget {
|
||||||
@ -21,6 +23,7 @@ class HomeworkView extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
List<Widget> attachmentTiles = [];
|
List<Widget> attachmentTiles = [];
|
||||||
|
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
|
|
||||||
for (var attachment in homework.attachments) {
|
for (var attachment in homework.attachments) {
|
||||||
attachmentTiles.add(Padding(
|
attachmentTiles.add(Padding(
|
||||||
@ -48,7 +51,7 @@ class HomeworkView extends StatelessWidget {
|
|||||||
homework.subject.renamedTo ?? homework.subject.name.capital(),
|
homework.subject.renamedTo ?? homework.subject.name.capital(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
style: TextStyle(fontWeight: FontWeight.w600, fontStyle: homework.subject.isRenamed && settingsProvider.renamedSubjectsItalics ? FontStyle.italic : null),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
homework.teacher,
|
homework.teacher,
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
import 'package:filcnaplo/utils/format.dart';
|
import 'package:filcnaplo/utils/format.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/lesson.dart';
|
import 'package:filcnaplo_kreta_api/models/lesson.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/bottom_card.dart';
|
import 'package:filcnaplo_mobile_ui/common/bottom_card.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/detail.dart';
|
import 'package:filcnaplo_mobile_ui/common/detail.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'lesson_view.i18n.dart';
|
import 'lesson_view.i18n.dart';
|
||||||
|
|
||||||
class LessonView extends StatelessWidget {
|
class LessonView extends StatelessWidget {
|
||||||
@ -16,6 +18,8 @@ class LessonView extends StatelessWidget {
|
|||||||
Color accent = Theme.of(context).colorScheme.secondary;
|
Color accent = Theme.of(context).colorScheme.secondary;
|
||||||
String lessonIndexTrailing = "";
|
String lessonIndexTrailing = "";
|
||||||
|
|
||||||
|
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
|
|
||||||
if (RegExp(r'\d').hasMatch(lesson.lessonIndex)) lessonIndexTrailing = ".";
|
if (RegExp(r'\d').hasMatch(lesson.lessonIndex)) lessonIndexTrailing = ".";
|
||||||
|
|
||||||
if (lesson.substituteTeacher != "") {
|
if (lesson.substituteTeacher != "") {
|
||||||
@ -50,7 +54,7 @@ class LessonView extends StatelessWidget {
|
|||||||
lesson.subject.renamedTo ?? lesson.subject.name.capital(),
|
lesson.subject.renamedTo ?? lesson.subject.name.capital(),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontWeight: FontWeight.w600, fontStyle: lesson.subject.isRenamed ? FontStyle.italic : null),
|
style: TextStyle(fontWeight: FontWeight.w600, fontStyle: lesson.subject.isRenamed && settingsProvider.renamedSubjectsItalics ? FontStyle.italic : null),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
lesson.substituteTeacher == "" ? lesson.teacher : lesson.substituteTeacher,
|
lesson.substituteTeacher == "" ? lesson.teacher : lesson.substituteTeacher,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:filcnaplo/helpers/subject.dart';
|
import 'package:filcnaplo/helpers/subject.dart';
|
||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
import 'package:filcnaplo_kreta_api/models/lesson.dart';
|
import 'package:filcnaplo_kreta_api/models/lesson.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/common/bottom_sheet_menu/rounded_bottom_sheet.dart';
|
import 'package:filcnaplo_mobile_ui/common/bottom_sheet_menu/rounded_bottom_sheet.dart';
|
||||||
@ -6,6 +7,7 @@ import 'package:filcnaplo_mobile_ui/pages/timetable/timetable_page.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:filcnaplo/utils/format.dart';
|
import 'package:filcnaplo/utils/format.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'missed_exam_tile.i18n.dart';
|
import 'missed_exam_tile.i18n.dart';
|
||||||
|
|
||||||
class MissedExamView extends StatelessWidget {
|
class MissedExamView extends StatelessWidget {
|
||||||
@ -30,6 +32,7 @@ class MissedExamViewTile extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
return Material(
|
return Material(
|
||||||
type: MaterialType.transparency,
|
type: MaterialType.transparency,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@ -43,7 +46,7 @@ class MissedExamViewTile extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
"${lesson.subject.renamedTo ?? lesson.subject.name.capital()} • ${lesson.date.format(context)}",
|
"${lesson.subject.renamedTo ?? lesson.subject.name.capital()} • ${lesson.date.format(context)}",
|
||||||
style: TextStyle(fontWeight: FontWeight.w600, fontStyle: lesson.subject.isRenamed ? FontStyle.italic : null),
|
style: TextStyle(fontWeight: FontWeight.w600, fontStyle: lesson.subject.isRenamed && settingsProvider.renamedSubjectsItalics ? FontStyle.italic : null),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
"missed_exam_contact".i18n.fill([lesson.teacher]),
|
"missed_exam_contact".i18n.fill([lesson.teacher]),
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:filcnaplo/helpers/subject.dart';
|
import 'package:filcnaplo/helpers/subject.dart';
|
||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/theme/colors/colors.dart';
|
import 'package:filcnaplo/theme/colors/colors.dart';
|
||||||
import 'package:filcnaplo/ui/date_widget.dart';
|
import 'package:filcnaplo/ui/date_widget.dart';
|
||||||
import 'package:filcnaplo/utils/reverse_search.dart';
|
import 'package:filcnaplo/utils/reverse_search.dart';
|
||||||
@ -15,6 +16,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:filcnaplo/utils/format.dart';
|
import 'package:filcnaplo/utils/format.dart';
|
||||||
|
|
||||||
import 'package:filcnaplo_mobile_ui/common/widgets/absence/absence_view.i18n.dart';
|
import 'package:filcnaplo_mobile_ui/common/widgets/absence/absence_view.i18n.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class AbsenceSubjectView extends StatelessWidget {
|
class AbsenceSubjectView extends StatelessWidget {
|
||||||
const AbsenceSubjectView(this.subject, {Key? key, this.absences = const []}) : super(key: key);
|
const AbsenceSubjectView(this.subject, {Key? key, this.absences = const []}) : super(key: key);
|
||||||
@ -54,10 +56,12 @@ class AbsenceSubjectView extends StatelessWidget {
|
|||||||
.toList();
|
.toList();
|
||||||
List<Widget> absenceTiles = sortDateWidgets(context, dateWidgets: dateWidgets, padding: EdgeInsets.zero, hasShadow: true);
|
List<Widget> absenceTiles = sortDateWidgets(context, dateWidgets: dateWidgets, padding: EdgeInsets.zero, hasShadow: true);
|
||||||
|
|
||||||
|
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: HeroScrollView(
|
body: HeroScrollView(
|
||||||
title: subject.renamedTo ?? subject.name.capital(),
|
title: subject.renamedTo ?? subject.name.capital(),
|
||||||
italic: subject.isRenamed,
|
italic: subject.isRenamed && settingsProvider.renamedSubjectsItalics,
|
||||||
icon: SubjectIcon.resolveVariant(subject: subject, context: context),
|
icon: SubjectIcon.resolveVariant(subject: subject, context: context),
|
||||||
child: AbsenceSubjectViewContainer(
|
child: AbsenceSubjectViewContainer(
|
||||||
child: CupertinoScrollbar(
|
child: CupertinoScrollbar(
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:animations/animations.dart';
|
import 'package:animations/animations.dart';
|
||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo/utils/format.dart';
|
import 'package:filcnaplo/utils/format.dart';
|
||||||
import 'package:filcnaplo_kreta_api/providers/grade_provider.dart';
|
import 'package:filcnaplo_kreta_api/providers/grade_provider.dart';
|
||||||
import 'package:filcnaplo/helpers/average_helper.dart';
|
import 'package:filcnaplo/helpers/average_helper.dart';
|
||||||
@ -56,6 +57,7 @@ class _GradeSubjectViewState extends State<GradeSubjectView> {
|
|||||||
// Providers
|
// Providers
|
||||||
late GradeProvider gradeProvider;
|
late GradeProvider gradeProvider;
|
||||||
late GradeCalculatorProvider calculatorProvider;
|
late GradeCalculatorProvider calculatorProvider;
|
||||||
|
late SettingsProvider settingsProvider;
|
||||||
|
|
||||||
late double average;
|
late double average;
|
||||||
late Widget gradeGraph;
|
late Widget gradeGraph;
|
||||||
@ -149,6 +151,7 @@ class _GradeSubjectViewState extends State<GradeSubjectView> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
gradeProvider = Provider.of<GradeProvider>(context);
|
gradeProvider = Provider.of<GradeProvider>(context);
|
||||||
calculatorProvider = Provider.of<GradeCalculatorProvider>(context);
|
calculatorProvider = Provider.of<GradeCalculatorProvider>(context);
|
||||||
|
settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
|
|
||||||
List<Grade> subjectGrades = getSubjectGrades(widget.subject).toList();
|
List<Grade> subjectGrades = getSubjectGrades(widget.subject).toList();
|
||||||
average = AverageHelper.averageEvals(subjectGrades);
|
average = AverageHelper.averageEvals(subjectGrades);
|
||||||
@ -260,7 +263,7 @@ class _GradeSubjectViewState extends State<GradeSubjectView> {
|
|||||||
subject: widget.subject, context: context),
|
subject: widget.subject, context: context),
|
||||||
scrollController: _scrollController,
|
scrollController: _scrollController,
|
||||||
title: widget.subject.renamedTo ?? widget.subject.name.capital(),
|
title: widget.subject.renamedTo ?? widget.subject.name.capital(),
|
||||||
italic: widget.subject.isRenamed,
|
italic: settingsProvider.renamedSubjectsItalics && widget.subject.isRenamed,
|
||||||
child: SubjectGradesContainer(
|
child: SubjectGradesContainer(
|
||||||
child: CupertinoScrollbar(
|
child: CupertinoScrollbar(
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
|
@ -2,6 +2,7 @@ import 'package:animations/animations.dart';
|
|||||||
import 'package:filcnaplo/api/providers/user_provider.dart';
|
import 'package:filcnaplo/api/providers/user_provider.dart';
|
||||||
import 'package:filcnaplo/helpers/subject.dart';
|
import 'package:filcnaplo/helpers/subject.dart';
|
||||||
import 'package:filcnaplo/icons/filc_icons.dart';
|
import 'package:filcnaplo/icons/filc_icons.dart';
|
||||||
|
import 'package:filcnaplo/models/settings.dart';
|
||||||
import 'package:filcnaplo_mobile_ui/pages/home/live_card/heads_up_countdown.dart';
|
import 'package:filcnaplo_mobile_ui/pages/home/live_card/heads_up_countdown.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:filcnaplo/utils/format.dart';
|
import 'package:filcnaplo/utils/format.dart';
|
||||||
@ -43,6 +44,7 @@ class _LiveCardState extends State<LiveCard> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
liveCard = Provider.of<LiveCardProvider>(context);
|
liveCard = Provider.of<LiveCardProvider>(context);
|
||||||
|
SettingsProvider settingsProvider = Provider.of<SettingsProvider>(context);
|
||||||
|
|
||||||
if (!liveCard.show) return Container();
|
if (!liveCard.show) return Container();
|
||||||
|
|
||||||
@ -65,7 +67,7 @@ class _LiveCardState extends State<LiveCard> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Theme.of(context).colorScheme.secondary.withOpacity(.85),
|
color: Theme.of(context).colorScheme.secondary.withOpacity(.85),
|
||||||
fontStyle: liveCard.nextLesson!.subject.isRenamed ? FontStyle.italic : null),
|
fontStyle: liveCard.nextLesson!.subject.isRenamed && settingsProvider.renamedSubjectsItalics ? FontStyle.italic : null),
|
||||||
),
|
),
|
||||||
TextSpan(text: "first_lesson_2".i18n),
|
TextSpan(text: "first_lesson_2".i18n),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
@ -105,7 +107,7 @@ class _LiveCardState extends State<LiveCard> {
|
|||||||
icon: SubjectIcon.resolveVariant(subject: liveCard.currentLesson!.subject, context: context),
|
icon: SubjectIcon.resolveVariant(subject: liveCard.currentLesson!.subject, context: context),
|
||||||
description: liveCard.currentLesson!.description != "" ? Text(liveCard.currentLesson!.description) : null,
|
description: liveCard.currentLesson!.description != "" ? Text(liveCard.currentLesson!.description) : null,
|
||||||
nextSubject: liveCard.nextLesson?.subject.renamedTo ?? liveCard.nextLesson?.subject.name.capital(),
|
nextSubject: liveCard.nextLesson?.subject.renamedTo ?? liveCard.nextLesson?.subject.name.capital(),
|
||||||
nextSubjectItalic: liveCard.nextLesson?.subject.isRenamed ?? false,
|
nextSubjectItalic: liveCard.nextLesson?.subject.isRenamed == true && settingsProvider.renamedSubjectsItalics ?? false,
|
||||||
nextRoom: liveCard.nextLesson?.room,
|
nextRoom: liveCard.nextLesson?.room,
|
||||||
progressMax: showMinutes ? maxTime / 60 : maxTime,
|
progressMax: showMinutes ? maxTime / 60 : maxTime,
|
||||||
progressCurrent: showMinutes ? elapsedTime / 60 : elapsedTime,
|
progressCurrent: showMinutes ? elapsedTime / 60 : elapsedTime,
|
||||||
@ -142,7 +144,7 @@ class _LiveCardState extends State<LiveCard> {
|
|||||||
? Text("go $diff".i18n.fill([diff != "to room" ? (liveCard.nextLesson!.getFloor() ?? 0) : liveCard.nextLesson!.room]))
|
? Text("go $diff".i18n.fill([diff != "to room" ? (liveCard.nextLesson!.getFloor() ?? 0) : liveCard.nextLesson!.room]))
|
||||||
: Text("stay".i18n),
|
: Text("stay".i18n),
|
||||||
nextSubject: liveCard.nextLesson?.subject.renamedTo ?? liveCard.nextLesson?.subject.name.capital(),
|
nextSubject: liveCard.nextLesson?.subject.renamedTo ?? liveCard.nextLesson?.subject.name.capital(),
|
||||||
nextSubjectItalic: liveCard.nextLesson?.subject.isRenamed ?? false,
|
nextSubjectItalic: liveCard.nextLesson?.subject.isRenamed == true && settingsProvider.renamedSubjectsItalics ?? false,
|
||||||
nextRoom: diff != "to room" ? liveCard.nextLesson?.room : null,
|
nextRoom: diff != "to room" ? liveCard.nextLesson?.room : null,
|
||||||
progressMax: showMinutes ? maxTime / 60 : maxTime,
|
progressMax: showMinutes ? maxTime / 60 : maxTime,
|
||||||
progressCurrent: showMinutes ? elapsedTime / 60 : elapsedTime,
|
progressCurrent: showMinutes ? elapsedTime / 60 : elapsedTime,
|
||||||
|
@ -82,6 +82,7 @@ class _ModifySubjectNamesState extends State<ModifySubjectNames> {
|
|||||||
late List<Subject> subjects;
|
late List<Subject> subjects;
|
||||||
late UserProvider user;
|
late UserProvider user;
|
||||||
late DatabaseProvider dbProvider;
|
late DatabaseProvider dbProvider;
|
||||||
|
late SettingsProvider settings;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -246,6 +247,7 @@ class _ModifySubjectNamesState extends State<ModifySubjectNames> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
settings = Provider.of<SettingsProvider>(context);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: _scaffoldKey,
|
key: _scaffoldKey,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
@ -262,6 +264,10 @@ class _ModifySubjectNamesState extends State<ModifySubjectNames> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
Panel(
|
||||||
|
child: PanelButton(title: Text("italics_toggle".i18n), trailing: Switch(value: settings.renamedSubjectsItalics, onChanged: (value) => settings.update(renamedSubjectsItalics: value),)
|
||||||
|
),),
|
||||||
|
SizedBox(height: 20,),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: showRenameDialog,
|
onTap: showRenameDialog,
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
|
@ -13,6 +13,7 @@ extension SettingsLocalization on String {
|
|||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"done": "Done",
|
"done": "Done",
|
||||||
"rename_new_subject": "Rename New Subject",
|
"rename_new_subject": "Rename New Subject",
|
||||||
|
"italics_toggle": "Toggle Italics",
|
||||||
},
|
},
|
||||||
"hu_hu": {
|
"hu_hu": {
|
||||||
"renamed_subjects": "Átnevezett Tantárgyaid",
|
"renamed_subjects": "Átnevezett Tantárgyaid",
|
||||||
@ -24,6 +25,7 @@ extension SettingsLocalization on String {
|
|||||||
"cancel": "Mégse",
|
"cancel": "Mégse",
|
||||||
"done": "Kész",
|
"done": "Kész",
|
||||||
"rename_new_subject": "Új Tantárgy átnevezése",
|
"rename_new_subject": "Új Tantárgy átnevezése",
|
||||||
|
"italics_toggle": "Dőlt betűs megjelenítés",
|
||||||
},
|
},
|
||||||
"de_de": {
|
"de_de": {
|
||||||
"renamed_subjects": "Umbenannte Fächer",
|
"renamed_subjects": "Umbenannte Fächer",
|
||||||
@ -35,6 +37,7 @@ extension SettingsLocalization on String {
|
|||||||
"cancel": "Abbrechen",
|
"cancel": "Abbrechen",
|
||||||
"done": "Erledigt",
|
"done": "Erledigt",
|
||||||
"rename_new_subject": "Neues Fach umbenennen",
|
"rename_new_subject": "Neues Fach umbenennen",
|
||||||
|
"italics_toggle": "Kursivschrift umschalten",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user