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>{};
for (final key in (a.keys.toList()..addAll(b.keys))) {
if (a[key] != b[key]) {
attributes[key] = b.containsKey(key) ? b[key] : null;
}
}
return attributes.keys.isNotEmpty ? attributes : null;
}