copyWith method
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 totrue
, 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,
);
}