conversionImageProvider function

Map conversionImageProvider(
  1. Map originMap,
  2. String className
)

Implementation

Map conversionImageProvider(Map originMap, String className) {
  List propsList = originMap['propsList'];
  Map resultMap = {};
  propsList.forEach((element) {
    var value = element['value'];
    var name = element['name'];
    var expression = element['expression'];
    resultMap['runtimeType'] = className;
    if (value != null) {
      /// [AssetImage]
      if (className == 'AssetImage') {
        resultMap['assetName'] = value;

        /// [NetworkImage]
      } else if (className == 'NetworkImage') {
        resultMap['url'] = value;
      }
    }

    if (name != null && expression != null) {
      resultMap[name['name']] = '${expression['value']}';
    }
  });

  return resultMap;
}