copyWith method Null safety

ButtonBarThemeData copyWith(
  1. {MainAxisAlignment? alignment,
  2. MainAxisSize? mainAxisSize,
  3. ButtonTextTheme? buttonTextTheme,
  4. double? buttonMinWidth,
  5. double? buttonHeight,
  6. EdgeInsetsGeometry? buttonPadding,
  7. bool? buttonAlignedDropdown,
  8. ButtonBarLayoutBehavior? layoutBehavior,
  9. VerticalDirection? overflowDirection}
)

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

Implementation

ButtonBarThemeData copyWith({
  MainAxisAlignment? alignment,
  MainAxisSize? mainAxisSize,
  ButtonTextTheme? buttonTextTheme,
  double? buttonMinWidth,
  double? buttonHeight,
  EdgeInsetsGeometry? buttonPadding,
  bool? buttonAlignedDropdown,
  ButtonBarLayoutBehavior? layoutBehavior,
  VerticalDirection? overflowDirection,
}) {
  return ButtonBarThemeData(
    alignment: alignment ?? this.alignment,
    mainAxisSize: mainAxisSize ?? this.mainAxisSize,
    buttonTextTheme: buttonTextTheme ?? this.buttonTextTheme,
    buttonMinWidth: buttonMinWidth ?? this.buttonMinWidth,
    buttonHeight: buttonHeight ?? this.buttonHeight,
    buttonPadding: buttonPadding ?? this.buttonPadding,
    buttonAlignedDropdown: buttonAlignedDropdown ?? this.buttonAlignedDropdown,
    layoutBehavior: layoutBehavior ?? this.layoutBehavior,
    overflowDirection: overflowDirection ?? this.overflowDirection,
  );
}