copyWith method

SuggestedPostInfo copyWith({
  1. SuggestedPostPrice? price()?,
  2. int? sendDate,
  3. SuggestedPostState? state,
  4. bool? canBeApproved,
  5. bool? canBeDeclined,
})

Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.

Implementation

SuggestedPostInfo copyWith({
  SuggestedPostPrice? Function()? price,
  int? sendDate,
  SuggestedPostState? state,
  bool? canBeApproved,
  bool? canBeDeclined,
}) => SuggestedPostInfo(
  price: price != null ? price() : this.price,
  sendDate: sendDate ?? this.sendDate,
  state: state ?? this.state,
  canBeApproved: canBeApproved ?? this.canBeApproved,
  canBeDeclined: canBeDeclined ?? this.canBeDeclined,
);