copyWith method

AppBarThemeData copyWith({
  1. Color? backgroundColor,
  2. Color? foregroundColor,
  3. @Deprecated('Use backgroundColor instead. ' 'This feature was deprecated after v3.33.0-0.2.pre.') Color? color,
  4. double? elevation,
  5. double? scrolledUnderElevation,
  6. Color? shadowColor,
  7. Color? surfaceTintColor,
  8. ShapeBorder? shape,
  9. IconThemeData? iconTheme,
  10. IconThemeData? actionsIconTheme,
  11. bool? centerTitle,
  12. double? titleSpacing,
  13. double? leadingWidth,
  14. double? toolbarHeight,
  15. TextStyle? toolbarTextStyle,
  16. TextStyle? titleTextStyle,
  17. SystemUiOverlayStyle? systemOverlayStyle,
  18. EdgeInsetsGeometry? actionsPadding,
})

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

Implementation

AppBarThemeData copyWith({
  Color? backgroundColor,
  Color? foregroundColor,
  @Deprecated(
    'Use backgroundColor instead. '
    'This feature was deprecated after v3.33.0-0.2.pre.',
  )
  Color? color,
  double? elevation,
  double? scrolledUnderElevation,
  Color? shadowColor,
  Color? surfaceTintColor,
  ShapeBorder? shape,
  IconThemeData? iconTheme,
  IconThemeData? actionsIconTheme,
  bool? centerTitle,
  double? titleSpacing,
  double? leadingWidth,
  double? toolbarHeight,
  TextStyle? toolbarTextStyle,
  TextStyle? titleTextStyle,
  SystemUiOverlayStyle? systemOverlayStyle,
  EdgeInsetsGeometry? actionsPadding,
}) {
  return AppBarThemeData(
    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,
    centerTitle: centerTitle ?? this.centerTitle,
    titleSpacing: titleSpacing ?? this.titleSpacing,
    leadingWidth: leadingWidth ?? this.leadingWidth,
    toolbarHeight: toolbarHeight ?? this.toolbarHeight,
    toolbarTextStyle: toolbarTextStyle ?? this.toolbarTextStyle,
    titleTextStyle: titleTextStyle ?? this.titleTextStyle,
    systemOverlayStyle: systemOverlayStyle ?? this.systemOverlayStyle,
    actionsPadding: actionsPadding ?? this.actionsPadding,
  );
}