add method

void add(
  1. KeyFrameBlock block
)

Implementation

void add(KeyFrameBlock block) {
  double? offset;
  final keyText = block.blockSelectors[0];
  if (keyText == 'from') {
    offset = 0;
  } else if (keyText == 'to') {
    offset = 1;
  } else {
    offset = CSSPercentage.parsePercentage(keyText);
  }
  for (MapEntry<String, CSSPropertyValue> entry in block.declarations) {
    final property = camelize(entry.key);
    keyframes.add(Keyframe(property, entry.value.value, offset ?? 0, LINEAR));
  }
}