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 Map<String, dynamic> result = new Map.from(a)..addAll(b);
List<String> keys = result.keys.toList(growable: false);
if (!keepNull) {
for (final String key in keys) {
if (result[key] == null) result.remove(key);
}
}
return result.isEmpty ? null : result;
}