copyWith method
NavRailButton
copyWith({
- String? label,
- IconData? icon,
- dynamic onTap()?,
- bool? expanded,
- bool? selected,
- bool? showSelected,
- double? width,
- double? height,
- Color? selectedColor,
- Color? selectedBackgroundColor,
- Color? unselectedColor,
- Color? unselectedBackgroundColor,
- BorderRadius? borderRadius,
- NavRailDirection? direction,
- NavRailButtonLabelPosition? labelPosition,
override
Creates a copy of this NavRailButton with the given fields replaced.
This method is used internally by the navigation system to update button properties based on state changes (selected, expanded, etc.).
All parameters are optional and will use the current values if not provided.
Implementation
@override
NavRailButton copyWith({
String? label,
IconData? icon,
Function()? onTap,
bool? expanded,
bool? selected,
bool? showSelected,
double? width,
double? height,
Color? selectedColor,
Color? selectedBackgroundColor,
Color? unselectedColor,
Color? unselectedBackgroundColor,
BorderRadius? borderRadius,
NavRailDirection? direction,
NavRailButtonLabelPosition? labelPosition,
}) => NavRailButton(
label: label ?? this.label,
icon: icon ?? this.icon,
onTap: onTap ?? this.onTap,
expanded: expanded ?? this.expanded,
selected: selected ?? this.selected,
showSelected: showSelected ?? this.showSelected,
width: width ?? this.width,
height: height ?? this.height,
selectedColor: selectedColor ?? this.selectedColor,
selectedBackgroundColor:
selectedBackgroundColor ?? this.selectedBackgroundColor,
unselectedColor: unselectedColor ?? this.unselectedColor,
unselectedBackgroundColor:
unselectedBackgroundColor ?? this.unselectedBackgroundColor,
borderRadius: borderRadius ?? this.borderRadius,
labelPosition: labelPosition ?? this.labelPosition,
key: key,
direction: direction ?? this.direction,
);