composeAttributes static method
Composes two attribute sets.
Implementation
static Map<String, dynamic>? composeAttributes(
Map<String, dynamic>? a, Map<String, dynamic>? b,
{bool keepNull = false}) {
a ??= const {};
b ??= const {};
final result = Map<String, dynamic>.from(a)..addAll(b);
final keys = result.keys.toList(growable: false);
if (!keepNull) {
for (final key in keys) {
if (result[key] == null) result.remove(key);
}
}
return result.isEmpty ? null : result;
}