call method

  1. @override
T call()
override

Implementation

@override
T call() {
  assert(run(() {
    BuildOwner? buildOwner;
    try {
      buildOwner = WidgetsBinding.instance.buildOwner;
    } catch (_) {
      return true;
    }

    if (buildOwner != null &&
        buildOwner.debugBuilding &&
        !_debugRunningOperator &&
        !_debugDoingBuildThroughSc1) {
      throw Exception('Cannot get signal value directly during build');
    }
    if (_debugRunningOperator && !_debugOperatorSignals.contains(this)) {
      throw Exception('Signal not listed in operator');
    }
    return true;
  }));
  _signalRecorder?.add(this);
  return _getValue();
}