getEntityChangedFields method

List<String>? getEntityChangedFields(
  1. O o
)

Implementation

List<String>? getEntityChangedFields(O o) {
  var prevFields = _entitiesTracker.getTrackedInstanceInfo(o);
  if (prevFields == null) {
    return null;
  }

  var fields = getEntityFields(o);

  var changed = fields.entries.where((e) {
    var key = e.key;
    var val = e.value;
    var prevVal = prevFields[key];
    var eq = entityHandler.equalsFieldValues(key, val, prevVal);
    return !eq;
  });

  var changedFields = changed.map((e) => e.key).toList();
  return changedFields;
}