feat: implement dynamic theme palette selection
- Introduced a new feature allowing users to select from multiple accent color palettes for buttons, cards, and chat bubbles. - Added `AppThemePalette` provider to manage the current theme palette and persist user selections. - Updated the `AppTheme` class to utilize the selected palette for light and dark themes, enhancing visual customization. - Enhanced the `AppCustomizationPage` to include a palette selector, improving user experience and personalization options. - Updated localization files to support new palette selection UI elements in multiple languages.
This commit is contained in:
@@ -2,7 +2,7 @@ import 'dart:math' as math;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/semantics.dart';
|
||||
import '../../shared/theme/app_theme.dart';
|
||||
import '../../shared/theme/color_palettes.dart';
|
||||
import '../../shared/theme/theme_extensions.dart';
|
||||
|
||||
/// Enhanced accessibility service for WCAG 2.2 AA compliance
|
||||
@@ -349,9 +349,7 @@ class EnhancedAccessibilityService {
|
||||
return BoxDecoration(
|
||||
border: hasFocus
|
||||
? Border.all(
|
||||
color:
|
||||
focusColor ??
|
||||
AppTheme.brandPrimary, // Brand primary as fallback
|
||||
color: focusColor ?? AppColorPalettes.auroraViolet.light.primary,
|
||||
width: borderWidth,
|
||||
)
|
||||
: null,
|
||||
|
||||
@@ -35,6 +35,7 @@ class OptimizedStorageService {
|
||||
static const String _rememberCredentialsKey =
|
||||
PreferenceKeys.rememberCredentials;
|
||||
static const String _themeModeKey = PreferenceKeys.themeMode;
|
||||
static const String _themePaletteKey = PreferenceKeys.themePalette;
|
||||
static const String _localeCodeKey = PreferenceKeys.localeCode;
|
||||
static const String _localConversationsKey = HiveStoreKeys.localConversations;
|
||||
static const String _onboardingSeenKey = PreferenceKeys.onboardingSeen;
|
||||
@@ -261,6 +262,14 @@ class OptimizedStorageService {
|
||||
await _preferencesBox.put(_themeModeKey, mode);
|
||||
}
|
||||
|
||||
String? getThemePaletteId() {
|
||||
return _preferencesBox.get(_themePaletteKey) as String?;
|
||||
}
|
||||
|
||||
Future<void> setThemePaletteId(String paletteId) async {
|
||||
await _preferencesBox.put(_themePaletteKey, paletteId);
|
||||
}
|
||||
|
||||
String? getLocaleCode() {
|
||||
return _preferencesBox.get(_localeCodeKey) as String?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user