setScopeState method

void setScopeState(
  1. VoidCallback fn, {
  2. bool notify = true,
})

通知所持有ViewModel的State组件更新。 notify 参数表示可关闭通知更新,只执行fn。

Implementation

void setScopeState(VoidCallback fn, {bool notify = true}) {
  if (!notify) {
    fn();
    return;
  }
  if (_stateCall != null) _stateCall!(fn);
}