Skip to content

Commit

Permalink
feat: added a copyWith mthod to MostRecentOrders
Browse files Browse the repository at this point in the history
  • Loading branch information
SlayerOrnstein committed Jan 27, 2024
1 parent 9ee37c2 commit 3b5d889
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/src/models/recent_orders.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ class MostRecentOrders extends Equatable {
/// Creates a json object from the current [MostRecentOrders].
Map<String, dynamic> toJson() => _$MostRecentOrdersToJson(this);

/// Creates a new instance of most recent with updated values.
MostRecentOrders copyWith({
List<OrderFull>? sellOrders,
List<OrderFull>? buyOrders,
}) {
return MostRecentOrders(
sellOrders: sellOrders ?? this.sellOrders,
buyOrders: buyOrders ?? this.buyOrders,
);
}

@override
List<Object?> get props => [sellOrders, buyOrders];
}

0 comments on commit 3b5d889

Please sign in to comment.