CupertinoDynamicColor.withBrightness constructor Null safety

const CupertinoDynamicColor.withBrightness(
  1. {String? debugLabel,
  2. required Color color,
  3. required Color darkColor}
)

Creates an adaptive Color that changes its effective color based on the given BuildContext's brightness (from MediaQueryData.platformBrightness or CupertinoThemeData.brightness). The default effective color is color.

All the colors must not be null.

Implementation

const CupertinoDynamicColor.withBrightness({
  String? debugLabel,
  required Color color,
  required Color darkColor,
}) : this(
  debugLabel: debugLabel,
  color: color,
  darkColor: darkColor,
  highContrastColor: color,
  darkHighContrastColor: darkColor,
  elevatedColor: color,
  darkElevatedColor: darkColor,
  highContrastElevatedColor: color,
  darkHighContrastElevatedColor: darkColor,
);