copyWith method

MenuStyle copyWith({
  1. Axis? axis,
  2. VisualDensity? visualDensity,
  3. double? vertMenuMinWidth,
  4. double? vertPadding,
  5. double? vertSubmenuMargin,
  6. double? horzSubmenuMargin,
  7. double? areaPadding,
  8. double? buttonMenuPadding,
  9. Color? backgroundColor,
  10. MenuItemMaterialStateProperty<Color>? foregroundColor,
  11. double? elevation,
  12. TextStyle? textStyle,
  13. MenuItemStyle? itemStyle,
  14. DividerThemeData? dividerStyle,
  15. bool? isAnimated,
  16. Duration? animationDuration,
})

Implementation

MenuStyle copyWith({
  Axis? axis,
  VisualDensity? visualDensity,
  double? vertMenuMinWidth,
  double? vertPadding,
  double? vertSubmenuMargin,
  double? horzSubmenuMargin,
  double? areaPadding,
  double? buttonMenuPadding,
  Color? backgroundColor,
  MenuItemMaterialStateProperty<Color>? foregroundColor,
  double? elevation,
  TextStyle? textStyle,
  MenuItemStyle? itemStyle,
  DividerThemeData? dividerStyle,
  bool? isAnimated,
  Duration? animationDuration,
}) {
  return MenuStyle(
    axis: axis ?? this.axis,
    visualDensity: visualDensity ?? this.visualDensity,
    vertMenuMinWidth: vertMenuMinWidth ?? this.vertMenuMinWidth,
    vertPadding: vertPadding ?? this.vertPadding,
    vertSubmenuMargin: vertSubmenuMargin ?? this.vertSubmenuMargin,
    horzSubmenuMargin: horzSubmenuMargin ?? this.horzSubmenuMargin,
    areaPadding: areaPadding ?? this.areaPadding,
    buttonMenuPadding: buttonMenuPadding ?? this.buttonMenuPadding,
    backgroundColor: backgroundColor ?? this.backgroundColor,
    foregroundColor: MenuItemMaterialStateProperty.merge(this.foregroundColor, foregroundColor),
    elevation: elevation ?? this.elevation,
    textStyle: textStyle ?? this.textStyle,
    itemStyle: itemStyle ?? this.itemStyle,
    dividerStyle: dividerStyle ?? this.dividerStyle,
    isAnimated: isAnimated ?? this.isAnimated,
    animationDuration: animationDuration ?? this.animationDuration
  );
}