added copyWith to SpaceDetailsModel and its property models.

This commit is contained in:
Faris Armoush
2025-07-02 14:17:27 +03:00
parent bdeec7d325
commit fdd0526c78

View File

@ -41,6 +41,22 @@ class SpaceDetailsModel extends Equatable {
};
}
SpaceDetailsModel copyWith({
String? uuid,
String? spaceName,
String? icon,
List<ProductAllocation>? productAllocations,
List<Subspace>? subspaces,
}) {
return SpaceDetailsModel(
uuid: uuid ?? this.uuid,
spaceName: spaceName ?? this.spaceName,
icon: icon ?? this.icon,
productAllocations: productAllocations ?? this.productAllocations,
subspaces: subspaces ?? this.subspaces,
);
}
@override
List<Object?> get props => [uuid, spaceName, icon, productAllocations, subspaces];
}
@ -70,6 +86,18 @@ class ProductAllocation extends Equatable {
};
}
ProductAllocation copyWith({
Product? product,
Tag? tag,
String? location,
}) {
return ProductAllocation(
product: product ?? this.product,
tag: tag ?? this.tag,
location: location ?? this.location,
);
}
@override
List<Object?> get props => [product, tag];
}
@ -103,6 +131,18 @@ class Subspace extends Equatable {
};
}
Subspace copyWith({
String? uuid,
String? name,
List<ProductAllocation>? productAllocations,
}) {
return Subspace(
uuid: uuid ?? this.uuid,
name: name ?? this.name,
productAllocations: productAllocations ?? this.productAllocations,
);
}
@override
List<Object?> get props => [uuid, name, productAllocations];
}