conversionStyle function

Map conversionStyle(
  1. Map originMap
)

Implementation

Map conversionStyle(Map originMap) {
  List propsList = originMap['propsList'];
  Map resultMap = {};
  propsList.forEach((e) {
    Map expressionMap = e['expression'];
    Map nameMap = e['name'];
    if (nameMap['name'] == 'fontWeight') {
      Map valueIdentifier = expressionMap['identifier'];
      String valueName = valueIdentifier['name'];
      resultMap[nameMap['name']] = valueName;
    } else if (nameMap['name'] == 'color') {
      Map propsMap = expressionMap['props'];
      resultMap['color'] = conversionColor(propsMap);
    } else if (nameMap['name'] == 'fontSize') {
      resultMap['fontSize'] = '${expressionMap['value']}';
    }
  });

  return resultMap;
}