current method

Future<PatchbayInvocation> current({
  1. String? requestId,
})

Implementation

Future<PatchbayInvocation> current({String? requestId}) async {
  final String id = requestId ?? _newRequestId();
  final PatchbayGateRejection? gate = await _gates.evaluate(const <String>{});
  if (gate != null) return _gateRejected(id, gate);
  final _AdapterSnapshot snapshot;
  try {
    snapshot = _snapshot();
  } on Object catch (error) {
    return _observerFailed(id, error);
  }
  final PatchbayInvocation? invalid = _validateCurrent(id, snapshot);
  if (invalid != null) return invalid;
  return PatchbayInvocation.accepted(
    requestId: id,
    payload: PatchbayNavigationCurrentWire(
      outcome: 'observed',
      source: PatchbayFactSourceWire.appRecorded,
      navigationRevision: snapshot.observation.revision,
      destinationId: snapshot.observation.destinationId,
    ).toJson(),
  );
}