you can use addAll
method of Map
object
var firstMap = {"1":"2"};
var secondMap = {"2":"3"};
var thirdMap = {};
thirdMap.addAll(firstMap);
thirdMap.addAll(secondMap);
print(thirdMap);
Or
var thirdMap = {}..addAll(firstMap)..addAll(secondMap);
Update
Since dart sdk 2.3
You can use spread operator ...
final firstMap = {"1":"2"};
final secondMap = {"2":"3"};
final thirdMap = {
...firstMap,
...secondMap,
};
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…