📦Implementação na Store

Exemplos de usos dos usecases de autenticação nas stores.

circle-exclamation

Exemplo de uso do Login com Google:

 @action
  Future loginWithGoogle(BuildContext context) async {
    try {
      loading = true;
      final result = await GetIt.I.get<ILoginWithGoogleUsecase>()();

      return result.fold(
        (l) {
          loading = false;
          customErrorHelper(context, e: l);
          printException("AuthStore.loginWithGoogle", l, l);
          return false;
        },
        (r) async {
          loading = false;
          
          //CASO QUEIRA USAR A CLASSE LOCAL AUTHENTICATION PARA VERIFICAÇÕES:
          
         Authentication.saveToken(
            (await FirebaseAuth.instance.currentUser?.getIdToken()) ?? "",
          );
          return true;
        },
      );
    } catch (e, s) {
      printException("AuthStore.loginWithGoogle", e, s);
      loading = false;
      return false;
    }
  }

Exemplo login com Apple:

Exemplo logout:

Exemplo de deletar conta:

Last updated