combine method

Map<String, String> combine(
  1. Map<String, String> other
)

Combines this map with other.

If the same key exists, the value from other is used.

Example:

final style1 = {'color': 'red', 'font-size': '10px'};
final style2 = {'font-weight': 'bold', 'font-size': '12px'};
final combined = style1.combine(style2);
// returns: {'color': 'red', 'font-weight': 'bold', 'font-size': '12px'}

Implementation

Map<String, String> combine(Map<String, String> other) => {...this, ...other};