copyWith method

ChartOrder copyWith({
  1. String? id,
  2. String? symbol,
  3. OrderSide? side,
  4. OrderType? type,
  5. double? price,
  6. double? quantity,
  7. double? takeProfitPrice()?,
  8. double? stopLossPrice()?,
  9. String? customLabel,
  10. OrderStatus? status,
  11. Map<String, dynamic>? metadata,
})

Implementation

ChartOrder copyWith({
  String? id,
  String? symbol,
  OrderSide? side,
  OrderType? type,
  double? price,
  double? quantity,
  double? Function()? takeProfitPrice,
  double? Function()? stopLossPrice,
  String? customLabel,
  OrderStatus? status,
  Map<String, dynamic>? metadata,
}) {
  return ChartOrder(
    id: id ?? this.id,
    symbol: symbol ?? this.symbol,
    side: side ?? this.side,
    type: type ?? this.type,
    price: price ?? this.price,
    quantity: quantity ?? this.quantity,
    takeProfitPrice:
        takeProfitPrice != null ? takeProfitPrice() : this.takeProfitPrice,
    stopLossPrice:
        stopLossPrice != null ? stopLossPrice() : this.stopLossPrice,
    customLabel: customLabel ?? this.customLabel,
    status: status ?? this.status,
    metadata: metadata ?? this.metadata,
  );
}