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