diffAttributes static method
Returns diff between two attribute sets
Implementation
static Map<String, dynamic>? diffAttributes(Map<String, dynamic>? a, Map<String, dynamic>? b) {
a ??= const {};
b ??= const {};
final attributes = <String, dynamic>{};
var list = a.keys.toList();
list.addAll(b.keys);
for (var key in list) {
if (a[key] != b[key]) {
attributes[key] = b.containsKey(key) ? b[key] : null;
}
}
return attributes.keys.isNotEmpty ? attributes : null;
}