mergeStyles function
Combines style maps from left to right, ignoring null values.
Implementation
Map<String, Object?> mergeStyles(
Map<String, Object?> first,
Map<String, Object?> second, [
Map<String, Object?> third = const {},
Map<String, Object?> fourth = const {},
Map<String, Object?> fifth = const {},
]) {
return {
for (final style in [first, second, third, fourth, fifth])
for (final entry in style.entries)
if (entry.value != null && entry.key != '_cssText')
entry.key: entry.value,
};
}