custom font improvements
This commit is contained in:
@@ -4,7 +4,9 @@ import 'dart:math';
|
||||
|
||||
import 'package:animations/animations.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:refilc/api/providers/update_provider.dart';
|
||||
import 'package:refilc/models/settings.dart';
|
||||
import 'package:refilc/theme/colors/utils.dart';
|
||||
import 'package:refilc/ui/date_widget.dart';
|
||||
import 'package:refilc_kreta_api/models/absence.dart';
|
||||
@@ -180,10 +182,22 @@ class AbsencesPageState extends State<AbsencesPage>
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: Text(
|
||||
"Absences".i18n,
|
||||
style: TextStyle(
|
||||
color: AppColors.of(context).text,
|
||||
fontSize: 32.0,
|
||||
fontWeight: FontWeight.bold),
|
||||
style: Provider.of<SettingsProvider>(context).fontFamily !=
|
||||
'' &&
|
||||
Provider.of<SettingsProvider>(context).titleOnlyFont
|
||||
? GoogleFonts.getFont(
|
||||
Provider.of<SettingsProvider>(context).fontFamily,
|
||||
textStyle: TextStyle(
|
||||
color: AppColors.of(context).text,
|
||||
fontSize: 32.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
)
|
||||
: TextStyle(
|
||||
color: AppColors.of(context).text,
|
||||
fontSize: 32.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
bottom: FilterBar(
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'dart:math';
|
||||
|
||||
import 'package:auto_size_text/auto_size_text.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:refilc/api/providers/update_provider.dart';
|
||||
import 'package:refilc/models/settings.dart';
|
||||
import 'package:refilc/ui/widgets/grade/grade_tile.dart';
|
||||
@@ -576,10 +577,20 @@ class GradesPageState extends State<GradesPage> {
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: Text(
|
||||
"Grades".i18n,
|
||||
style: TextStyle(
|
||||
color: AppColors.of(context).text,
|
||||
fontSize: 32.0,
|
||||
fontWeight: FontWeight.bold),
|
||||
style: Provider.of<SettingsProvider>(context).fontFamily !=
|
||||
'' &&
|
||||
Provider.of<SettingsProvider>(context).titleOnlyFont
|
||||
? GoogleFonts.getFont(
|
||||
Provider.of<SettingsProvider>(context).fontFamily,
|
||||
textStyle: TextStyle(
|
||||
color: AppColors.of(context).text,
|
||||
fontSize: 32.0,
|
||||
fontWeight: FontWeight.bold),
|
||||
)
|
||||
: TextStyle(
|
||||
color: AppColors.of(context).text,
|
||||
fontSize: 32.0,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
shadowColor: Theme.of(context).shadowColor,
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'dart:math';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:refilc/api/providers/live_card_provider.dart';
|
||||
import 'package:refilc/theme/colors/colors.dart';
|
||||
import 'package:refilc/ui/date_widget.dart';
|
||||
@@ -244,14 +245,34 @@ class HomePageState extends State<HomePage> with TickerProviderStateMixin {
|
||||
greeting,
|
||||
overflow: TextOverflow.fade,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18.0,
|
||||
color: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium
|
||||
?.color,
|
||||
),
|
||||
style:
|
||||
Provider.of<SettingsProvider>(context)
|
||||
.fontFamily !=
|
||||
'' &&
|
||||
Provider.of<SettingsProvider>(
|
||||
context)
|
||||
.titleOnlyFont
|
||||
? GoogleFonts.getFont(
|
||||
Provider.of<SettingsProvider>(
|
||||
context)
|
||||
.fontFamily,
|
||||
textStyle: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18.0,
|
||||
color: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium
|
||||
?.color,
|
||||
),
|
||||
)
|
||||
: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18.0,
|
||||
color: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium
|
||||
?.color,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
DateFormat('EEEE, MMM d',
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:refilc/api/providers/update_provider.dart';
|
||||
import 'package:refilc/models/settings.dart';
|
||||
import 'package:refilc/ui/date_widget.dart';
|
||||
import 'package:refilc_kreta_api/providers/message_provider.dart';
|
||||
import 'package:refilc/api/providers/user_provider.dart';
|
||||
@@ -129,10 +131,22 @@ class MessagesPageState extends State<MessagesPage>
|
||||
),
|
||||
Text(
|
||||
"Messages".i18n,
|
||||
style: TextStyle(
|
||||
color: AppColors.of(context).text,
|
||||
fontSize: 32.0,
|
||||
fontWeight: FontWeight.bold),
|
||||
style: Provider.of<SettingsProvider>(context)
|
||||
.fontFamily !=
|
||||
'' &&
|
||||
Provider.of<SettingsProvider>(context)
|
||||
.titleOnlyFont
|
||||
? GoogleFonts.getFont(
|
||||
Provider.of<SettingsProvider>(context).fontFamily,
|
||||
textStyle: TextStyle(
|
||||
color: AppColors.of(context).text,
|
||||
fontSize: 32.0,
|
||||
fontWeight: FontWeight.bold),
|
||||
)
|
||||
: TextStyle(
|
||||
color: AppColors.of(context).text,
|
||||
fontSize: 32.0,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'dart:math';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:refilc/api/providers/database_provider.dart';
|
||||
import 'package:refilc/api/providers/self_note_provider.dart';
|
||||
import 'package:refilc/api/providers/update_provider.dart';
|
||||
@@ -326,10 +327,20 @@ class NotesPageState extends State<NotesPage> with TickerProviderStateMixin {
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: Text(
|
||||
"notes".i18n,
|
||||
style: TextStyle(
|
||||
color: AppColors.of(context).text,
|
||||
fontSize: 32.0,
|
||||
fontWeight: FontWeight.bold),
|
||||
style: Provider.of<SettingsProvider>(context).fontFamily !=
|
||||
'' &&
|
||||
Provider.of<SettingsProvider>(context).titleOnlyFont
|
||||
? GoogleFonts.getFont(
|
||||
Provider.of<SettingsProvider>(context).fontFamily,
|
||||
textStyle: TextStyle(
|
||||
color: AppColors.of(context).text,
|
||||
fontSize: 32.0,
|
||||
fontWeight: FontWeight.bold),
|
||||
)
|
||||
: TextStyle(
|
||||
color: AppColors.of(context).text,
|
||||
fontSize: 32.0,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:refilc/models/settings.dart';
|
||||
import 'package:refilc/theme/colors/colors.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:refilc/utils/format.dart';
|
||||
@@ -50,11 +53,26 @@ class _DayTitleState extends State<DayTitle> {
|
||||
width: MediaQuery.of(context).size.width / 1.5,
|
||||
child: Text(
|
||||
widget.dayTitle(index).capital(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
AppColors.of(context).text.withOpacity(opacity),
|
||||
fontSize: 32.0,
|
||||
fontWeight: FontWeight.bold),
|
||||
style: Provider.of<SettingsProvider>(context)
|
||||
.fontFamily !=
|
||||
'' &&
|
||||
Provider.of<SettingsProvider>(context)
|
||||
.titleOnlyFont
|
||||
? GoogleFonts.getFont(
|
||||
Provider.of<SettingsProvider>(context).fontFamily,
|
||||
textStyle: TextStyle(
|
||||
color: AppColors.of(context)
|
||||
.text
|
||||
.withOpacity(opacity),
|
||||
fontSize: 32.0,
|
||||
fontWeight: FontWeight.bold),
|
||||
)
|
||||
: TextStyle(
|
||||
color: AppColors.of(context)
|
||||
.text
|
||||
.withOpacity(opacity),
|
||||
fontSize: 32.0,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:math';
|
||||
import 'package:animations/animations.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:i18n_extension/i18n_extension.dart';
|
||||
import 'package:refilc/api/providers/database_provider.dart';
|
||||
import 'package:refilc/api/providers/update_provider.dart';
|
||||
@@ -375,11 +376,25 @@ class TimetablePageState extends State<TimetablePage>
|
||||
} else {
|
||||
return Text(
|
||||
"timetable".i18n,
|
||||
style: TextStyle(
|
||||
fontSize: 32.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColors.of(context).text,
|
||||
),
|
||||
style: Provider.of<SettingsProvider>(context)
|
||||
.fontFamily !=
|
||||
'' &&
|
||||
Provider.of<SettingsProvider>(context)
|
||||
.titleOnlyFont
|
||||
? GoogleFonts.getFont(
|
||||
Provider.of<SettingsProvider>(context)
|
||||
.fontFamily,
|
||||
textStyle: TextStyle(
|
||||
fontSize: 32.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColors.of(context).text,
|
||||
),
|
||||
)
|
||||
: TextStyle(
|
||||
fontSize: 32.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColors.of(context).text,
|
||||
),
|
||||
);
|
||||
}
|
||||
}(),
|
||||
|
||||
@@ -119,6 +119,8 @@ extension SettingsLocalization on String {
|
||||
// grade streak
|
||||
"grade_streak": "Grade 5 Streak",
|
||||
"grade_streak_subtitle": "So many 5s in a row?!",
|
||||
// other
|
||||
"only_ch_title_font": "Font Only for Titles",
|
||||
},
|
||||
"hu_hu": {
|
||||
"personal_details": "Személyes információk",
|
||||
@@ -236,6 +238,8 @@ extension SettingsLocalization on String {
|
||||
// grade streak
|
||||
"grade_streak": "5-ös sorozat",
|
||||
"grade_streak_subtitle": "Egymás után ennyi 5-ös?!",
|
||||
// other
|
||||
"only_ch_title_font": "Betűtípus csak címekre",
|
||||
},
|
||||
"de_de": {
|
||||
"personal_details": "Persönliche Angaben",
|
||||
@@ -353,6 +357,8 @@ extension SettingsLocalization on String {
|
||||
// grade streak
|
||||
"grade_streak": "5er-Streak",
|
||||
"grade_streak_subtitle": "So viele 5er in Folge?!",
|
||||
// other
|
||||
"only_ch_title_font": "Schriftart nur für Titel",
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -890,7 +890,7 @@ class PersonalizeSettingsScreenState extends State<PersonalizeSettingsScreen>
|
||||
title: Text('fonts'.i18n),
|
||||
padding: EdgeInsets.zero,
|
||||
cardPadding: const EdgeInsets.all(4.0),
|
||||
isSeparated: true,
|
||||
isSeparated: false,
|
||||
children: [
|
||||
PanelButton(
|
||||
onPressed: () {
|
||||
@@ -928,6 +928,63 @@ class PersonalizeSettingsScreenState extends State<PersonalizeSettingsScreen>
|
||||
),
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
top: Radius.circular(12.0),
|
||||
bottom: Radius.circular(6.0),
|
||||
),
|
||||
),
|
||||
PanelButton(
|
||||
padding: const EdgeInsets.only(left: 14.0, right: 6.0),
|
||||
onPressed: () async {
|
||||
if (!Provider.of<PlusProvider>(context, listen: false)
|
||||
.hasScope(PremiumScopes.customFont)) {
|
||||
PlusLockedFeaturePopup.show(
|
||||
context: context,
|
||||
feature: PremiumFeature.fontChange);
|
||||
return;
|
||||
}
|
||||
|
||||
settingsProvider.update(
|
||||
titleOnlyFont: !settingsProvider.titleOnlyFont);
|
||||
Provider.of<ThemeModeObserver>(context, listen: false)
|
||||
.changeTheme(settingsProvider.theme,
|
||||
updateNavbarColor: false);
|
||||
setState(() {});
|
||||
},
|
||||
title: Text(
|
||||
"only_ch_title_font".i18n,
|
||||
style: TextStyle(
|
||||
color: AppColors.of(context).text.withOpacity(
|
||||
settingsProvider.titleOnlyFont ? .95 : .25),
|
||||
),
|
||||
),
|
||||
leading: Icon(
|
||||
Icons.text_increase_rounded,
|
||||
size: 22.0,
|
||||
color: AppColors.of(context).text.withOpacity(
|
||||
settingsProvider.titleOnlyFont ? .95 : .25),
|
||||
),
|
||||
trailing: Switch(
|
||||
onChanged: (v) async {
|
||||
if (!Provider.of<PlusProvider>(context,
|
||||
listen: false)
|
||||
.hasScope(PremiumScopes.customFont)) {
|
||||
PlusLockedFeaturePopup.show(
|
||||
context: context,
|
||||
feature: PremiumFeature.fontChange);
|
||||
return;
|
||||
}
|
||||
|
||||
settingsProvider.update(titleOnlyFont: v);
|
||||
Provider.of<ThemeModeObserver>(context,
|
||||
listen: false)
|
||||
.changeTheme(settingsProvider.theme,
|
||||
updateNavbarColor: false);
|
||||
setState(() {});
|
||||
},
|
||||
value: settingsProvider.titleOnlyFont,
|
||||
activeColor: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
top: Radius.circular(4.0),
|
||||
bottom: Radius.circular(12.0),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user