effectiveColorSchemeWithTheme function

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

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

Implementation

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

  // Get base ColorScheme
  final effectiveColorScheme = themeData.getEffectiveAppColorScheme(
    platformBrightness,
  );

  // Create a new ColorScheme with theme colors integrated
  return FondeColorScheme.fromColorScheme(
    effectiveColorScheme.toColorScheme(),
    themeType: themeColorType,
  );
}