This commit is contained in:
2026-03-22 17:12:40 +03:00
parent 741a519687
commit f013753f80
17 changed files with 48 additions and 27 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 KiB

After

Width:  |  Height:  |  Size: 171 KiB

Before

Width:  |  Height:  |  Size: 186 KiB

After

Width:  |  Height:  |  Size: 186 KiB

Before

Width:  |  Height:  |  Size: 448 KiB

After

Width:  |  Height:  |  Size: 448 KiB

Before

Width:  |  Height:  |  Size: 429 KiB

After

Width:  |  Height:  |  Size: 429 KiB

+25 -20
View File
@@ -2,34 +2,39 @@ import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import '../core/constants.dart'; import '../core/constants.dart';
final _nunitoFamily = GoogleFonts.nunito().fontFamily;
TextTheme _withCyrillicFallback(TextTheme theme) { TextStyle? _f(TextStyle? s) {
return theme.copyWith( final result = s?.copyWith(fontFamilyFallback: ['NunitoCyrillic']);
displayLarge: theme.displayLarge?.copyWith(fontFamilyFallback: [_nunitoFamily!]), debugPrint('fallback: ${result?.fontFamilyFallback}'); // проверь в логах
displayMedium: theme.displayMedium?.copyWith(fontFamilyFallback: [_nunitoFamily!]), return result;
displaySmall: theme.displaySmall?.copyWith(fontFamilyFallback: [_nunitoFamily!]),
headlineLarge: theme.headlineLarge?.copyWith(fontFamilyFallback: [_nunitoFamily!]),
headlineMedium: theme.headlineMedium?.copyWith(fontFamilyFallback: [_nunitoFamily!]),
headlineSmall: theme.headlineSmall?.copyWith(fontFamilyFallback: [_nunitoFamily!]),
titleLarge: theme.titleLarge?.copyWith(fontFamilyFallback: [_nunitoFamily!]),
titleMedium: theme.titleMedium?.copyWith(fontFamilyFallback: [_nunitoFamily!]),
titleSmall: theme.titleSmall?.copyWith(fontFamilyFallback: [_nunitoFamily!]),
bodyLarge: theme.bodyLarge?.copyWith(fontFamilyFallback: [_nunitoFamily!]),
bodyMedium: theme.bodyMedium?.copyWith(fontFamilyFallback: [_nunitoFamily!]),
bodySmall: theme.bodySmall?.copyWith(fontFamilyFallback: [_nunitoFamily!]),
labelLarge: theme.labelLarge?.copyWith(fontFamilyFallback: [_nunitoFamily!]),
labelMedium: theme.labelMedium?.copyWith(fontFamilyFallback: [_nunitoFamily!]),
labelSmall: theme.labelSmall?.copyWith(fontFamilyFallback: [_nunitoFamily!]),
);
} }
TextTheme _withCyrillicFallback(TextTheme t) => TextTheme(
displayLarge: _f(t.displayLarge),
displayMedium: _f(t.displayMedium),
displaySmall: _f(t.displaySmall),
headlineLarge: _f(t.headlineLarge),
headlineMedium: _f(t.headlineMedium),
headlineSmall: _f(t.headlineSmall),
titleLarge: _f(t.titleLarge),
titleMedium: _f(t.titleMedium),
titleSmall: _f(t.titleSmall),
bodyLarge: _f(t.bodyLarge),
bodyMedium: _f(t.bodyMedium),
bodySmall: _f(t.bodySmall),
labelLarge: _f(t.labelLarge),
labelMedium: _f(t.labelMedium),
labelSmall: _f(t.labelSmall),
);
class AppTheme { class AppTheme {
static ThemeData get darkTheme { static ThemeData get darkTheme {
final base = ThemeData.dark(useMaterial3: true); final base = ThemeData.dark(useMaterial3: true);
final textTheme = _withCyrillicFallback( final textTheme = _withCyrillicFallback(
GoogleFonts.poppinsTextTheme(base.textTheme).apply( base.textTheme.apply(
fontFamily: 'Poppins',
bodyColor: AppColors.textPrimary, bodyColor: AppColors.textPrimary,
displayColor: AppColors.textPrimary, displayColor: AppColors.textPrimary,
), ),
-7
View File
@@ -14,13 +14,6 @@ void main() async {
await initializeDateFormatting('ru_RU', null); await initializeDateFormatting('ru_RU', null);
await initializeDateFormatting('en', null); await initializeDateFormatting('en', null);
await initializeDateFormatting('ru', null); await initializeDateFormatting('ru', null);
await GoogleFonts.pendingFonts([
GoogleFonts.nunito(),
GoogleFonts.nunito(fontWeight: FontWeight.w600),
GoogleFonts.nunito(fontWeight: FontWeight.w700),
GoogleFonts.nunito(fontWeight: FontWeight.w800),
]);
final prefs = await SharedPreferences.getInstance(); final prefs = await SharedPreferences.getInstance();
await HapticService.init(); await HapticService.init();
+23
View File
@@ -53,3 +53,26 @@ dev_dependencies:
flutter: flutter:
uses-material-design: true uses-material-design: true
fonts:
- family: NunitoCyrillic
fonts:
- asset: assets/fonts/nunito/Nunito-Medium.ttf
- asset: assets/fonts/nunito/Nunito-SemiBold.ttf
weight: 500
- asset: assets/fonts/nunito/Nunito-Bold.ttf
weight: 600
- asset: assets/fonts/nunito/Nunito-ExtraBold.ttf
weight: 700
- asset: assets/fonts/nunito/Nunito-ExtraBold.ttf
weight: 800
- family: Poppins
fonts:
- asset: assets/fonts/poppins/Poppins-Regular.ttf
- asset: assets/fonts/poppins/Poppins-Medium.ttf
weight: 500
- asset: assets/fonts/poppins/Poppins-SemiBold.ttf
weight: 600
- asset: assets/fonts/poppins/Poppins-Bold.ttf
weight: 700
- asset: assets/fonts/poppins/Poppins-ExtraBold.ttf
weight: 800