handleProperty function

Future<void> handleProperty(
  1. MethodChannel methodChannel,
  2. String pageId,
  3. Component component
)

处理property以及innerHTML

Implementation

Future<void> handleProperty(
    MethodChannel methodChannel, String pageId, Component component) async {
  for (var entry in component.properties.entries.toList()) {
    var exp = entry.value.property;
    if (entry.value.containExpression) {
      exp = getExpression(exp);
      var watch = true;
      if (component.isInRepeat) {
        exp = getInRepeatExp(component, exp);
        watch = false;
      } else {
        exp = 'return $exp';
      }
      var result = await _calcExpression(methodChannel, pageId, component.id,
          TYPE_PROPERTY, entry.key, watch, exp);
//      print("$exp = $result");
      entry.value.setValue(result);
    }
  }
}