copyWith method

CPBarButton copyWith({
  1. String? title,
  2. String? image,
  3. bool? isEnabled,
  4. CPBarButtonStyles? style,
  5. OnClickEvents? onClickEvent,
})

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

Implementation

CPBarButton copyWith({
  String? title,
  String? image,
  bool? isEnabled,
  CPBarButtonStyles? style,
  OnClickEvents? onClickEvent,
}) {
  return CPBarButton(
    title: title ?? this.title,
    image: image ?? this.image,
    style: style ?? this.style,
    onClickEvent: onClickEvent ?? this.onClickEvent,
    isEnabled: isEnabled ?? this.isEnabled,
  );
}