isJustLayout static method

bool isJustLayout(
  1. VoltronMap map,
  2. String prop
)

Implementation

static bool isJustLayout(VoltronMap map, String prop) {
  if (justLayoutPropSet.contains(prop)) {
    return true;
  }

  switch (prop) {
    case kOpacity:
      return map.isNull(kOpacity) || map.get<double>(kOpacity) == 1;
    case kBorderRadius:
      if (map.containsKey(kBackgroundColor) && map.get<int>(kBackgroundColor) != 0) {
        return false;
      }
      if (map.containsKey(kBorderWidth) &&
          !map.isNull(kBorderWidth) &&
          map.get<double>(kBorderWidth) != 0) {
        return false;
      }
      return true;
    case kBorderLeftColor:
      return map.get<int>(kBorderLeftColor) == 0;
    case kBorderRightColor:
      return map.get<int>(kBorderRightColor) == 0;
    case kBorderTopColor:
      return map.get<int>(kBorderTopColor) == 0;
    case kBorderBottomColor:
      return map.get<int>(kBorderBottomColor) == 0;
    case kBorderWidth:
      return map.isNull(kBorderWidth) || map.get<double>(kBorderWidth) == 0;
    case kBorderLeftWidth:
      return map.isNull(kBorderLeftWidth) || map.get<double>(kBorderLeftWidth) == 0;
    case kBorderTopWidth:
      return map.isNull(kBorderTopWidth) || map.get<double>(kBorderTopWidth) == 0;
    case kBorderRightWidth:
      return map.isNull(kBorderRightWidth) || map.get<double>(kBorderRightWidth) == 0;
    case kBorderBottomWidth:
      return map.isNull(kBorderBottomWidth) || map.get<double>(kBorderBottomWidth) == 0;
    case kOverflow:
      return map.isNull(kOverflow) || kVisible == map.get<String>(kOverflow);
    default:
      return false;
  }
}