diff --git a/lib/src/model/product.dart b/lib/src/model/product.dart index 4239adf0c0..14d59de883 100644 --- a/lib/src/model/product.dart +++ b/lib/src/model/product.dart @@ -693,7 +693,7 @@ class Product extends JsonObject { return json; } - /// Returns all existing product attributes matching a list of attribute ids + /// Returns all existing product attributes matching a list of attribute ids. Map getAttributes( final List attributeIds, ) { @@ -715,6 +715,16 @@ class Product extends JsonObject { return result; } + /// Returns the product attribute matching an attribute id. + Attribute? getAttribute( + final String attributeId, + ) { + final Map attributes = getAttributes( + [attributeId], + ); + return attributes[attributeId]; + } + /// Returns all the potential improvements given the quality of the data /// /// For apps with contribution mode.