Flutter - Can Google Sign in be used without firebase?

Yes ! you can.

  1. Create project in cloud console.

  2. Create OAuth 2.0 clientId (by restricting it with package name)

  3. Download the JSON and place it in android->app folder, thats it.

  4. Procced the steps as in google_sign_in package without getting into firebase

     GoogleSignIn googleSignIn = GoogleSignIn(
       clientId:"xxxx.apps.googleusercontent.com");
    

clientId is optional- but required in flutter web

Also refer this for flutter web google sign in without firebase


Yes. Try visa - https://github.com/e-oj/visa

Here's an example with Facebook auth (It also supports google, twitch, discord, and Github):

import 'package:visa/auth-data.dart';
import 'package:visa/fb.dart';

class AuthPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      /// Simply Provide all the necessary credentials
      body: FaceBookAuth().visa.authenticate(
          clientID: '139732240983759',
          redirectUri: 'https://www.e-oj.com/oauth',
          scope: 'public_profile,email',
          state: 'fbAuth',
          onDone: done
      )
    );
  }
}

and the "done" callback:

done(AuthData authData){
  print(authData);

  /// You can pass the [AuthData] object to a 
  /// post-authentication screen. It contaions 
  /// all the user and OAuth data collected during
  /// the authentication process. In this example,
  /// our post-authentication screen is "complete-profile".
  Navigator.pushReplacementNamed(
      context, '/complete-profile', arguments: authData
  );
}