bool hasStyle(Element element, String styleName, [ String styleValue ])

Source

bool hasStyle(Element element, String styleName, [String styleValue]) {
  var value = getStyle(element, styleName);
  return styleValue != null ? value == styleValue : value.length > 0;
}