copyWith method Null safety

AppBarTheme copyWith(
  1. {IconThemeData? actionsIconTheme,
  2. @Deprecated('This property is no longer used, please use systemOverlayStyle instead. ' 'This feature was deprecated after v2.4.0-0.0.pre.') Brightness? brightness,
  3. Color? color,
  4. Color? backgroundColor,
  5. Color? foregroundColor,
  6. double? elevation,
  7. double? scrolledUnderElevation,
  8. Color? shadowColor,
  9. Color? surfaceTintColor,
  10. ShapeBorder? shape,
  11. IconThemeData? iconTheme,
  12. @Deprecated('This property is no longer used, please use toolbarTextStyle and titleTextStyle instead. ' 'This feature was deprecated after v2.4.0-0.0.pre.') TextTheme? textTheme,
  13. bool? centerTitle,
  14. double? titleSpacing,
  15. double? toolbarHeight,
  16. TextStyle? toolbarTextStyle,
  17. TextStyle? titleTextStyle,
  18. SystemUiOverlayStyle? systemOverlayStyle,
  19. @Deprecated('This property is obsolete and is false by default. ' 'This feature was deprecated after v2.4.0-0.0.pre.') bool? backwardsCompatibility}
)

Creates a copy of this object with the given fields replaced with the new values.

Implementation

AppBarTheme copyWith({
  IconThemeData? actionsIconTheme,
  @Deprecated(
    'This property is no longer used, please use systemOverlayStyle instead. '
    'This feature was deprecated after v2.4.0-0.0.pre.',
  )
  Brightness? brightness,
  Color? color,
  Color? backgroundColor,
  Color? foregroundColor,
  double? elevation,
  double? scrolledUnderElevation,
  Color? shadowColor,
  Color? surfaceTintColor,
  ShapeBorder? shape,
  IconThemeData? iconTheme,
  @Deprecated(
    'This property is no longer used, please use toolbarTextStyle and titleTextStyle instead. '
    'This feature was deprecated after v2.4.0-0.0.pre.',
  )
  TextTheme? textTheme,
  bool? centerTitle,
  double? titleSpacing,
  double? toolbarHeight,
  TextStyle? toolbarTextStyle,
  TextStyle? titleTextStyle,
  SystemUiOverlayStyle? systemOverlayStyle,
  @Deprecated(
    'This property is obsolete and is false by default. '
    'This feature was deprecated after v2.4.0-0.0.pre.',
  )
  bool? backwardsCompatibility,
}) {
  assert(
    color == null || backgroundColor == null,
    'The color and backgroundColor parameters mean the same thing. Only specify one.',
  );
  return AppBarTheme(
    brightness: brightness ?? this.brightness,
    backgroundColor: backgroundColor ?? color ?? this.backgroundColor,
    foregroundColor: foregroundColor ?? this.foregroundColor,
    elevation: elevation ?? this.elevation,
    scrolledUnderElevation: scrolledUnderElevation ?? this.scrolledUnderElevation,
    shadowColor: shadowColor ?? this.shadowColor,
    surfaceTintColor: surfaceTintColor ?? this.surfaceTintColor,
    shape: shape ?? this.shape,
    iconTheme: iconTheme ?? this.iconTheme,
    actionsIconTheme: actionsIconTheme ?? this.actionsIconTheme,
    textTheme: textTheme ?? this.textTheme,
    centerTitle: centerTitle ?? this.centerTitle,
    titleSpacing: titleSpacing ?? this.titleSpacing,
    toolbarHeight: toolbarHeight ?? this.toolbarHeight,
    toolbarTextStyle: toolbarTextStyle ?? this.toolbarTextStyle,
    titleTextStyle: titleTextStyle ?? this.titleTextStyle,
    systemOverlayStyle: systemOverlayStyle ?? this.systemOverlayStyle,
    backwardsCompatibility: backwardsCompatibility ?? this.backwardsCompatibility,
  );
}