Backup before removing hiddify references

This commit is contained in:
Hiddify User
2026-01-15 12:28:40 +03:00
parent f54603d129
commit 36d9e31236
231 changed files with 6648 additions and 1832 deletions

View File

@@ -20,15 +20,92 @@ class AppTheme {
}
ThemeData darkTheme(ColorScheme? darkColorScheme) {
final ColorScheme scheme = darkColorScheme ??
ColorScheme.fromSeed(
seedColor: const Color(0xFF293CA0),
brightness: Brightness.dark,
);
// Кастомная темная тема с хорошей контрастностью для блоков
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: mode.trueBlack ? Colors.black : scheme.background,
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,

View File

@@ -4,22 +4,17 @@ import 'package:hiddify/core/localization/translations.dart';
enum AppThemeMode {
system,
light,
dark,
black;
dark;
String present(TranslationsEn t) => switch (this) {
system => t.settings.general.themeModes.system,
light => t.settings.general.themeModes.light,
dark => t.settings.general.themeModes.dark,
black => t.settings.general.themeModes.black,
};
ThemeMode get flutterThemeMode => switch (this) {
system => ThemeMode.system,
light => ThemeMode.light,
dark => ThemeMode.dark,
black => ThemeMode.dark,
};
bool get trueBlack => this == black;
}

View File

@@ -9,7 +9,8 @@ class ThemePreferences extends _$ThemePreferences {
@override
AppThemeMode build() {
final persisted = ref.watch(sharedPreferencesProvider).requireValue.getString("theme_mode");
if (persisted == null) return AppThemeMode.system;
// UMBRIX: Темная тема по умолчанию
if (persisted == null) return AppThemeMode.dark;
return AppThemeMode.values.byName(persisted);
}