fondeEffectiveColorScheme function

  1. @riverpod
FondeColorScheme fondeEffectiveColorScheme(
  1. Ref ref
)

Provider that obtains the FondeColorScheme to be actually applied, based on the current theme, system brightness settings, and theme color.

Implementation

@riverpod
FondeColorScheme fondeEffectiveColorScheme(Ref ref) {
  final themeData = ref.watch(fondeActiveThemeProvider);
  final platformBrightness = ref.watch(fondePlatformBrightnessProvider);
  final themeColorType = ref.watch(fondeThemeColorProvider);

  final baseColorScheme = themeData.getEffectiveAppColorScheme(
    platformBrightness,
  );

  return FondeColorScheme.fromColorScheme(
    baseColorScheme.toColorScheme(),
    themeType: themeColorType,
  );
}