Dart Can't change map value from initial map
I have this code :
void main() {
Map tabtest = {
'1' : {
'd' : 'one'
}
};
Map tabtest1 = {};
tabtest.forEach((cle1, val1) {
val1['d']='two';
tabtest1['cle1']=val1;
});
Map tabtest2={};
tabtest.forEach((cle2, val2) {
val2['d']='three';
tabtest2['cle2']=val2;
});
print(tabtest);
print(tabtest1);
print(tabtest2);
}
This code display :
{1: {d: three}}
{1: {d: three}}
{1: {d: three}}
But I want different value from tabtest1 and tabtest2 like :
tabtest1 = {1: {d: two}}
tabtest2 = {1: {d: three}}
Can help me?
Thanks.