From ead44f1b1a5c352f91a484d0560bdfab7997cb64 Mon Sep 17 00:00:00 2001 From: Artem Luzin m Date: Tue, 17 Jun 2025 20:44:23 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B2=D0=B8=D0=B7=D1=83=D0=B0=D0=BB=D1=8C=D0=BD?= =?UTF-8?q?=D1=8B=D0=B9=20=D1=8D=D0=BB=D0=B5=D0=BC=D0=B5=D0=BD=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/app/theme/app_colors_scheme.dart | 12 ++++++++++- lib/features/debug/screens/theme_screen.dart | 21 +++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/lib/app/theme/app_colors_scheme.dart b/lib/app/theme/app_colors_scheme.dart index 36303b1..80df22c 100644 --- a/lib/app/theme/app_colors_scheme.dart +++ b/lib/app/theme/app_colors_scheme.dart @@ -13,16 +13,21 @@ class AppColors extends ThemeExtension with DiagnosticableTreeMixin { /// * [errorSnackbarBackground] - цвет фона снекбара ошибки /// * [successSnackbarBackground] - цвет фона снекбара успеха /// * [infoSnackbarBackground] - цвет фона снекбара информации + /// * [itemTextColor] - цвет элемента текста const AppColors({ required this.testColor, + required this.itemTextColor, required this.errorSnackbarBackground, required this.successSnackbarBackground, required this.infoSnackbarBackground, }); - /// Цвет тестового текста + /// Цвет тестовый final Color testColor; + /// Цвет элемента текста + final Color itemTextColor; + /// Цвет фона снекбара ошибки final Color errorSnackbarBackground; @@ -38,6 +43,7 @@ class AppColors extends ThemeExtension with DiagnosticableTreeMixin { errorSnackbarBackground: const Color(0xFFD24720), successSnackbarBackground: const Color(0xFF6FB62C), infoSnackbarBackground: const Color.fromARGB(255, 220, 108, 77), + itemTextColor: const Color(0xFFFAF3EB), ); /// Цвета тёмной темы @@ -46,6 +52,7 @@ class AppColors extends ThemeExtension with DiagnosticableTreeMixin { errorSnackbarBackground: const Color(0xFF638B8B), successSnackbarBackground: const Color(0xFF93C499), infoSnackbarBackground: const Color.fromARGB(255, 35, 147, 178), + itemTextColor: Colors.white, ); @override @@ -54,6 +61,7 @@ class AppColors extends ThemeExtension with DiagnosticableTreeMixin { Color? errorSnackbarBackground, Color? successSnackbarBackground, Color? infoSnackbarBackground, + Color? itemTextColor, }) => AppColors( testColor: testColor ?? this.testColor, errorSnackbarBackground: @@ -62,6 +70,7 @@ class AppColors extends ThemeExtension with DiagnosticableTreeMixin { successSnackbarBackground ?? this.successSnackbarBackground, infoSnackbarBackground: infoSnackbarBackground ?? this.infoSnackbarBackground, + itemTextColor: itemTextColor ?? this.itemTextColor, ); @override @@ -88,6 +97,7 @@ class AppColors extends ThemeExtension with DiagnosticableTreeMixin { other.infoSnackbarBackground, t, )!, + itemTextColor: Color.lerp(itemTextColor, other.itemTextColor, t)!, ); } } diff --git a/lib/features/debug/screens/theme_screen.dart b/lib/features/debug/screens/theme_screen.dart index 6bbbb6d..4d591af 100644 --- a/lib/features/debug/screens/theme_screen.dart +++ b/lib/features/debug/screens/theme_screen.dart @@ -10,6 +10,7 @@ class ThemeScreen extends StatelessWidget { @override Widget build(BuildContext context) { + final colors = context.colors; return Scaffold( appBar: AppBar(title: const Text('Theme')), body: Center( @@ -28,7 +29,25 @@ class ThemeScreen extends StatelessWidget { child: const SizedBox(height: 100, width: 100), ), const SizedBox(height: 16), - Text('Текущая тема: ${context.theme.themeMode}'), + Card( + elevation: 4, + shadowColor: colors.infoSnackbarBackground, + margin: const EdgeInsets.symmetric(vertical: 10), + color: colors.infoSnackbarBackground, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + ), + child: ListTile( + title: Text( + 'Текущая тема: ${context.theme.themeMode}', + style: TextStyle( + color: colors.itemTextColor, + fontWeight: FontWeight.bold, + ), + ), + trailing: Icon(Icons.color_lens, color: colors.itemTextColor), + ), + ), ], ), ),