useLink method

Future<void> useLink({
  1. bool? signedUp,
})

Uses the DirectLinkSlug.

Implementation

Future<void> useLink({bool? signedUp}) async {
  linkStatus.value = RxStatus.loading();

  try {
    if (status.value.isEmpty) {
      router.home(signedUp: signedUp);
    }

    router.dialog(
      await _authService.useDirectLink(_link),
      _authService.userId,
    );

    linkStatus.value = RxStatus.empty();
  } on UseDirectLinkException catch (e) {
    linkStatus.value = RxStatus.empty();
    MessagePopup.error(e.toMessage());
  } catch (e) {
    linkStatus.value = RxStatus.empty();
    MessagePopup.error(e);
    rethrow;
  }
}