copyWith method

CupertinoThemeData copyWith ({Brightness brightness, Color primaryColor, Color primaryContrastingColor, CupertinoTextThemeData textTheme, Color barBackgroundColor, Color scaffoldBackgroundColor })

Create a copy of CupertinoThemeData with specified attributes overridden.

Only the current instance's specified attributes are copied instead of derived values. For instance, if the current primaryColor is implied to be CupertinoColors.activeOrange due to the current brightness, copying with a different brightness will also change the copy's implied primaryColor.

Implementation

CupertinoThemeData copyWith({
  Brightness brightness,
  Color primaryColor,
  Color primaryContrastingColor,
  CupertinoTextThemeData textTheme,
  Color barBackgroundColor,
  Color scaffoldBackgroundColor,
}) {
  return CupertinoThemeData(
    brightness: brightness ?? _brightness,
    primaryColor: primaryColor ?? _primaryColor,
    primaryContrastingColor: primaryContrastingColor ?? _primaryContrastingColor,
    textTheme: textTheme ?? _textTheme,
    barBackgroundColor: barBackgroundColor ?? _barBackgroundColor,
    scaffoldBackgroundColor: scaffoldBackgroundColor ?? _scaffoldBackgroundColor,
  );
}