4. Modifications
var built = person.rebuild((builder) => builder
..name = "Günter"
..age = 25
); // Returns a new instance with changed name and agevar builder = person.toBuilder();
builder.name = "Günter";
builder.age = 25;
var obj = builder.build(); // Returns a new instance with changed name and age var person = Person([...]);
var cloned = dogs.copy<Person>(person); // Creates a copy of the object
var modified = dogs.copy<Person>(person, {
"name": "Alex"
}); // Creates a modified copy of the object with the field "name" set to "Alex"Last updated