mirror of
https://github.com/immich-app/immich.git
synced 2026-05-21 15:16:31 -04:00
d4a97f2d25
* refactor: app metadata * refactor to per row store * cleanup * more test * review changes * more refactor * refactor * migrate primary color * migrate dynamic theme * migrate colorfulInterface * cleanup providers --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
18 lines
790 B
Dart
18 lines
790 B
Dart
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:immich_mobile/providers/infrastructure/metadata.provider.dart';
|
|
import 'package:immich_mobile/theme/color_scheme.dart';
|
|
import 'package:immich_mobile/theme/dynamic_theme.dart';
|
|
import 'package:immich_mobile/theme/theme_data.dart';
|
|
|
|
// Provider for current selected theme
|
|
final immichThemeProvider = StateProvider<ImmichTheme>((ref) {
|
|
final themeConfig = ref.watch(appConfigProvider.select((config) => config.theme));
|
|
|
|
final ImmichTheme? dynamicTheme = DynamicTheme.theme;
|
|
final currentTheme = (themeConfig.dynamicTheme && dynamicTheme != null)
|
|
? dynamicTheme
|
|
: themeConfig.primaryColor.themeOfPreset;
|
|
|
|
return themeConfig.colorfulInterface ? currentTheme : decolorizeSurfaces(theme: currentTheme);
|
|
});
|