updated method
Implementation
ReorderableEntity updated({
required int updatedOrderId,
required Offset? updatedOffset,
required Size? size,
}) {
var originalOrderId = this.originalOrderId;
var originalOffset = this.originalOffset;
// should only update original when previous updated orderId is different to previous one
if (updatedOrderId != this.updatedOrderId) {
originalOrderId = this.updatedOrderId;
originalOffset = this.updatedOffset;
}
return ReorderableEntity(
key: key,
originalOrderId: originalOrderId,
updatedOrderId: updatedOrderId,
originalOffset: originalOffset,
updatedOffset: updatedOffset ?? this.updatedOffset,
size: size ?? this.size,
isBuildingOffset: updatedOffset == null,
hasSwappedOrder:
updatedOrderId != originalOrderId && updatedOffset != null,
);
}