Linked Questions

Popular Questions

Flutter Firebase.signInWithGoogle method not found

Asked by At

I am trying to add Google Authentication in my Flutter Application. But my Android studio is not able to find the method signInWithGoogle under FirebaseAuth class. I mean to say when I write FirebaseAuth.signInWithGoogle Android studio complains saying The method signInWithGoogle isn't defined for the class Firebase.

I already have the have Firebase.signInWithEmailAndPassword and it is working fine.

I have below dependency in pubspec.yaml firebase_auth: ^0.8.0+1

Below are my imports in the class...

import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:my_project/auth.dart';
import 'package:my_project/register.dart';
import 'package:my_project/signin/button_list.dart';
import 'package:my_project/signin/button_view.dart';
import 'package:my_project/utils.dart';
class _LoginPageState extends State<LoginPage> {
 final formKey = GlobalKey<FormState>();

// Google Sign In
final GoogleSignIn _googleSignIn = GoogleSignIn();
final FirebaseAuth _auth = FirebaseAuth.instance; // No errors so far

below is the method in the same class that shows the error enter image description here

Also when I click the ctrl + space to see all the methods under FirebaseAuth it is not showing the signInWithGoogle method at all.

enter image description here

please help! Thanks in Advance...

Related Questions