copyWith method

  1. @override
CupertinoThemeData copyWith({
  1. Brightness? brightness,
  2. Color? primaryColor,
  3. Color? primaryContrastingColor,
  4. CupertinoTextThemeData? textTheme,
  5. Color? barBackgroundColor,
  6. Color? scaffoldBackgroundColor,
  7. bool? applyThemeToAll,
})
override

Creates a copy of the theme data with specified attributes overridden.

Only the current instance's specified attributes are copied instead of derived values. For instance, if the current textTheme is implied from the current primaryColor because it was not specified, copying with a different primaryColor will also change the copy's implied textTheme.

Implementation

@override
CupertinoThemeData copyWith({
  Brightness? brightness,
  Color? primaryColor,
  Color? primaryContrastingColor,
  CupertinoTextThemeData? textTheme,
  Color? barBackgroundColor,
  Color? scaffoldBackgroundColor,
  bool? applyThemeToAll,
}) {
  return CupertinoThemeData._rawWithDefaults(
    brightness ?? super.brightness,
    primaryColor ?? super.primaryColor,
    primaryContrastingColor ?? super.primaryContrastingColor,
    textTheme ?? super.textTheme,
    barBackgroundColor ?? super.barBackgroundColor,
    scaffoldBackgroundColor ?? super.scaffoldBackgroundColor,
    applyThemeToAll ?? super.applyThemeToAll,
    _defaults,
  );
}