Files
umbrix/lib/core/theme/app_theme.dart
Umbrix Developer 76a374950f feat: mobile-like window size and always-visible stats
- Changed window size to mobile phone format (400x800)
- Removed width condition for ActiveProxyFooter - now always visible
- Added run-umbrix.sh launch script with icon copying
- Stats cards now display on all screen sizes
2026-01-17 13:09:20 +03:00

116 lines
4.5 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:flutter/material.dart';
import 'package:umbrix/core/theme/app_theme_mode.dart';
import 'package:umbrix/core/theme/theme_extensions.dart';
class AppTheme {
AppTheme(this.mode, this.fontFamily);
final AppThemeMode mode;
final String fontFamily;
ThemeData lightTheme(ColorScheme? lightColorScheme) {
final ColorScheme scheme = lightColorScheme ?? ColorScheme.fromSeed(seedColor: const Color(0xFF293CA0));
return ThemeData(
useMaterial3: true,
colorScheme: scheme,
fontFamily: fontFamily,
extensions: const <ThemeExtension<dynamic>>{
ConnectionButtonTheme.light,
},
);
}
ThemeData darkTheme(ColorScheme? darkColorScheme) {
// Кастомная темная тема с хорошей контрастностью для блоков
const ColorScheme scheme = ColorScheme(
brightness: Brightness.dark,
// Основной цвет Outline - бирюзовый
primary: Color(0xFF2fbea5), // hsl(170, 60%, 46%)
onPrimary: Color(0xFFFFFFFF), // Белый текст на кнопках
primaryContainer: Color(0xFF005048),
onPrimaryContainer: Color(0xFF7df8dd),
// Фон карточек/блоков - заметно светлее фона приложения
surface: Color(0xFF263238), // Светло-серый для карточек
onSurface: Color(0xFFE1E2E6), // Светлый текст на карточках
surfaceContainerHighest: Color(0xFF37474F), // Еще светлее для выделенных элементов
// Дополнительные цвета
secondary: Color(0xFF2fbea5),
onSecondary: Color(0xFFFFFFFF), // Белый текст
secondaryContainer: Color(0xFF005048),
onSecondaryContainer: Color(0xFF7df8dd),
// Ошибки
error: Color(0xFFf44336),
onError: Color(0xFFFFFFFF),
errorContainer: Color(0xFF93000a),
onErrorContainer: Color(0xFFffdad6),
// Контуры и границы - видимые
outline: Color(0xFF4CAF50), // Зеленоватый контур для видимости
outlineVariant: Color(0xFF546E7A),
);
return ThemeData(
useMaterial3: true,
colorScheme: scheme,
scaffoldBackgroundColor: const Color(0xFF191f23), // Очень темный фон
cardTheme: CardTheme(
elevation: 4,
shadowColor: Colors.black45,
surfaceTintColor: const Color(0xFF2fbea5), // Легкий бирюзовый оттенок
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
side: const BorderSide(
color: Color(0xFF37474F), // Видимая граница карточки
),
),
),
// Настройка текста кнопок
textTheme: const TextTheme(
labelLarge: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 14,
),
),
filledButtonTheme: FilledButtonThemeData(
style: ButtonStyle(
foregroundColor: WidgetStateProperty.all(const Color(0xFFFFFFFF)), // Белый текст
backgroundColor: WidgetStateProperty.resolveWith<Color>((states) {
if (states.contains(WidgetState.disabled)) {
return const Color(0xFF263238).withOpacity(0.5);
}
return const Color(0xFF263238); // Темно-серый фон
}),
elevation: WidgetStateProperty.all(4),
shadowColor: WidgetStateProperty.all(Colors.black45),
padding: WidgetStateProperty.all(
const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
),
shape: WidgetStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
),
textStyle: WidgetStateProperty.all(
const TextStyle(
fontWeight: FontWeight.w600,
fontSize: 14,
),
),
),
),
outlinedButtonTheme: OutlinedButtonThemeData(
style: OutlinedButton.styleFrom(
foregroundColor: const Color(0xFF2fbea5), // Бирюзовый текст
side: const BorderSide(color: Color(0xFF2fbea5), width: 1.5),
textStyle: const TextStyle(
fontWeight: FontWeight.w600,
fontSize: 14,
),
),
),
fontFamily: fontFamily,
extensions: const <ThemeExtension<dynamic>>{
ConnectionButtonTheme.light,
},
);
}
}