tryParse static method
Implementation
static CSSCalcValue? tryParse(RenderStyle renderStyle, String propertyName, String propertyValue) {
if (CSSFunction.isFunction(propertyValue, functionName: CALC)) {
List<CSSFunctionalNotation> fns = CSSFunction.parseFunction(propertyValue);
if (fns.isNotEmpty && fns.first.args.isNotEmpty) {
assert(fns.first.args.length == 1, 'Calc parameters count must be = 1');
final expression = fns.first.args.first;
final _CSSCalcParser parser = _CSSCalcParser(propertyName, renderStyle, expression);
CalcExpressionNode? node = parser.processCalcExpression();
return CSSCalcValue(node);
}
}
return null;
}