ContentTheme constructor
ContentTheme({
- Color? primary,
- Color? background,
- Color? text,
- List<
ColorToken> colors = const [], - FontFamily? font,
- FontFamily? codeFont,
- ContentTypography? typography,
- Iterable<
ThemeExtension< extensions = const [],Object?> >
Creates a default theme and applies the provided colors, fonts and styles.
Implementation
ContentTheme({
Color? primary,
Color? background,
Color? text,
List<ColorToken> colors = const [],
FontFamily? font,
FontFamily? codeFont,
ContentTypography? typography,
Iterable<ThemeExtension<Object?>> extensions = const [],
}) : colors = ContentColors._base.apply(
colors: [
...colors,
if (primary != null) ContentColors.primary.apply(primary),
if (background != null) ContentColors.background.apply(background),
if (text != null) ContentColors.text.apply(text),
],
),
font = font ?? defaultFont,
codeFont = codeFont ?? defaultCodeFont,
typography = typography ?? ContentTypography.base,
extensions = Map<Object, ThemeExtension<Object?>>.unmodifiable(<Object, ThemeExtension<Object?>>{
for (final ThemeExtension<Object?> extension in extensions)
extension.type: extension as ThemeExtension<ThemeExtension<Object?>>,
}),
reset = true;