Code will explain all:
//modal for list
class MyModal
{
int myField1;
List adjacentNodes;
MyModal(this.myField1)
{
adjacentNodes= new Lis
I was having the same problem, List.from() and List.of() didn't work. I had to map the current list, thus creating a new instance.
List<CompanyBranchesDTO> get companyBranchesCopy {
return companyBranches.map((e) =>
CompanyBranchesDTO(id: e.id, name: e.name, isChecked: e.isChecked))
.toList();
}
That way I have a new instance to inject where it is needed.