ColorScheme.dark constructor

const ColorScheme.dark(
  1. {Brightness brightness = Brightness.dark,
  2. Color primary = const Color(0xffbb86fc),
  3. Color onPrimary = Colors.black,
  4. Color? primaryContainer,
  5. Color? onPrimaryContainer,
  6. Color secondary = const Color(0xff03dac6),
  7. Color onSecondary = Colors.black,
  8. Color? secondaryContainer,
  9. Color? onSecondaryContainer,
  10. Color? tertiary,
  11. Color? onTertiary,
  12. Color? tertiaryContainer,
  13. Color? onTertiaryContainer,
  14. Color error = const Color(0xffcf6679),
  15. Color onError = Colors.black,
  16. Color? errorContainer,
  17. Color? onErrorContainer,
  18. Color background = const Color(0xff121212),
  19. Color onBackground = Colors.white,
  20. Color surface = const Color(0xff121212),
  21. Color onSurface = Colors.white,
  22. Color? surfaceVariant,
  23. Color? onSurfaceVariant,
  24. Color? outline,
  25. Color? outlineVariant,
  26. Color? shadow,
  27. Color? scrim,
  28. Color? inverseSurface,
  29. Color? onInverseSurface,
  30. Color? inversePrimary,
  31. Color? surfaceTint}
)

Create the dark color scheme 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. Override the brightness property of ColorScheme.fromSeed to create a dark color scheme.

This example demonstrates how to create a color scheme similar to ColorScheme.dark using the ColorScheme.fromSeed constructor:
link
colorScheme: ColorScheme.fromSeed(
  seedColor: const Color(0xffbb86fc),
  brightness: Brightness.dark,
).copyWith(
  primaryContainer: const Color(0xffbb86fc),
  onPrimaryContainer: Colors.black,
  secondaryContainer: const Color(0xff03dac6),
  onSecondaryContainer: Colors.black,
  error: const Color(0xffcf6679),
  onError: Colors.black,
),

Implementation

const ColorScheme.dark({
  this.brightness = Brightness.dark,
  this.primary = const Color(0xffbb86fc),
  this.onPrimary = Colors.black,
  Color? primaryContainer,
  Color? onPrimaryContainer,
  this.secondary = const Color(0xff03dac6),
  this.onSecondary = Colors.black,
  Color? secondaryContainer,
  Color? onSecondaryContainer,
  Color? tertiary,
  Color? onTertiary,
  Color? tertiaryContainer,
  Color? onTertiaryContainer,
  this.error = const Color(0xffcf6679),
  this.onError = Colors.black,
  Color? errorContainer,
  Color? onErrorContainer,
  this.background = const Color(0xff121212),
  this.onBackground = Colors.white,
  this.surface = const Color(0xff121212),
  this.onSurface = Colors.white,
  Color? surfaceVariant,
  Color? onSurfaceVariant,
  Color? outline,
  Color? outlineVariant,
  Color? shadow,
  Color? scrim,
  Color? inverseSurface,
  Color? onInverseSurface,
  Color? inversePrimary,
  Color? surfaceTint,
}) : _primaryContainer = primaryContainer,
     _onPrimaryContainer = onPrimaryContainer,
     _secondaryContainer = secondaryContainer,
     _onSecondaryContainer = onSecondaryContainer,
     _tertiary = tertiary,
     _onTertiary = onTertiary,
     _tertiaryContainer = tertiaryContainer,
     _onTertiaryContainer = onTertiaryContainer,
     _errorContainer = errorContainer,
     _onErrorContainer = onErrorContainer,
     _surfaceVariant = surfaceVariant,
     _onSurfaceVariant = onSurfaceVariant,
     _outline = outline,
     _outlineVariant = outlineVariant,
     _shadow = shadow,
     _scrim = scrim,
     _inverseSurface = inverseSurface,
     _onInverseSurface = onInverseSurface,
     _inversePrimary = inversePrimary,
     _surfaceTint = surfaceTint;