tryReplaceVariableInString static method

String tryReplaceVariableInString(
  1. String input,
  2. RenderStyle renderStyle
)

Implementation

static String tryReplaceVariableInString(String input, RenderStyle renderStyle) {
  return input.replaceAllMapped(_variableRgbRegExp, (Match match) {
    String? varString = match[0];
    final variable = CSSVariable.tryParse(renderStyle, varString!);
    final computedValue = variable?.computedValue('');
    return computedValue;
  });
}