copyWith method

AppBarTheme copyWith(
  1. {IconThemeData? actionsIconTheme,
  2. Color? color,
  3. Color? backgroundColor,
  4. Color? foregroundColor,
  5. double? elevation,
  6. double? scrolledUnderElevation,
  7. Color? shadowColor,
  8. Color? surfaceTintColor,
  9. ShapeBorder? shape,
  10. IconThemeData? iconTheme,
  11. bool? centerTitle,
  12. double? titleSpacing,
  13. double? toolbarHeight,
  14. TextStyle? toolbarTextStyle,
  15. TextStyle? titleTextStyle,
  16. SystemUiOverlayStyle? systemOverlayStyle}
)

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

Implementation

AppBarTheme copyWith({
  IconThemeData? actionsIconTheme,
  Color? color,
  Color? backgroundColor,
  Color? foregroundColor,
  double? elevation,
  double? scrolledUnderElevation,
  Color? shadowColor,
  Color? surfaceTintColor,
  ShapeBorder? shape,
  IconThemeData? iconTheme,
  bool? centerTitle,
  double? titleSpacing,
  double? toolbarHeight,
  TextStyle? toolbarTextStyle,
  TextStyle? titleTextStyle,
  SystemUiOverlayStyle? systemOverlayStyle,
}) {
  assert(
    color == null || backgroundColor == null,
    'The color and backgroundColor parameters mean the same thing. Only specify one.',
  );
  return AppBarTheme(
    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,
    toolbarHeight: toolbarHeight ?? this.toolbarHeight,
    toolbarTextStyle: toolbarTextStyle ?? this.toolbarTextStyle,
    titleTextStyle: titleTextStyle ?? this.titleTextStyle,
    systemOverlayStyle: systemOverlayStyle ?? this.systemOverlayStyle,
  );
}