How I Integrated Google Sign-In in Flutter in 15 Minutes (Android + iOS)
FlutterPulseThis article was translated specially for the channel FlutterPulseYou'll find lots of interesting things related to Flutter on this channel. Don't hesitate to subscribe!🚀

Skip the fluff. Let's implement what matters — because I know why you're here.
If you're reading this, you're probably in the middle of building a Flutter app and just need one thing working right now: Google Sign-In.
No fluff, no endless intros. Just a clean, reliable implementation that works for both Android and iOS in 2025. As someone who's been crafting mobile apps for 8+ years, I'll guide you through exactly what I use in real-world production.
Let's get your users logging in.
✅ What You'll Learn
- How to integrate Google Sign-In into your Flutter app (2025-ready)
- Set up for both Android and iOS platforms
- Clean UI and managing authentication state
- A full working example you can copy and use
Step-by-Step Implementation of Google Sign-In to your Flutter App
Just follow all the steps listed below and get your app equipped with the Google Sign-In.
1. 🧰 Required Packages
Add these to your pubspec.yaml file:
dependencies:
google_sign_in: ^6.2.1
firebase_auth: ^4.17.3
firebase_core: ^3.3.2
Then run:
flutter pub get
2. 🔧 Firebase Setup
Make sure your app is connected to Firebase. You only need to follow the official setup guide once:
👉 How to initialise Firebase in your Flutter app (2025 guide). Check and initialize the Firebase project first if it is pending yet, before going ahead.
You'll need to register both the Android and iOS versions of your app there.
3. 🔑 Enable Google Sign-In in Firebase Console
- Go to the Firebase Console
- Open your project → Authentication → Sign-in method
- Enable Google under sign-in providers
- Add a support email
- Save and you're done!
4. 🧭 Android Configuration
In android/app/build.gradleMake sure this is set:
defaultConfig {
...
minSdkVersion 21
}Then in android/app/src/main/AndroidManifest.xml, add:
<application>
...
<meta-data
android:name="com.google.android.gms.client_id"
android:value="@string/default_web_client_id"/>
</application>
Also, download google-services.json from Firebase and place it inside android/app If you initialize the Firebase project manually, and not with the Firebase CLI.
5. 🍏 iOS Configuration
- Download
GoogleService-Info.plistfrom Firebase (Skip it if you initialize the Firebase project by the Firebase CLI.) - Place it in
ios/Runner/(Skip it also if you initialize the Firebase project by the Firebase CLI.) - In
ios/Runner/Info.plist, add:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>YOUR_CLIENT_ID</string>
</array>
</dict>
</array>
Make sure to replace YOUR_CLIENT_ID With the actual value from your plist file.
Then run:
cd ios
pod install
6. 🧪 Dart Code Example
Here's a full working Flutter example with Google Sign-In:
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:google_sign_in/google_sign_in.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Google Sign-In Demo',
home: AuthScreen(),
);
}
}
class AuthScreen extends StatefulWidget {
@override
State<AuthScreen> createState() => _AuthScreenState();
}
class _AuthScreenState extends State<AuthScreen> {
User? user;
Future<void> signInWithGoogle() async {
final googleUser = await GoogleSignIn().signIn();
if (googleUser == null) return; // User canceled
final googleAuth = await googleUser.authentication;
final credential = GoogleAuthProvider.credential(
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
);
final userCredential = await FirebaseAuth.instance.signInWithCredential(credential);
setState(() => user = userCredential.user);
}
void signOut() async {
await GoogleSignIn().signOut();
await FirebaseAuth.instance.signOut();
setState(() => user = null);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Google Sign-In")),
body: Center(
child: user == null
? ElevatedButton(
onPressed: signInWithGoogle,
child: Text("Sign in with Google"),
)
: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
CircleAvatar(
backgroundImage: NetworkImage(user!.photoURL ?? ""),
radius: 40,
),
SizedBox(height: 10),
Text("Welcome, ${user!.displayName}"),
Text(user!.email ?? ''),
SizedBox(height: 20),
ElevatedButton(
onPressed: signOut,
child: Text("Logout"),
),
],
),
),
);
}
}
Once set up, the app lets users sign in with Google and displays their profile picture, name, and email. Works on both Android and iOS without platform issues.
✍️ Why There's No Long Intro
You already know what Google Sign-In is and why you need it. So I've cut straight to the part that matters — getting it working fast and error-free.
But if you want a deep dive comparing Google Auth with email/password login, let me know — I'll write it.
🛡️ Extra Tips
- Always test on real devices. Emulators often fail with Google auth.
- If switching accounts, call
GoogleSignIn().signOut()first. - Don't forget to add both SHA-1 and SHA-256 keys in the Firebase Console.
💛 A Little Help, A Lot of Impact
Creating helpful Flutter content takes hours — but sharing it with you is my passion.
If you'd like to express your gratitude, you can send a small tip or donation. Every bit helps me stay focused and also chip away at some personal debt.
👉 Donate on PayPal
Every little bit helps and means a lot. Thank you!
👋 Final Thoughts
Google Sign-In in Flutter is straightforward, but missing just one step can cause headaches. This guide is designed as a copy-paste-ready solution, I wish I had early on.
If it helped, feel free to bookmark it, share it with your team, or follow for more practical Flutter tutorials — no fluff, just solutions.