setState<T> method

void setState<T>(
  1. LiveData liveData,
  2. LiveDataCallBack<T> fn, {
  3. bool notify = true,
})

通知订阅LiveData的组件更新。 notify 参数表示可关闭通知更新,只执行fn。

Implementation

void setState<T>(LiveData liveData, LiveDataCallBack<T> fn,
    {bool notify = true}) {
  liveData.setState((cv) {
    fn(cv);
  }, notify: notify);
}