some_dart_utils 0.0.1 copy "some_dart_utils: ^0.0.1" to clipboard
some_dart_utils: ^0.0.1 copied to clipboard

A dart package which can perform deepCopy on maps and lists

some_dart_utils #

A dart package which can perform deepCopy on maps and lists

recursiveMapCopy() #

As we know Map.from() performs only shallowCopy, you can use recursiveMapCopy() for deepCopying a map.

recursiveListCopy() #

As we know List.from() performs only shallowCopy, you can use recursiveListCopy() for deepCopying a list.

Info #

var temp = {
    "lev1": {
        "lev2" : {
            "1":1,
            "2":2,
            "lev3":{
                "name": [true, true]
            }
        }
    }
};

var tempSCopy = Map.from(temp);
var tempDCopy = recursiveMapCopy(temp);

temp["lev1"]["lev2"]["1"] = 11;

print(tempSCopy["lev1"]["lev2"]["1"]); // 11
print(tempDCopy["lev1"]["lev2"]["1"]); // 1
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A dart package which can perform deepCopy on maps and lists

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on some_dart_utils