buildValue method
Builds the value for the specific type.
Make sure to only override this method with any new DesignTokenParser you create. Please avoid directly calling this method outside DesignTokenParser. Prefer DesignTokenParser.parse.
Implementation
@override
String buildValue(value) {
if (value is Map<String, dynamic>) {
final color = ColorParser().parse(value['color']);
final width = DimensionParser().parse(value['width']);
if (value['style'] == 'dashed') {
throw Exception(
'Unable to parse dashed border. Please use solid instead.',
);
}
return 'Border.all(\n${indent()}width: $width,\n${indent()}color: $color,\n${indent(-1)})';
}
throw Exception('Unable to parse border with data: $value');
}