generateTheme function
- bool isDark,
- 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);
}