parser property

DesignTokenParser get parser

Returns a parser according to the type key in the DesignTokenMap.

Throws exception when no parser was found for the type to parse.

Implementation

DesignTokenParser get parser {
  if (!containsKey('type')) {
    throw Exception(
      'No \'type\' key found. Needed in order to figure out Flutter represented type.',
    );
  }

  final type = this['type'] as String;
  return parserForType(type);
}