我正在尝试更新flutter redux中的一些属性,但出现以下错误
Class 'DivMatches' has no instance setter 'id='.
这是我的州课
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,
);
}
}
我的动作看起来像这样
class UpdateDivResult{ // update the div result by id
dynamic id;
UpdateDivResult(this.id);
}
我的减速机看起来像这样
var newMatch = state.myMatches[0][0];
newMatch.id = 223;
return state.copywith(
myMatches: newMatch
);
请帮忙。太感谢了。