themeFor function

ThemeData themeFor({
  1. required bool isDarkTheme,
  2. required IdeTheme ideTheme,
  3. required ThemeData theme,
})

Constructs the light or dark theme for the app taking into account IDE-supplied theming.

Implementation

ThemeData themeFor({
  required bool isDarkTheme,
  required IdeTheme ideTheme,
  required ThemeData theme,
}) {
  final colorTheme = isDarkTheme
      ? _darkTheme(ideTheme: ideTheme, theme: theme)
      : _lightTheme(ideTheme: ideTheme, theme: theme);

  return colorTheme.copyWith(
    primaryTextTheme: theme.primaryTextTheme
        .merge(colorTheme.primaryTextTheme)
        .apply(fontSizeFactor: ideTheme.fontSizeFactor),
    textTheme: theme.textTheme
        .merge(colorTheme.textTheme)
        .apply(fontSizeFactor: ideTheme.fontSizeFactor),
  );
}