Flutter 比较颤振redux中的旧视图模型和当前视图模型
在Flatter redux中,我们可以使用onDidChange和onWillChange来检测存储状态的变化。但有没有办法检测特定属性的变化 我能做点像这样的事吗Flutter 比较颤振redux中的旧视图模型和当前视图模型,flutter,flutter-redux,Flutter,Flutter Redux,在Flatter redux中,我们可以使用onDidChange和onWillChange来检测存储状态的变化。但有没有办法检测特定属性的变化 我能做点像这样的事吗 if(oldViewModel.changedProperty!=viewModel.changedProperty) 在react redux中,可以检查prevProps和currProps是否存在差异,并在此基础上执行操作。//作为性能优化,只有当 // As a performance optimization, the
if(oldViewModel.changedProperty!=viewModel.changedProperty)
在react redux中,可以检查prevProps和currProps是否存在差异,并在此基础上执行操作。//作为性能优化,只有当
// As a performance optimization, the Widget can be rebuilt only when the
// [ViewModel] changes. In order for this to work correctly, you must
// implement [==] and [hashCode] for the [ViewModel], and set the [distinct]
// option to true when creating your StoreConnector.
StoreConnector<AppState, AppState>(
distinct: true,
converter: (store) => store.state,
builder: ),
//[ViewModel]更改。为了使其正常工作,您必须
//为[ViewModel]实现[=]和[hashCode],并设置[distinct]
//创建StoreConnector时将选项设置为true。
StoreConnector(
是的,
转换器:(存储)=>store.state,
建筑商:),