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 transformedEntries = value.entries
.map((e) => _transform(e))
.where((element) => element != null)
.toList()
.cast<MapEntry<String, dynamic>>();
final content = transformedEntries
.map((e) => '${e.key}: ${e.value}')
.join(',\n${indent()}');
return 'TextStyle(\n${indent()}$content,\n${indent(-1)})';
}
throw Exception('Unable to parse typography with data: $value');
}