copyWith method
ChartPosition
copyWith({
- String? id,
- String? symbol,
- PositionSide? side,
- double? entryPrice,
- double? quantity,
- ValueGetter<
double?> ? takeProfitPrice, - ValueGetter<
double?> ? stopLossPrice, - DateTime? openedAt,
- String? customLabel,
- Map<
String, dynamic> ? metadata,
Implementation
ChartPosition copyWith({
String? id,
String? symbol,
PositionSide? side,
double? entryPrice,
double? quantity,
ValueGetter<double?>? takeProfitPrice,
ValueGetter<double?>? stopLossPrice,
DateTime? openedAt,
String? customLabel,
Map<String, dynamic>? metadata,
}) {
return ChartPosition(
id: id ?? this.id,
symbol: symbol ?? this.symbol,
side: side ?? this.side,
entryPrice: entryPrice ?? this.entryPrice,
quantity: quantity ?? this.quantity,
takeProfitPrice:
takeProfitPrice != null ? takeProfitPrice() : this.takeProfitPrice,
stopLossPrice:
stopLossPrice != null ? stopLossPrice() : this.stopLossPrice,
openedAt: openedAt ?? this.openedAt,
customLabel: customLabel ?? this.customLabel,
metadata: metadata ?? this.metadata,
);
}