ColorScheme.light constructor
- Brightness brightness = Brightness.light,
- Color primary = const Color(0xff6200ee),
- Color onPrimary = Colors.white,
- Color? primaryContainer,
- Color? onPrimaryContainer,
- Color? primaryFixed,
- Color? primaryFixedDim,
- Color? onPrimaryFixed,
- Color? onPrimaryFixedVariant,
- Color secondary = const Color(0xff03dac6),
- Color onSecondary = Colors.black,
- Color? secondaryContainer,
- Color? onSecondaryContainer,
- Color? secondaryFixed,
- Color? secondaryFixedDim,
- Color? onSecondaryFixed,
- Color? onSecondaryFixedVariant,
- Color? tertiary,
- Color? onTertiary,
- Color? tertiaryContainer,
- Color? onTertiaryContainer,
- Color? tertiaryFixed,
- Color? tertiaryFixedDim,
- Color? onTertiaryFixed,
- Color? onTertiaryFixedVariant,
- Color error = const Color(0xffb00020),
- Color onError = Colors.white,
- Color? errorContainer,
- Color? onErrorContainer,
- Color surface = Colors.white,
- Color onSurface = Colors.black,
- Color? surfaceDim,
- Color? surfaceBright,
- Color? surfaceContainerLowest,
- Color? surfaceContainerLow,
- Color? surfaceContainer,
- Color? surfaceContainerHigh,
- Color? surfaceContainerHighest,
- Color? onSurfaceVariant,
- Color? outline,
- Color? outlineVariant,
- Color? shadow,
- Color? scrim,
- Color? inverseSurface,
- Color? onInverseSurface,
- Color? inversePrimary,
- Color? surfaceTint,
- @Deprecated('Use surface instead. ' 'This feature was deprecated after v3.18.0-0.1.pre.') Color? background = Colors.white,
- @Deprecated('Use onSurface instead. ' 'This feature was deprecated after v3.18.0-0.1.pre.') Color? onBackground = Colors.black,
- @Deprecated('Use surfaceContainerHighest instead. ' 'This feature was deprecated after v3.18.0-0.1.pre.') Color? surfaceVariant,
Create a light ColorScheme based on a purple primary color that matches the baseline Material 2 color scheme.
This constructor shouldn't be used to update the Material 3 color scheme.
For Material 3, use ColorScheme.fromSeed to create a color scheme from a single seed color based on the Material 3 color system.
This example demonstrates how to create a color scheme similar to ColorScheme.light
using the ColorScheme.fromSeed constructor:
link
colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xff6200ee)).copyWith(
primaryContainer: const Color(0xff6200ee),
onPrimaryContainer: Colors.white,
secondaryContainer: const Color(0xff03dac6),
onSecondaryContainer: Colors.black,
error: const Color(0xffb00020),
onError: Colors.white,
),
Implementation
const ColorScheme.light({
this.brightness = Brightness.light,
this.primary = const Color(0xff6200ee),
this.onPrimary = Colors.white,
Color? primaryContainer,
Color? onPrimaryContainer,
Color? primaryFixed,
Color? primaryFixedDim,
Color? onPrimaryFixed,
Color? onPrimaryFixedVariant,
this.secondary = const Color(0xff03dac6),
this.onSecondary = Colors.black,
Color? secondaryContainer,
Color? onSecondaryContainer,
Color? secondaryFixed,
Color? secondaryFixedDim,
Color? onSecondaryFixed,
Color? onSecondaryFixedVariant,
Color? tertiary,
Color? onTertiary,
Color? tertiaryContainer,
Color? onTertiaryContainer,
Color? tertiaryFixed,
Color? tertiaryFixedDim,
Color? onTertiaryFixed,
Color? onTertiaryFixedVariant,
this.error = const Color(0xffb00020),
this.onError = Colors.white,
Color? errorContainer,
Color? onErrorContainer,
this.surface = Colors.white,
this.onSurface = Colors.black,
Color? surfaceDim,
Color? surfaceBright,
Color? surfaceContainerLowest,
Color? surfaceContainerLow,
Color? surfaceContainer,
Color? surfaceContainerHigh,
Color? surfaceContainerHighest,
Color? onSurfaceVariant,
Color? outline,
Color? outlineVariant,
Color? shadow,
Color? scrim,
Color? inverseSurface,
Color? onInverseSurface,
Color? inversePrimary,
Color? surfaceTint,
@Deprecated(
'Use surface instead. '
'This feature was deprecated after v3.18.0-0.1.pre.'
)
Color? background = Colors.white,
@Deprecated(
'Use onSurface instead. '
'This feature was deprecated after v3.18.0-0.1.pre.'
)
Color? onBackground = Colors.black,
@Deprecated(
'Use surfaceContainerHighest instead. '
'This feature was deprecated after v3.18.0-0.1.pre.'
)
Color? surfaceVariant
}) : _primaryContainer = primaryContainer,
_onPrimaryContainer = onPrimaryContainer,
_primaryFixed = primaryFixed,
_primaryFixedDim = primaryFixedDim,
_onPrimaryFixed = onPrimaryFixed,
_onPrimaryFixedVariant = onPrimaryFixedVariant,
_secondaryContainer = secondaryContainer,
_onSecondaryContainer = onSecondaryContainer,
_secondaryFixed = secondaryFixed,
_secondaryFixedDim = secondaryFixedDim,
_onSecondaryFixed = onSecondaryFixed,
_onSecondaryFixedVariant = onSecondaryFixedVariant,
_tertiary = tertiary,
_onTertiary = onTertiary,
_tertiaryContainer = tertiaryContainer,
_onTertiaryContainer = onTertiaryContainer,
_tertiaryFixed = tertiaryFixed,
_tertiaryFixedDim = tertiaryFixedDim,
_onTertiaryFixed = onTertiaryFixed,
_onTertiaryFixedVariant = onTertiaryFixedVariant,
_errorContainer = errorContainer,
_onErrorContainer = onErrorContainer,
_surfaceDim = surfaceDim,
_surfaceBright = surfaceBright,
_surfaceContainerLowest = surfaceContainerLowest,
_surfaceContainerLow = surfaceContainerLow,
_surfaceContainer = surfaceContainer,
_surfaceContainerHigh = surfaceContainerHigh,
_surfaceContainerHighest = surfaceContainerHighest,
_onSurfaceVariant = onSurfaceVariant,
_outline = outline,
_outlineVariant = outlineVariant,
_shadow = shadow,
_scrim = scrim,
_inverseSurface = inverseSurface,
_onInverseSurface = onInverseSurface,
_inversePrimary = inversePrimary,
_surfaceTint = surfaceTint,
// DEPRECATED (newest deprecations at the bottom)
_background = background,
_onBackground = onBackground,
_surfaceVariant = surfaceVariant;