shouldUpdateGlobalExtraProperty static method

bool shouldUpdateGlobalExtraProperty(
  1. String incomingPropertyKey,
  2. TBLExtraPropertyWithLevel incomingExtraProperty,
  3. Map<String, TBLExtraPropertyWithLevel> _globalExtraProperties
)

Determines if a global extra property should be updated.

Returns true if:

  • Property doesn't exist globally, or
  • Property exists but has a different value

This prevents unnecessary updates when values haven't changed.

Implementation

static bool shouldUpdateGlobalExtraProperty(
    String incomingPropertyKey,
    TBLExtraPropertyWithLevel incomingExtraProperty,
    Map<String, TBLExtraPropertyWithLevel> _globalExtraProperties) {
  final globalExtraPropertyWithKey = _globalExtraProperties[incomingPropertyKey];
  if (globalExtraPropertyWithKey == null) {
    return true;
  }
  return _isPropertyValueDifferentThanExisting(
      globalExtraPropertyWithKey.value, incomingExtraProperty.value);
}