notify method

  1. @override
bool notify({
  1. SnapState<T>? nextSnap,
  2. SideEffects<T>? sideEffects,
  3. bool shouldOverrideDefaultSideEffects(
    1. SnapState<T>
    )?,
  4. StateInterceptor<T>? stateInterceptor,
})
override

Notify observers

Implementation

@override
bool notify({
  SnapState<T>? nextSnap,
  SideEffects<T>? sideEffects,
  bool Function(SnapState<T>)? shouldOverrideDefaultSideEffects,
  StateInterceptor<T>? stateInterceptor,
}) {
  final isNotified = super.notify(
    nextSnap: nextSnap,
    sideEffects: sideEffects,
    stateInterceptor: stateInterceptor,
  );
  if (!isNotified) {
    return false;
  }
  if (nextSnap == null) {
    return true;
  }
  if (shouldOverrideDefaultSideEffects?.call(_snapState) != true) {
    sideEffectsGlobal
      ?..onSetState?.call(_snapState)
      .._onAfterBuild?.call();
  }

  assert(() {
    if (debugPrintWhenNotifiedPreMessageGlobal != null &&
        _snapState._infoMessage != kInitMessage) {
      // if (_snapState == _snapState.oldSnapState) {
      //   return true;
      // }
      _snapState.debugPrint();
    }
    return true;
  }());
  return true;
}