operator [] method Null safety

Declaration? operator [](
  1. String key
)

Gets a styling declaration by property.

Implementation

css.Declaration? operator [](String key) {
  for (final style in styles.reversed) {
    if (style.property == key) {
      return style;
    }
  }
  return null;
}