kindOf static method

String kindOf(
  1. String value
)

How a theme value reads, by what it looks like: number, duration (a number with a unit), insets (a comma separated list of numbers), color, else text. The fixture test/fixtures/theme_value_kinds.yaml is the truth of it; the generator mirrors the same rules.

Implementation

static String kindOf(String value) {
  if (number(value) != null) {
    return 'number';
  }
  if (_durationPattern.hasMatch(value.trim())) {
    return 'duration';
  }
  if (numberList(value) != null) {
    return 'insets';
  }
  return color(value) != null ? 'color' : 'text';
}