alibaba / fish-redux

An assembled flutter application framework.
https://github.com/alibaba/fish-redux
Apache License 2.0
7.33k stars 843 forks source link

在list项里面点击选中,page的state也更新了,但是view不重新build。 #587

Closed EaglesChen closed 4 years ago

EaglesChen commented 4 years ago

page state 的clone也进入了,state应该不是同一个。

class ChooseLabelPageState extends MutableSource
    implements Cloneable<ChooseLabelPageState> {
  List<LabelState> labelStateLists;

  @override
  ChooseLabelPageState clone() {
    return ChooseLabelPageState()..labelStateLists = labelStateLists;
  }

  @override
  Object getItemData(int index) => labelStateLists[index];

  @override
  String getItemType(int index) => 'cell';

  @override
  int get itemCount => labelStateLists?.length ?? 0;

  @override
  void setItemData(int index, Object data) => labelStateLists[index] = data;
}

ChooseLabelPageState initState(Map<String, dynamic> args) {
  return ChooseLabelPageState();
}
EaglesChen commented 4 years ago

但是示例的todo_list倒是更新了view,我不知道哪里出了问题。

EaglesChen commented 4 years ago

我只有手动刷新当前页面,view才会build。

EaglesChen commented 4 years ago

已经解决

iWeiCheng commented 4 years ago

是怎么解决的呢

zzsakurazz commented 3 years ago

怎么解决的呢?