Simple Firebase Auth In Flutter With Metadata Fields (2022)
Getting Firebase auth to work in Flutter is magical when you know how to do it, but unfortunately if you did it in years prior then you’re not likely to do it the same way today. I keep doing this over and over again when I start a new project, so I leave notes for myself in each year that I end up doing it. If you prefer a more automagical approach there’s the awesome flutterfire auth which looks easy-peasy at first blush, but I like to do things from scratch so I can understand them better … because it’s just my way. —JM
Packages You’ll Need
% flutter pub add firebase_auth
% flutter pub add cloud_firestore
% flutter pub add firebase_analytics
Process To Follow
Part 1: Set up backend stuff
- Go to the Firebase Console: https://console.firebase.google.com/
- Make a new project. It asks if you want to install Google Analytics, which depending upon your politics you’ll do what you think is best.