finished font family changing and sharing on client-side
This commit is contained in:
parent
4a1aa75cb2
commit
304e0ea877
@ -13,6 +13,7 @@ class SharedTheme {
|
||||
SharedGradeColors gradeColors;
|
||||
String displayName;
|
||||
ThemeMode? themeMode;
|
||||
String fontFamily;
|
||||
|
||||
SharedTheme({
|
||||
required this.json,
|
||||
@ -27,6 +28,7 @@ class SharedTheme {
|
||||
required this.gradeColors,
|
||||
this.displayName = 'displayName',
|
||||
this.themeMode,
|
||||
required this.fontFamily,
|
||||
});
|
||||
|
||||
factory SharedTheme.fromJson(Map json, SharedGradeColors gradeColors) {
|
||||
@ -45,6 +47,7 @@ class SharedTheme {
|
||||
themeMode: json['theme_mode'] == 'dark'
|
||||
? ThemeMode.dark
|
||||
: (json['theme_mode'] == 'light' ? ThemeMode.light : null),
|
||||
fontFamily: json['font_family'] ?? '',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,8 @@ class ShareProvider extends ChangeNotifier {
|
||||
'shadow_effect': settings.shadowEffect,
|
||||
'theme_mode': settings.theme == ThemeMode.dark
|
||||
? 'dark'
|
||||
: (settings.theme == ThemeMode.light ? 'light' : null)
|
||||
: (settings.theme == ThemeMode.light ? 'light' : null),
|
||||
'font_family': settings.fontFamily,
|
||||
};
|
||||
|
||||
SharedTheme theme = SharedTheme.fromJson(themeJson, gradeColors);
|
||||
|
@ -98,6 +98,7 @@ extension SettingsLocalization on String {
|
||||
"rename_teachers": "Rename Teachers",
|
||||
"show_breaks": "Show Breaks",
|
||||
"fonts": "Fonts",
|
||||
"font_family": "Font Family",
|
||||
},
|
||||
"hu_hu": {
|
||||
"personal_details": "Személyes információk",
|
||||
@ -194,6 +195,7 @@ extension SettingsLocalization on String {
|
||||
"rename_teachers": "Tanárok átnevezése",
|
||||
"show_breaks": "Szünetek megjelenítése",
|
||||
"fonts": "Betűk",
|
||||
"font_family": "Betűtípus",
|
||||
},
|
||||
"de_de": {
|
||||
"personal_details": "Persönliche Angaben",
|
||||
@ -290,6 +292,7 @@ extension SettingsLocalization on String {
|
||||
"rename_teachers": "Lehrer umbenennen",
|
||||
"show_breaks": "Pausen anzeigen",
|
||||
"fonts": "Schriftarten",
|
||||
"font_family": "Schriftfamilie",
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -560,6 +560,9 @@ class PaintListScreenState extends State<PaintListScreen>
|
||||
store: true,
|
||||
);
|
||||
|
||||
// changing font family
|
||||
settingsProvider.update(fontFamily: newThemeByID!.fontFamily);
|
||||
|
||||
// seems weird but it works, trust me (idk why)
|
||||
await settingsProvider.update(theme: settingsProvider.theme, store: true);
|
||||
Provider.of<ThemeModeObserver>(context, listen: false)
|
||||
|
@ -802,7 +802,7 @@ class PersonalizeSettingsScreenState extends State<PersonalizeSettingsScreen>
|
||||
),
|
||||
),
|
||||
leading: Icon(
|
||||
FeatherIcons.globe,
|
||||
FeatherIcons.type,
|
||||
size: 22.0,
|
||||
color: AppColors.of(context).text.withOpacity(.95),
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user