I am trying to update some property in flutter redux but i am getting the following error
Class 'DivMatches' has no instance setter 'id='.
Here is my state class
class AppState {
var demoState;
List myMatches;
AppState({this.demoState, this.myMatches});
AppState copywith({demoState, myMatches}){
return AppState(
myMatches : myMatches ?? this.myMatches,
demoState: demoState ?? this.demoState,
);
}
}
My action looks like this
class UpdateDivResult{ // update the div result by id
dynamic id;
UpdateDivResult(this.id);
}
My reducer looks like this
var newMatch = state.myMatches[0][0];
newMatch.id = 223;
return state.copywith(
myMatches: newMatch
);
Please help. Thank you so much.