ThemeProvider.defaultThemes constructor Null safety

ThemeProvider.defaultThemes(
  1. {Color? accentColor,
  2. Color? primaryColor,
  3. DividerThemeData? dividerTheme,
  4. ThemeMode themeMode = ThemeMode.dark}
)

Implementation

factory ThemeProvider.defaultThemes(
    {Color? accentColor, Color? primaryColor, DividerThemeData? dividerTheme, ThemeMode themeMode = ThemeMode.dark}) {
  ThemeData darkTheme = ThemeData(
    accentColor: accentColor,
    brightness: Brightness.dark,
    primaryColor: primaryColor,
    dividerTheme: dividerTheme,
  );

  ThemeData lightTheme = ThemeData(
    accentColor: accentColor,
    brightness: Brightness.light,
    primaryColor: primaryColor,
  );
  return ThemeProvider(darkTheme: darkTheme, lightTheme: lightTheme, themeMode: themeMode);
}