private async void BtnSalvar_Clicked(object sender, EventArgs e) { if (!ValidaDados()) { return; } try { ToastProgress.Show(); await firebaseHelper.VerificaEmail(txtEmail.Text.Trim()); await firebaseHelper.AddUser(txtEmail.Text.Trim(), txtSenha.Text.Trim()); await firebaseHelper.AddPerson(txtNome.Text.Trim(), txtEmail.Text.Trim(), txtTelefone.Value.ToString(), txtCPF.Value.ToString().Replace(',', '.'), txtCNH.Text.Trim(), "service-provider"); LoginViewModel viewModel = new LoginViewModel(); await viewModel.Login(txtEmail.Text, txtSenha.Text); ToastProgress.Hide(); UserDialogs.Instance.Toast("Cadastro realizado com sucesso!", TimeSpan.FromSeconds(3)); } catch (Exception ex) { ToastProgress.Hide(); string error = Validations.ErrorValidator.ValidaErrosAuth(ex.Message); await DisplayAlert("Ooopss...", error + "\n\nTente novamente!", "OK"); } }