assign function Null safety
- dynamic object,
- [dynamic source]
Assigns own enumerable string keyed properties of source objects to the destination object. Source objects are applied from left to right. Subsequent sources overwrite property assignments of previous sources.
Implementation
Map assign(object, [source]) {
if (source == null) {
return object;
}
if (object is Map) {
return Map.from(object)..addAll(source);
}
return Map.from(object)..addAll(source);
}