generateTheme function

ThemeData generateTheme (
  1. bool isDark,
  2. MaterialColor color
)

Returns constant theme

Implementation

ThemeData generateTheme(bool isDark, MaterialColor color) {
  if (isDark)
    return ThemeData.dark().copyWith(
        primaryColor: foreground,
        accentColor: color,
        floatingActionButtonTheme: FloatingActionButtonThemeData(
          backgroundColor: color,
        ),
        backgroundColor: background);
  else
    return ThemeData.light().copyWith(
        accentColor: color,
        floatingActionButtonTheme: FloatingActionButtonThemeData(
          backgroundColor: color,
        ),
        primaryColor: background,
        backgroundColor: foreground);
}