ThemeCollection constructor

ThemeCollection({
  1. Map<int, ThemeData>? themes,
  2. ThemeData? fallbackTheme,
})

Creates a new ThemeCollection.

themes is an optional paramter of a map, that already contains themes corresponding to theme IDs.

fallbackTheme is a fallback theme, that is returned by getTheme

Implementation

ThemeCollection({Map<int, ThemeData>? themes, ThemeData? fallbackTheme}) {
  if (themes == null) {
    themes = Map<int, ThemeData>();
  } else {
    _themes = themes;
  }

  if (fallbackTheme == null) {
    _fallbackTheme = ThemeData.fallback();
  } else {
    _fallbackTheme = fallbackTheme;
  }
}