copyWith method Null safety

MaterialBannerThemeData copyWith(
  1. {Color? backgroundColor,
  2. TextStyle? contentTextStyle,
  3. double? elevation,
  4. EdgeInsetsGeometry? padding,
  5. EdgeInsetsGeometry? leadingPadding}
)

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

Implementation

MaterialBannerThemeData copyWith({
  Color? backgroundColor,
  TextStyle? contentTextStyle,
  double? elevation,
  EdgeInsetsGeometry? padding,
  EdgeInsetsGeometry? leadingPadding,
}) {
  return MaterialBannerThemeData(
    backgroundColor: backgroundColor ?? this.backgroundColor,
    contentTextStyle: contentTextStyle ?? this.contentTextStyle,
    elevation: elevation ?? this.elevation,
    padding: padding ?? this.padding,
    leadingPadding: leadingPadding ?? this.leadingPadding,
  );
}