Add locale based font
This commit is contained in:
Binary file not shown.
@@ -19,6 +19,9 @@ class AppView extends HookConsumerWidget with PresLogger {
|
|||||||
|
|
||||||
ref.watch(commonControllersProvider);
|
ref.watch(commonControllersProvider);
|
||||||
|
|
||||||
|
// HACK temporary solution
|
||||||
|
final fontFamily = locale.languageCode == "fa" ? "Shabnam" : "";
|
||||||
|
|
||||||
return MaterialApp.router(
|
return MaterialApp.router(
|
||||||
routerConfig: router,
|
routerConfig: router,
|
||||||
locale: locale,
|
locale: locale,
|
||||||
@@ -26,8 +29,8 @@ class AppView extends HookConsumerWidget with PresLogger {
|
|||||||
localizationsDelegates: GlobalMaterialLocalizations.delegates,
|
localizationsDelegates: GlobalMaterialLocalizations.delegates,
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
themeMode: theme.themeMode,
|
themeMode: theme.themeMode,
|
||||||
theme: theme.light,
|
theme: theme.light(fontFamily: fontFamily),
|
||||||
darkTheme: theme.dark,
|
darkTheme: theme.dark(fontFamily: fontFamily),
|
||||||
title: 'Hiddify',
|
title: 'Hiddify',
|
||||||
).animate().fadeIn();
|
).animate().fadeIn();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ import 'package:hiddify/core/theme/theme_prefs.dart';
|
|||||||
|
|
||||||
// mostly exact copy of flex color scheme 7.1's fabulous 12 theme
|
// mostly exact copy of flex color scheme 7.1's fabulous 12 theme
|
||||||
extension AppTheme on ThemePrefs {
|
extension AppTheme on ThemePrefs {
|
||||||
ThemeData get light {
|
ThemeData light({
|
||||||
|
String fontFamily = "Shabnam",
|
||||||
|
}) {
|
||||||
return FlexThemeData.light(
|
return FlexThemeData.light(
|
||||||
scheme: FlexScheme.indigoM3,
|
scheme: FlexScheme.indigoM3,
|
||||||
surfaceMode: FlexSurfaceMode.highScaffoldLowSurface,
|
surfaceMode: FlexSurfaceMode.highScaffoldLowSurface,
|
||||||
@@ -59,11 +61,13 @@ extension AppTheme on ThemePrefs {
|
|||||||
),
|
),
|
||||||
tones: FlexTones.jolly(Brightness.light),
|
tones: FlexTones.jolly(Brightness.light),
|
||||||
visualDensity: FlexColorScheme.comfortablePlatformDensity,
|
visualDensity: FlexColorScheme.comfortablePlatformDensity,
|
||||||
fontFamily: "Shabnam",
|
fontFamily: fontFamily,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ThemeData get dark {
|
ThemeData dark({
|
||||||
|
String fontFamily = "Shabnam",
|
||||||
|
}) {
|
||||||
return FlexThemeData.dark(
|
return FlexThemeData.dark(
|
||||||
scheme: FlexScheme.indigoM3,
|
scheme: FlexScheme.indigoM3,
|
||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
@@ -119,7 +123,7 @@ extension AppTheme on ThemePrefs {
|
|||||||
),
|
),
|
||||||
// tones: FlexTones.jolly(Brightness.dark),
|
// tones: FlexTones.jolly(Brightness.dark),
|
||||||
visualDensity: FlexColorScheme.comfortablePlatformDensity,
|
visualDensity: FlexColorScheme.comfortablePlatformDensity,
|
||||||
fontFamily: "Shabnam",
|
fontFamily: fontFamily,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user