copyWith method

OrderOption copyWith({
  1. OrderOptionType? type,
  2. bool? asc,
})

Returns a new OrderOption object with the same properties as this one, but with any specified properties replaced.

If any parameter is not provided, its value will be taken from this object.

  • type: An optional parameter. Specifies the type of order to apply.
  • asc: An optional parameter. If set to true, the result will be sorted in ascending order. Otherwise, it will be sorted in descending order.

Implementation

OrderOption copyWith({OrderOptionType? type, bool? asc}) {
  return OrderOption(
    asc: asc ?? this.asc,
    type: type ?? this.type,
  );
}