expressionToPaddingLength static method

double? expressionToPaddingLength(
  1. Expression value
)

Implementation

static double? expressionToPaddingLength(css.Expression value) {
  if (value is css.NumberTerm) {
    return double.tryParse(value.text);
  } else if (value is css.EmTerm) {
    return double.tryParse(value.text);
  } else if (value is css.RemTerm) {
    return double.tryParse(value.text);
  } else if (value is css.LengthTerm) {
    return double.tryParse(value.text.replaceAll(RegExp(r'\s+(\d+\.\d+)\s+'), ''));
  }
  return null;
}