Connect with us


Flutter / Firebase google sign-in skips normal flow




I’m having trouble signing in with Google. It works-I sign in, but the screen flashes and I don’t see the sign-in flow with the account selected, so sign in with the main google. account. I don’t know what’s wrong.

That is not normal operation. You’ll usually see a small dialog that gives you the opportunity to select a Google account to sign in to. This is the part that isn’t happening. I tried it on my phone, it was never installed before the apk and the dialog didn’t show, but it was signed with the default account.

Any help is welcome:


import’package: firebase_auth / firebase_auth.dart’; import’package: riverpod / riverpod.dart’; final firebaseAuthProvider = provider((Ref) => FirebaseAuth.instance); Final authStateChangesProvider = StreamProvider((Ref) => (firebaseAuthProvider) .authStateChanges ());

auth_widget.dart. -> This is intended to display the home page or login page depending on the authentication status.

The class AuthWidget extends ConsumerWidget {constAuthWidget ({Key? Key}): super (key: key); @override Widget build (BuildContext context, WidgetRef ref) {final authStateChanges = (authStateChangesProvider); return authStateChanges. when (data: (user) => user! = null? constant HomePage (): LoginPage (), loading: () => const Center (child: CircularProgressIndicator ()), error: (error, __) => Scaffold ( body: Center (child: Text (error.toString ()),),),);}}


Final authServiceProvider = Provider((Ref) => FirebaseAuthService (; Class FirebaseAuthService {FirebaseAuthService (this._read); Final Reader_read; // TODO add in try / catch with firebase exeptions Future signInAnonymously () async {await _read (firebaseAuthProvider) .signInAnonymously ();} User? getCurrentUser () => _read (firebaseAuthProvider) .currentUser; Future signOut () async {await _read (firebaseAuthProvider) .signOut ();} Future signInWithGoogle () async {try {// _googleSignIn.signIn (); Wait for the final GoogleSignInAccount? googleUser = await GoogleSignIn (). signIn (); // Do you want to get the authentication details from the final GoogleSignInAuthentication of the request? googleAuth = googleUser? Wait for .authentication; // create a new credential finalcredential = GoogleAuthProvider.credential (accessToken: googleAuth? .AccessToken, idToken: googleAuth? .idToken,); return await _read (firebaseAuthProvider) .signInWithCredential (credential);} catch ( error) {throw FirebaseAuthException (code: error.toString ());}}}

The signInWithGoogle method above is copy and paste from the document, except that the last line links the firebaseAuthProvider to get its top-level authentication instance. Running this method from the sign-in page will sign you in, but skip the normal flow. Any ideas?




The mention sources can contact us to remove/changing this article

What Are The Main Benefits Of Comparing Car Insurance Quotes Online

LOS ANGELES, CA / ACCESSWIRE / June 24, 2020, / Compare-autoinsurance.Org has launched a new blog post that presents the main benefits of comparing multiple car insurance quotes. For more info and free online quotes, please visit https://compare-autoinsurance.Org/the-advantages-of-comparing-prices-with-car-insurance-quotes-online/ The modern society has numerous technological advantages. One important advantage is the speed at which information is sent and received. With the help of the internet, the shopping habits of many persons have drastically changed. The car insurance industry hasn't remained untouched by these changes. On the internet, drivers can compare insurance prices and find out which sellers have the best offers. View photos The advantages of comparing online car insurance quotes are the following: Online quotes can be obtained from anywhere and at any time. Unlike physical insurance agencies, websites don't have a specific schedule and they are available at any time. Drivers that have busy working schedules, can compare quotes from anywhere and at any time, even at midnight. Multiple choices. Almost all insurance providers, no matter if they are well-known brands or just local insurers, have an online presence. Online quotes will allow policyholders the chance to discover multiple insurance companies and check their prices. Drivers are no longer required to get quotes from just a few known insurance companies. Also, local and regional insurers can provide lower insurance rates for the same services. Accurate insurance estimates. Online quotes can only be accurate if the customers provide accurate and real info about their car models and driving history. Lying about past driving incidents can make the price estimates to be lower, but when dealing with an insurance company lying to them is useless. Usually, insurance companies will do research about a potential customer before granting him coverage. Online quotes can be sorted easily. Although drivers are recommended to not choose a policy just based on its price, drivers can easily sort quotes by insurance price. Using brokerage websites will allow drivers to get quotes from multiple insurers, thus making the comparison faster and easier. For additional info, money-saving tips, and free car insurance quotes, visit https://compare-autoinsurance.Org/ Compare-autoinsurance.Org is an online provider of life, home, health, and auto insurance quotes. This website is unique because it does not simply stick to one kind of insurance provider, but brings the clients the best deals from many different online insurance carriers. In this way, clients have access to offers from multiple carriers all in one place: this website. On this site, customers have access to quotes for insurance plans from various agencies, such as local or nationwide agencies, brand names insurance companies, etc. "Online quotes can easily help drivers obtain better car insurance deals. All they have to do is to complete an online form with accurate and real info, then compare prices", said Russell Rabichev, Marketing Director of Internet Marketing Company. CONTACT: Company Name: Internet Marketing CompanyPerson for contact Name: Gurgu CPhone Number: (818) 359-3898Email: [email protected]: https://compare-autoinsurance.Org/ SOURCE: Compare-autoinsurance.Org View source version on accesswire.Com:https://www.Accesswire.Com/595055/What-Are-The-Main-Benefits-Of-Comparing-Car-Insurance-Quotes-Online View photos


to request, modification Contact us at Here or [email protected]